简体   繁体   中英

hibernate.transaction.manager_lookup_class VS hibernate.transaction.jta.platform

I have this hibernate.transaction.manager_lookup_class property in my persistence.xml, Then i have this warning message when running my application.

Using deprecated org.hibernate.transaction.TransactionManagerLookup strategy [hibernate.transaction.manager_lookup_class], use newer org.hibernate.service.jta.platform.spi.JtaPlatform strategy instead [hibernate.transaction.jta.platform]

I don't know what is the different between the 2 properties ? And what is the use of them ?

Could anyone explain the difference and the use of them

I'm using hibernate 4 with websphere 8.5

The JtaPlatform offers more transaction-like integrations besides just the transaction manager, notably:

  • how to locate transaction manager
  • how to user transaction
  • how to register transaction synchronization

You can see the full JtaPlatform interface on GitHub here: https://github.com/hibernate/hibernate-orm/blob/master/hibernate-core/src/main/java/org/hibernate/engine/transaction/jta/platform/spi/JtaPlatform.java

Replace the following:

<property name = "hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>

with

<property name = "hibernate.transaction.jta.platform" value ="org.hibernate.service.jta.platform.internal.JBossAppServerJtaPlatform"/>

in the Hibernate configuration/persistence.xml.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM