can close the database Connection before the JTA transaction commit or roll

05-09-20 blur
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

banq
2005-09-20 15:22
可以。这实际类似Hibernate中的跨session 事务,跨段事务。这是JTA的特征所在。

猜你喜欢