-->
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.  [ 4 posts ] 
Author Message
 Post subject: Infinispan with JDBC Transactions and Hibernate 4.2.18
PostPosted: Wed Aug 23, 2017 10:20 am 
Newbie

Joined: Thu Aug 03, 2017 9:25 am
Posts: 6
Hello guys,

I'm using Hibernate 4.2.18 and I want to add Infinispan as a second level cache provider. I also don't want to use JTA transactions neither CMTTransactions. I am using JdbcTransactionFactory.
I see that in Hibernate 5 it is possible without any special configuration, however in Hibernate 4.2.18 infinispan-configs.xml defines every transaction property as TRANSACTIONAL. With these settings I can't even create SessionFactory since it throws an exception that it can't find TransactionManager.
One solution I found is to provide a custom configuration file which is a copy of the one in hibernate-infinispan module with changed all TRANSACTIONAL to NON_TRANSACTIONAL. But I'm not sure if it is going to work properly. What should I do?

Thank you in advance your your answers.


Top
 Profile  
 
 Post subject: Re: Infinispan with JDBC Transactions and Hibernate 4.2.18
PostPosted: Wed Aug 23, 2017 10:46 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
In Hibernate 5, the infinispan-configs.xml file contains the following transaction config:

Code:
<transaction mode="NONE" />


Try to see if it works. If it doesn't, then you should upgrade to Hibernate 5 since 4.x is no longer supported.


Top
 Profile  
 
 Post subject: Re: Infinispan with JDBC Transactions and Hibernate 4.2.18
PostPosted: Thu Aug 24, 2017 9:43 am 
Newbie

Joined: Thu Aug 03, 2017 9:25 am
Posts: 6
It works. I mean SessionFactory is created with these setting and there are some puts and hits to the 2nd level cache. However, I'm not sure if it's safe and stable. For example, what would happen if I want to run Hibernate and Infinispan with such a config on JBoss maybe more than one instance in cluster? The system works in production and does not use JTA neither CMT and won't unless it's absolutely necessary.
Upgrading Hibernate to newer version is not a solution, because we have currently JBoss 6 and it supports JPA 2.0 and Hibernate 4.2.18.


Top
 Profile  
 
 Post subject: Re: Infinispan with JDBC Transactions and Hibernate 4.2.18
PostPosted: Thu Aug 24, 2017 10:22 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
In this case, you are better off asking this question on the Infinispan forum and on the JBoss forum since they surely know better the answer to your question.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.