Java Mailing List Archive

http://www.gg3721.com/

Home » the NHibernate development list »

Re: [NHibernate-development] NHibernateIntegration & latest N

Andrew Burgher

2008-06-19


Author LoginPost Reply

(Moving thread to NH-dev)

 

Oren –

 

I realised there are already a number of open issues on this topic (NH-545, NH-754, NH-861) so rather than create a new one I’ve attached a TestFixture.cs to NH-754 (http://jira.nhibernate.org/browse/NH-754)

 

The test explore interactions between System.Transactions.TransactionScope & NH2.0. (It could possibly be patched in to the actual solution with some modifications...)

 

As at NH2.0 Alpha 1 - two scenarios cause unexpected failure:

 

 - Close a NH session explicitly within a TransactionScope results in System.ObjectDisposedException : Session is closed!

(Possibly OK. Closing a session within the transaction doesn’t really make sense – but a better exception might help. Alternatively, closing the session with an active TransactionScope could just be a null-operation. Ie. Not fail, but not really do anything either – just deferring the actual close/dispose to when the tx commits.)

 

 - With the default FlushMode.Auto setting on the session, when you explicitly flush a second NH session nested within the same TransactionScope you get a System.Transactions.TransactionInDoubtException : The transaction is in doubt

(This is unexpected / undesirable. My guess is that it shouldn’t matter if I flush one or many times; on one or many sessions  – the TransactionScope is still going to define the actual tx boundary. That said, if there is strict pattern of usage here then better exceptions might help)

 

HTH,

 

Andrew

 

 

From: castle-project-devel@googlegroups.com [mailto:castle-project-devel@googlegroups.com] On Behalf Of Ayende Rahien
Sent: Saturday, 14 June 2008 10:39 AM
To: castle-project-devel@googlegroups.com
Subject: Re: NHibernateIntegration & latest N

 

Yes, I think we need to have this. I am pretty sure that it is the NH code that is wrong (I probably wrote it, so it is already suspect).
If you can create a test case that repro this I would be very grateful

On Sat, Jun 14, 2008 at 12:55 AM, Andrew Burgher <aburgher@hotmail.com> wrote:

Oren –

 

I can't really suggest what NH2.0 should be doing here.... but with your comment as additional evidence I believe this may be an issue with the NH 2.0 handing for System.Transactions. Would you like me to raise an issue on the NHibernate JIRA?

 

My team recently moved to a build from the current NH2.0 trunk and encountered the same issue. Without too much digging into the NHFacility or NH code base we were able to find a workaround (basically by taking responsibility for the session flush ourselves - and only doing it once within a given System.Transactions.TransactionsScope.) Simple transaction scenarios looked fine (against a SQL 2K5 database)– but once we enlisted a second resource (an MSMQ queue) then it broke. From memory, the error we saw was : 'Transaction in doubt'

 

Regards,

Andrew

 

 

From: castle-project-devel@googlegroups.com [mailto:castle-project-devel@googlegroups.com] On Behalf Of Ayende Rahien
Sent: Friday, 13 June 2008 10:57 PM
To: castle-project-devel@googlegroups.com
Subject: NHibernateIntegration & latest NH

 

NH now supports integration with System.Transactions, and it has broken the NHibernateIntegration tests that deals with the distributed transactions.
Specifically, it looks like NH is calling enlistment.Done() when it is inappropriate, when we commit a distributed transaction on method exit, and this is not allowed.
I know very little about 2PC, so I am not sure what is supposed to happen here.
Ideas?

 

 



--~--~---------~--~----~------------~-------~--~----~
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-project-devel@googlegroups.com
To unsubscribe from this group, send email to castle-project-devel-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Nhibernate-development mailing list
Nhibernate-development@(protected)
https://lists.sourceforge.net/lists/listinfo/nhibernate-development
©2008 gg3721.com - Jax Systems, LLC, U.S.A.