-
1. Re: Randomly entity not found 'onMessage'
ataylor Jun 3, 2012 10:28 AM (in response to marhat)I dont really see this as a hornetq question, I would ask on the Hibernate forums
-
3. Re: Randomly entity not found 'onMessage'
clebert.suconic Jun 8, 2012 4:53 PM (in response to leosbitto)@Leos I think on this case it was just some misuse on Hibernate. Or even maybe not rolling back properly the message on the Transaction Manager. I believe this is well established how it should behave at this point.
-
4. Re: Randomly entity not found 'onMessage'
marhat Jun 8, 2012 5:35 PM (in response to marhat)@Clebert, i disagree that this case is "just some misuse on Hibernate".
The link provided by Leos descibes exactly the problem I am facing. In the short term, I am having to rewrite code and lose minor functionality to overcome. In the long term, I am investigating the solutions put forward in the link.
-
5. Re: Randomly entity not found 'onMessage'
clebert.suconic Jun 9, 2012 7:11 PM (in response to marhat)We just set the transaction at the onMessage, all you need to do is to configure hibernate properly to the transaction manager. What makes it a configuration issue outside of HornetQ.
-
6. Re: Randomly entity not found 'onMessage'
leosbitto Jun 12, 2012 6:07 AM (in response to clebert.suconic)As I have described in that Jira issue JMS_SPEC-28, if everybody (HornetQ and Hibernate in this case) just states "not my issue", it is not going to work. In this case it would help if HornetQ would be able to implement the marker interface com.arjuna.ats.jta.resources.EndXAResource for its XAResource. I understand that creating such direct dependency on Arjuna's API is not acceptable, but providing some extensibility (API for providing an optional wrapper for XAResource maybe?) could be possible, couldn't it?
-
7. Re: Randomly entity not found 'onMessage'
jbertram Jun 12, 2012 10:55 AM (in response to leosbitto)To be fair, this really isn't a HornetQ issue. Even Nigel said, "...this doesn't sound like something that can be tackled at the level of an individual resource manager such as JMS." The problem should be addressed by the JTA specification.
As you pointed out, JBossTS (the transaction manager used by JBoss AS) has an extension that will allow more control of this, but there are handful of problems with having our XAResource implementation also implement com.arjuna.ats.jta.resources.EndXAResource. These are the issues I can think of off the top of my head:
- We'd need to provide 3 implementations - one that implemented com.arjuna.ats.jta.resources.EndXAResource, one that implemented com.arjuna.ats.jta.resources.StartXAResource, and one that didn't implement either (which would be default). We wouldn't want to change the default behavior or only provide the option to make it the last resource committed.
- This would only help when JBossTS was used as the TM. Since HornetQ can be deployed embedded in other containers and accessed remotely from other containers even when run within JBoss AS (or standalone) this is far from a complete solution.
- This is essentially a hack which likely brings unwanted dependencies.
As I understand it, this is a known weakness in JTA (which is why the JBossTS work-around exists). However, I'm not sure what measures have been undertaken to resolve it - if any. I'm interested to see what happens on http://java.net/jira/browse/JAVAEE_SPEC-1.
I'll ask Clebert what he wants to do here as far as it concerns HornetQ as it's not clear to me if this is really something we want to do.
-
8. Re: Randomly entity not found 'onMessage'
ataylor Jun 12, 2012 11:50 AM (in response to jbertram)also read http://jbossts.blogspot.co.uk/2011/04/messagingdatabase-race-conditions.html which has some good insight into it. It also suggest a way around the issue altho slightly clunky.
As far as I am aware this is being tackled in the JTA 1.2 spec.
maybe one thing you can do is use a user managed tx and enlist the resources in the order you want them commited.
-
9. Re: Randomly entity not found 'onMessage'
ataylor Jun 12, 2012 11:44 AM (in response to ataylor)also according to the TS team EndXAResource is an internal API that has some side effects that we wouldnt want