[ http://jira.jboss.com/jira/browse/JBAS-1372?page=history ]
Scott M Stark reassigned JBAS-1372:
-----------------------------------
Assign To: Steve Ebersole (was: Scott M Stark)
> HIbernateContext does not work well with CachedConnectionManager
> ----------------------------------------------------------------
>
> Key: JBAS-1372
> URL: http://jira.jboss.com/jira/browse/JBAS-1372
> Project: JBoss Application Server
> Type: Bug
> Components: Hibernate service, JCA service
> Versions: JBossAS-4.0.1 Final
> Environment: Jboss 4.0.1
> Windows 2000
> JDK 1.5
> Reporter: janssk1
> Assignee: Steve Ebersole
>
>
> I'm trying to use the HibernateContext to create an hibernate session that
> will be automatically flushed on JTA transaction commit. This works well but
> the jboss log files are getting filled with warning messages from the
> CachedConnectionManager. see below for a log file
> I have a simple CMT SSB that gets the hibernate session using
> HibernateContext, updates an object and that' s it. My code does not do any
> transaction management or explicit hibernate flush.
> After the method is finished, the transaction invoker will kick in and commit
> the transaction. Since the transaction contains some synchronization
> listeners, these will be notified appropriatly. Two listeners are available.
> One listener attached by the HibernateContext (this one will flush and close
> the session) and another one added by the CachedConnectionManager. This one
> will try to close the connection if it was not properly closed. When the
> hibernate listener tries to close the session, the cachedconnectionmanager
> will be notified that the connection is closed. This should normally remove
> the connection from its internal caches and also remove the automatic close
> on transaction termination from the current transaction. Since the connection
> is explicity closed, it does not need to be closed implicitly anymore.
> However, this does not work as expected (see the trace). A looked a bit in
> the code and the problem seems to be related to the interceptor stack. In a
> standard jboss installation, an ejb is configured with (among others) a
> transaction interceptor followed by a cachedconnectioninterceptor. The
> cachedconnectioninterceptor sets some context (metaAwareObject = bean) on the
> cachedconnectionmanager. However, in the finally block of the transaction
> interceptor, the cachcedconnection interceptor is already finished and the
> context is no longer available. This explains the 'Trying to return an
> unknown connection' exception. The 'Closing connection for you' message is
> related (i think) to the fact that the current transaction is no longer
> active when the cachedconnection manager is notified of the connection close.
> It the transaction is not active anymore, the cachedconnection manager does
> not remove the automatic close on transaction termination. So after the
> hibernate listener is finshed (connection closed), the other listener
> attached by the cached connection manager kicks in and closes it once more.
> I was able to get rid of all the (unnecessary) warning by simply removing the
> cached connection interceptor. However, i would like to keep it since it
> provides me basic stupidy protection.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
JBoss-Development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-development