Forums Register Login

Hibernate - difference btw JDBCTransactionFactory and JTATransactionFactory

+Pie Number of slices to send: Send
Hello,

what is the advantage of using JTATransactionFactory over default JDBCTransactionFactory ?

I mean in hibernate config file, we can set hibernate.transaction.factory_class to org.hibernate.transaction.JTATransactionFactory else it will use default org.hibernate.transaction.JDBCTransactionFactory.
Please clarify on the advantage of one over the other.

thanks
Ravi Shankar
1
+Pie Number of slices to send: Send
+Pie Number of slices to send: Send
Thanks Bill.
I was reading that before. What I didnt understand is, say If I have a J2EE server (Jboss) and I am running a non-EJB application,
then does picking either one of JDBCTransactionFactory / JTATransactionFactory will make any difference ?
+Pie Number of slices to send: Send
Typically you need an application server's JTA capability only if your application needs to handle transactions across multiple resources, which is not a requirement for many applications.
+Pie Number of slices to send: Send
Thanks. When you say "if your application needs to handle transactions across multiple resources", does multiple resources mean,
some other resource parallel to a database connection (jdbc) ? do I understand it correctly ?
+Pie Number of slices to send: Send
Basically when you have to update multiple back-end systems in the same transaction. This might be multiple databases or another example may be processing JMS messages from a queue and inserting the results in a database. In this case one resource is the database and the other resource is the JMS queue. You would not want a failure to cause a loss of messages whose results are not yet stored in the database.

In either event the key is multiple resources in the same transaction.
+Pie Number of slices to send: Send
Very clear. Thanks a lot Bill.
Something about .... going for a swim. With this tiny ad ...
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 7967 times.
Similar Threads
Unidirectional Association
i am using Hibernate with Seam and getting errors
what are the advantage of Hibernate Over Jdbc?
hibernate JTA transaction: Failed to instantiate TransactionFactory
Transaction management on multiple DB connections using hibernate
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 11:14:17.