Hi Henry,
Readonly transactions are something that is provided by Spring.NET and
various Java persistence frameworks (EJB3, Spring). I find them useful
when working with NHibernate to prevent unwanted commits of dirty
objects.
Imagine the following scenario in a 3 tiered application (Web/Service/
Data Access) where the transactions are managed at the Service level
by ATM:
- Transactional service 1 is called and makes some modifications to an
entity which fail validiation, so the transaction is rolled back.
- Transaction service 2 is called by the web front end to retrieve
some data to display to the user in the next screen.
If service 2 is not run in a read only transaction then the previous
changes made to the entity in service 1 will be commited to the
database, despite the previous transaction being rolled back.
There may be other (better) examples of why it is useful, but this is
one that I have encountered.
regards,
Jordan.
On May 4, 5:16 pm, Henry Conceição <
henry.concei...@gmail.com> wrote:
> Why do you want to a readonly transaction? A readonly session isn't enough?
>
> Cheers,
> Henry Conceição
>
>
>
> On Tue, May 4, 2010 at 12:55 PM, Jordan <
augustusgor...@yahoo.co.uk> wrote:
> > Hello everyone,
>
> > I've just made some changes to Services.Transactions, NHibernate
> > integration and ATM to add support for readonly transactions. I feel
> > this could be a really useful addition.
>
> > Basically, I've added a ReadOnly parameter to the
> > TransactionAttribute. This flag is then passed to the ResourceAdapter
> > in NHibernate intergration which temporarily sets the FlushMode to
> > FlushMode.Never for the duration of the transaction.
>
> > Is this something you would be interested in reviewing? If so, would
> > you like some patches?
>
> > regards,
> > Jordan.
>
> > --
> > You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
> > To post to this group, send email to
castle-pro...@googlegroups.com.
> > To unsubscribe from this group, send email to
castle-project-d...@googlegroups.com.
> > For more options, visit this group athttp://
groups.google.com/group/castle-project-devel?hl=en.
> For more options, visit this group athttp://
groups.google.com/group/castle-project-devel?hl=en.