-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
 Post subject: can close the database Connection before the JTA transaction
PostPosted: Mon Sep 19, 2005 10:21 pm 
Newbie

Joined: Mon Sep 19, 2005 10:17 pm
Posts: 3
hi, all


can close the database Connection before the JTA transaction commit or rollback?

my understanding:

if the connection not come from connection pool. i think this must be a issue, but if Connection come from pool, the close method just return it to pool, but due to multithread environment, the connection maybe can be used immediately by another thread, but the the previous transaction still not commit or rollback, but the connection aleady service for other service(maybe into another transaction), i think
this will produce an unexpected result.

i can't confirm my understanding, i aleady be confused , please help me!

thanks

regards


Top
 Profile  
 
 Post subject: Re: can close the database Connection before the JTA transac
PostPosted: Mon Sep 19, 2005 11:38 pm 
Newbie

Joined: Mon Sep 19, 2005 11:11 pm
Posts: 7
bluru2 wrote:
hi, all


can close the database Connection before the JTA transaction commit or rollback?

my understanding:

if the connection not come from connection pool. i think this must be a issue, but if Connection come from pool, the close method just return it to pool, but due to multithread environment, the connection maybe can be used immediately by another thread, but the the previous transaction still not commit or rollback, but the connection aleady service for other service(maybe into another transaction), i think
this will produce an unexpected result.

i can't confirm my understanding, i aleady be confused , please help me!

thanks

regards


not quite understand u by producing an unexpected result with reusing the released connection. i think when a connection is released to the pool, all objects/status related to this connection are cleared and no longer exist


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 19, 2005 11:59 pm 
Newbie

Joined: Mon Sep 19, 2005 10:17 pm
Posts: 3
my means: if do as above description, whether have any issue or problem?

thanks


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 20, 2005 10:15 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
Here's an idea: try it!

In JTA, connections (managed resources) associated with a transaction are not available for re-use outside that transaction until the end of said transaction. Read up on how JTA and JCA work.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 20, 2005 10:21 pm 
Newbie

Joined: Mon Sep 19, 2005 10:17 pm
Posts: 3
thanks

that's means that the same connection can't participate the diffrent JTA transaction in the same time?

thanks

i will read the specification, can u give me the excerpt from the specification about this? i thanks a lot

regards


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 21, 2005 1:00 am 
Newbie

Joined: Sun Sep 11, 2005 11:36 pm
Posts: 6
Hi
answering to the forst query...i can say that

1. if the connection not come from connection pool. i think this must be a issue,
Yes! this can be an issue

2. if Connection come from pool, the close method just return it to pool,
Yes! this is also true

3. but due to multithread environment, the connection maybe can be used immediately by another thread, but the the previous transaction still not commit or rollback, but the connection aleady service for other service(maybe into another transaction),
No! as the connection will close and the changes wont take effect so there is no point of committ or no point of rollback.
you have to explicitely do that as the state can be still in the cache ready to be committed or rollbacked....!!


hope u got the answers.

thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


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

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.