[hibernate-dev] new proposal for tx timeout handling using transaction DISASSOCIATING event notification...

Scott Marlow smarlow at redhat.com
Mon Aug 10 09:40:26 EDT 2015



On 08/07/2015 02:41 PM, Steve Ebersole wrote:
> Yeah, which is great when you can rely on impl-specific apis.

Agreed.  I'm not sure of what we should do when ORM is running in 
environments that cannot rely on a NarayanaJtaPltaform.  Especially, 
when every call into Hibernate ORM is from a different thread (e.g. 
remote EJB invocations).

I think the below idea of deferring to the JtaPlatform to indicate the 
"type of timeout tracking" to do, is the best approach.

>
> I'll consider this, but its not super high on my priority list.  I guess
> we could implement some kind of way for the JtaPlatform to indicate the
> "type of timeout tracking" to do and develop a new NarayanaJtaPltaform
> that does this.

Is this more of an ORM 5.1 or 6.0 change?

>
>
> On Fri, Aug 7, 2015 at 11:30 AM Scott Marlow <smarlow at redhat.com
> <mailto:smarlow at redhat.com>> wrote:
>
>     https://github.com/wildfly/wildfly/pull/7909 uses the Narayana
>     org.jboss.tm.listener.TransactionListenerRegistry to be notified when
>     the transaction is associated/deassociated with the JTA transaction.
>
>     I think that Hibernate ORM could do something similar with the
>     org.jboss.tm.listener.TransactionListenerRegistry to protect against
>     clearing the persistence context from a non-application thread, while
>     the application thread may be actively using the persistence context.
>
>     I think this approach is simpler than the thread id tracking.
>
>     On 03/10/2015 01:51 PM, Scott Marlow wrote:
>      >>
>      >> So what is this buying us?
>      >>
>      >
>      > The current Hibernate ORM thread id checking, does not properly
>     handle
>      > the case when the application thread changes between calls to the
>      > Hibernate session.  The new approach does handle the application
>     thread
>      > changing between session invocations and also covers a few other
>     cases
>      > as well (like clearing the persistence context after the
>     application may
>      > of added another entity after the background thread rolled back the
>      > transaction).
>      > _______________________________________________
>      > hibernate-dev mailing list
>      > hibernate-dev at lists.jboss.org <mailto:hibernate-dev at lists.jboss.org>
>      > https://lists.jboss.org/mailman/listinfo/hibernate-dev
>      >
>


More information about the hibernate-dev mailing list