Question about CmsHttpContext.RollBackAll()
Windows Server Forum Index Windows Server
Server discussion on Windows platform.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web winserverhelp.com
Question about CmsHttpContext.RollBackAll()
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Windows Server Forum Index -> CMS Server
Author Message
Stefan [MSFT]
Guest





Posted: Wed Nov 09, 2005 5:51 pm    Post subject: Re: Question about CmsHttpContext.RollBackAll() Reply with quote

Hi Charly,

between postbacks the context is not persisted.
The livetime of a CmsContext is exactly one request.

I assume that the CmsEndModule will do a CommitAll before it disposes the
context.
With other words: it is not possible to preserve changes between postbacks.

Cheers,
Stefan

--
This posting is provided "AS IS" with no warranties, and confers no rights

New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
----------------------


"Charly" <cbretana@areteind.com> wrote in message
news:1131548835.300922.16100@g44g2000cwa.googlegroups.com...
Quote:
Stefan,

Hi, Kenneth is researching this for a project we are working on
together. We know it is not being rolled back because when we close
the template (this is a Postback in which we call
CmsHttpContext.RollBackALl() And reload the same posting into the
template again, the changes made in the previous seesion are still
visible.

I have noticed something else. If we make some changes, and
immediately close the template form, (calling RollbackAll() on the
close ), the changes are not persisted.... But we have some
functionality on the template form that does a postback, and if we use
that functionality, and then on a subsequent postback close the form,
the changes are persisted... could the postbacl be afecting this ?

Regards,
Charly
Back to top
Stefan [MSFT]
Guest





Posted: Wed Nov 09, 2005 5:51 pm    Post subject: Re: Question about CmsHttpContext.RollBackAll() Reply with quote

Hi Charly,

no. Only a Commit will write to the database.

Cheers,
Stefan

--
This posting is provided "AS IS" with no warranties, and confers no rights

New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
----------------------


"Charly" <cbretana@areteind.com> wrote in message
news:1131551582.765456.175460@g44g2000cwa.googlegroups.com...
Quote:
Stefan,

Isn't the placeholder writing to the DB, on each postback, simply
because it's "bound" to a placeholder definition? In a vanilla
implementation, where you just put a placeholer on a template, and do
not call any PAPI functions,, how else does content get into DB ? I
assumed that the rollbackALl or COmmitAll()) was to either "undo" or
"finalize" the automatic database write that had already happened...
Back to top
Charly
Guest





Posted: Wed Nov 09, 2005 5:51 pm    Post subject: Re: Question about CmsHttpContext.RollBackAll() Reply with quote

Stefan,

SOmething else you mentioned... "I assume that the CmsEndModule will
do a CommitAll before it disposes the
context"

What does this mean ? and How can I check this? If something is
automatically calling CommitAll() on our postbacks, that would explain
the behavior we are seeing...
Back to top
Charly
Guest





Posted: Wed Nov 09, 2005 5:51 pm    Post subject: Re: Question about CmsHttpContext.RollBackAll() Reply with quote

Stefan,

Isn't the placeholder writing to the DB, on each postback, simply
because it's "bound" to a placeholder definition? In a vanilla
implementation, where you just put a placeholer on a template, and do
not call any PAPI functions,, how else does content get into DB ? I
assumed that the rollbackALl or COmmitAll()) was to either "undo" or
"finalize" the automatic database write that had already happened...
Back to top
Charly
Guest





Posted: Wed Nov 09, 2005 5:51 pm    Post subject: Re: Question about CmsHttpContext.RollBackAll() Reply with quote

No I was not calling RollbackAll in same request... But I was not
calling CommitAll either,

OOPS, Found It !!!

I Just needed to set CmsHttpContext.RollbackOnSessionEnd = true;
The default is false, and this implicitly calls CommitAll on sesion
end...
(And I need to persist the changes between requests into Viewstate or
something else.. )

Again, Thanks much for your help!

Charly
Back to top
Stefan [MSFT]
Guest





Posted: Wed Nov 09, 2005 5:51 pm    Post subject: Re: Question about CmsHttpContext.RollBackAll() Reply with quote

Hi Charly,

that's what I assumed - but I did not know that it is configurable!
Interesting!
Nice to learn something new every day!

Cheers,
Stefan

--
This posting is provided "AS IS" with no warranties, and confers no rights

New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
----------------------


"Charly" <cbretana@areteind.com> wrote in message
news:1131556115.544340.235310@o13g2000cwo.googlegroups.com...
Quote:
No I was not calling RollbackAll in same request... But I was not
calling CommitAll either,

OOPS, Found It !!!

I Just needed to set CmsHttpContext.RollbackOnSessionEnd = true;
The default is false, and this implicitly calls CommitAll on sesion
end...
(And I need to persist the changes between requests into Viewstate or
something else.. )

Again, Thanks much for your help!

Charly
Back to top
 
Post new topic   Reply to topic    Windows Server Forum Index -> CMS Server All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




New Topics Powered by phpBB