Finest: doGet EmployeeUpdateServlet
Finest: Action = find
Finest: Session created
Finest: EmployeeUpdateServiceBean created
Finest: UserTransaction started
Finer: client acquired: 1905241820
Finer: TX binding to tx mgr, status=STATUS_ACTIVE
Finer: acquire unit of work: 270608323
Finest: Execute query ReadObjectQuery(name="readObject" referenceClass=Employee sql="SELECT ID, NAME, SALARY, VERSION FROM EMPLOYEE WHERE (ID = ?)")
Finest: Register the existing object Employee [id=1, name=Frits, salary=12, version=1]
Finest: Execute query ReadObjectQuery(referenceClass=Employee )
Finer: TX beginTransaction, status=STATUS_ACTIVE
Finest: Connection acquired from connection pool [default].
Finest: reconnecting to external connection pool
Fine: SELECT ID, NAME, SALARY, VERSION FROM EMPLOYEE WHERE (ID = ?) FOR UPDATE WITH RS bind => [1 parameter bound]
Finest: track pessimistic locked object Employee [id=1, name=Frits, salary=12, version=1] with UnitOfWork 270.608.323
Finest: Lock succeeded
Finest: found: Employee [id=1, name=Frits, salary=12, version=1]
Finest: doGet EmployeeUpdateServlet
Finest: Action = find
Finest: Session created
Finest: EmployeeUpdateServiceBean created
Finest: UserTransaction started
Finer: client acquired: 1781696558
Finer: TX binding to tx mgr, status=STATUS_ACTIVE
Finer: acquire unit of work: 462076538
Finest: Execute query ReadObjectQuery(name="readObject" referenceClass=Employee sql="SELECT ID, NAME, SALARY, VERSION FROM EMPLOYEE WHERE (ID = ?)")
Finest: Register the existing object Employee [id=1, name=Frits, salary=12, version=1]
Finest: Execute query ReadObjectQuery(referenceClass=Employee )
Finer: TX beginTransaction, status=STATUS_ACTIVE
Finest: Connection acquired from connection pool [default].
Finest: reconnecting to external connection pool
Fine: SELECT ID, NAME, SALARY, VERSION FROM EMPLOYEE WHERE (ID = ?) FOR UPDATE WITH RS bind => [1 parameter bound]
Fine: VALUES(1)
...
Finest: Lock failed
Finer: TX afterCompletion callback, status=ROLLEDBACK
Finest: Connection released to connection pool [default].
Finer: release unit of work
Finer: client released
Warning: EJB5184:A system exception occurred during an invocation on EJB EmployeeUpdateServiceBean, method: public nl.notes.jpa.Employee nl.notes.jpa.EmployeeUpdateServiceBean.findForEmployeeUpdate(int)
Warning: javax.ejb.EJBException: javax.persistence.PessimisticLockException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.DatabaseExceptionInternal Exception: java.sql.SQLTransactionRollbackException: A lock could not be obtained within the time
...
Finest: --- FIND DIDN'T WORK ---
Severe: javax.ejb.EJBException: javax.persistence.PessimisticLockException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.3.2.v20111125-r10461):
hence based on these tests the “PessimisticLockException” seems not that easy to get around and can be thrown as an explicit exception, as we intended it to be.
3.4.4.2 PESSIMISTIC_READ, PESSIMISTIC_WRITE, PESSIMISTIC_FORCE_INCREMENT
...
When the lock cannot be obtained, and the database locking failure results in transaction-level rollback, the provider must throw the PessimisticLockException and ensure that the JTA transaction or EntityTransaction has been marked for rollback. When the lock cannot be obtained, and the database
Don't get me started about those stupid light bulbs. |