The application is using Eclipse link 2.2.3 as its JPA provider on weblogic 12c . Until then Kodo was used as the JPA provider.
The database is SQL server 2008
With Eclipse link we started facing deadlock issues.
when the app is trying to update/merge a entity we are starting to get deadlock issues. The transaction is managed by the application . The transaction is committed as soon as its completed but still facing issues with deadlock.
what could be the reason for deadlock? No two transactions initiated by the application can update the same row. While doing a transaction , is the row locked or the table locked. IT should be the row right?Not sure who is holding the lock on the record and not releasing it. Should I manually call flush() after committing.
I believe as soon as the application starts the transaction , the autocommit is set to false
//find entity, update and merge it
Local Exception Stack:
Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLTransactionRollbackException: [FMWGEN][SQLServer JDBC Driver][SQLServer]Transaction (Process ID 178) was deadlocked on lock | communication buffer resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
Error Code: 1205