On 04/05/2011 11:23 AM, Max Rydahl Andersen wrote:
> Like I said, I do not think that is enough as I think that if you
get the
> connection, you also need the "transaction context" holding that
connection.
> "transacvtion context" here is the TransactionCoordinator.
>
> session.sessionWithOptions().transactionContext().openSession()
Okey and the transactionContext actually continues to lives on even though the source
session
is closed, correct ?
No, that is not correct. And the same is true of the
corollary in the
"old code" using its Connection as well. In the old code, if you did:
factory.openSession( someExistingSession.connection() )
the new session is screwed once 'someExistingSession' is closed.
Trying to get my head around some of the old special case assumptions
;)
Well my argument is always that assumptions are bad :) Make it a contract
--
Steve Ebersole <steve(a)hibernate.org>
http://hibernate.org