Reputation: 447
I need get the transaction id of hibernate. This id must be unique for each transaction. I tried to use the session.getTransaction().hashCode(), but i believe that this value is not unique.
Upvotes: 4
Views: 3248
Reputation: 1261
Transaction id is database specific. So you will need to invoke native SQL query to get this information from within your transaction in Hibernate.
Examples:
Get current database transaction id using jdbc/hibernate?
SQL Server Triggers - grouping by transactions
http://hemantoracledba.blogspot.com/2014/06/getting-your-transaction-id.html
Upvotes: 1