Hello
My mistake "ORA-02049: temporisation : timeout: distributed transaction waiting for lock " in my application java ejb3,

jpa, which occurs 20 times a month.

ATTENTION: Local Exception Stack:
Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.3.2.v20111125-r10461):

org.eclipse.persistence.exceptions.DatabaseExcepti on
Internal Exception: java.sql.SQLSyntaxErrorException: ORA-02049: temporisation : la transaction distribuée attend un verrou
Error Code: 2049
Call: UPDATE MANAGE SET END_DATE = ? WHERE (((ID_HOST = ?) AND (BEGIN_DATE = ?)) AND (EMPLOYEE = ?))
bind => [4 parameters bound]
Query: UpdateObjectQuery(com.agarik.operia.orm.Manage2@1b 55825)
at org.eclipse.persistence.exceptions.DatabaseExcepti on.sqlException(DatabaseException.java:324)
at org.eclipse.persistence.internal.databaseaccess.Da tabaseAccessor.executeDirectNoSelect

(DatabaseAccessor.java:840)
at org.eclipse.persistence.internal.databaseaccess.Da tabaseAccessor.executeNoSelect(DatabaseAccessor.ja va:906)
at org.eclipse.persistence.internal.databaseaccess.Da tabaseAccessor.basicExecuteCall(DatabaseAccessor.j ava:592)
at org.eclipse.persistence.internal.databaseaccess.Da tabaseAccessor.executeCall(DatabaseAccessor.java:5 35)
at org.eclipse.persistence.internal.sessions.Abstract Session.basicExecuteCall(AbstractSession.java:1717 )
at org.eclipse.persistence.sessions.server.ClientSess ion.executeCall(ClientSession.java:253)
at org.eclipse.persistence.internal.queries.Datasourc eCallQueryMechanism.executeCall

(DatasourceCallQueryMechanism.java:207)
at org.eclipse.persistence.internal.queries.Datasourc eCallQueryMechanism.executeCall

(DatasourceCallQueryMechanism.java:193)
at org.eclipse.persistence.internal.queries.Datasourc eCallQueryMechanism.updateObject

(DatasourceCallQueryMechanism.java:749)
at org.eclipse.persistence.internal.queries.Statement QueryMechanism.updateObject(StatementQueryMechanis m.java:432)
at org.eclipse.persistence.internal.queries.DatabaseQ ueryMechanism.updateObjectForWriteWithChangeSet

(DatabaseQueryMechanism.java:1042)
at org.eclipse.persistence.queries.UpdateObjectQuery. executeCommitWithChangeSet(UpdateObjectQuery.java: 84)
at org.eclipse.persistence.internal.queries.DatabaseQ ueryMechanism.executeWriteWithChangeSet

(DatabaseQueryMechanism.java:287)
at org.eclipse.persistence.queries.WriteObjectQuery.e xecuteDatabaseQuery(WriteObjectQuery.java:58)
at org.eclipse.persistence.queries.DatabaseQuery.exec ute(DatabaseQuery.java:844)
at org.eclipse.persistence.queries.DatabaseQuery.exec uteInUnitOfWork(DatabaseQuery.java:743)
at org.eclipse.persistence.queries.ObjectLevelModifyQ uery.executeInUnitOfWorkObjectLevelModifyQuery

(ObjectLevelModifyQuery.java:108)
at org.eclipse.persistence.queries.ObjectLevelModifyQ uery.executeInUnitOfWork(ObjectLevelModifyQuery.ja va:85)
at org.eclipse.persistence.internal.sessions.UnitOfWo rkImpl.internalExecuteQuery(UnitOfWorkImpl.java:28 71)
at org.eclipse.persistence.internal.sessions.Abstract Session.executeQuery(AbstractSession.java:1516)
at org.eclipse.persistence.internal.sessions.Abstract Session.executeQuery(AbstractSession.java:1498)
at org.eclipse.persistence.internal.sessions.Abstract Session.executeQuery(AbstractSession.java:1449)
at org.eclipse.persistence.internal.sessions.CommitMa nager.commitChangedObjectsForClassWithChangeSet

(CommitManager.java:265)
at org.eclipse.persistence.internal.sessions.CommitMa nager.commitAllObjectsWithChangeSet(CommitManager. java:128)
at org.eclipse.persistence.internal.sessions.Abstract Session.writeAllObjectsWithChangeSet

(AbstractSession.java:3799)
at org.eclipse.persistence.internal.sessions.UnitOfWo rkImpl.commitToDatabase(UnitOfWorkImpl.java:1415)
at org.eclipse.persistence.internal.sessions.Repeatab leWriteUnitOfWork.commitToDatabase

(RepeatableWriteUnitOfWork.java:636)
at org.eclipse.persistence.internal.sessions.UnitOfWo rkImpl.commitToDatabaseWithPreBuiltChangeSet

(UnitOfWorkImpl.java:1561)
at org.eclipse.persistence.internal.sessions.Repeatab leWriteUnitOfWork.writeChanges

(RepeatableWriteUnitOfWork.java:447)
at org.eclipse.persistence.internal.jpa.EntityManager Impl.flush(EntityManagerImpl.java:780)
at org.eclipse.persistence.internal.jpa.EJBQueryImpl. performPreQueryFlush(EJBQueryImpl.java:1298)
at org.eclipse.persistence.internal.jpa.EJBQueryImpl. executeReadQuery(EJBQueryImpl.java:434)
at org.eclipse.persistence.internal.jpa.EJBQueryImpl. getSingleResult(EJBQueryImpl.java:773)
at....rdbms.RDBMSEquipmentDAO.getEquipment(RDBMSEq uipmentDAO.java:45)
at ...s.RDBMSManageDAO.stopManage(RDBMSManageDAO.java :117)
at ....monitoring.manage.ManageBean.stopManage(Manage Bean.java:473)

@Stateless(
@TransactionAttribute(value = TransactionAttributeType.SUPPORTS)
public class ManageBean{

@TransactionAttribute(value = TransactionAttributeType.REQUIRED)
public void stopManage(){
manageDAO.stopManage();
}

}

import javax.inject.Inject;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
public class RDBMSManageDAO{
@PersistenceContext
private EntityManager em;
@Inject
private EquipmentDAO hostDAO;

public void stopManage(){
Host host = hostDAO.getEquipment(manage.getEquipment());
}
}

import javax.inject.Inject;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
public abstract class RDBMSEquipmentDAO{
@PersistenceContext
private EntityManager em;
public Host getEquipment(String equipment) throws DAOException
{
Query query = em.createNamedQuery(...
try
{
return (Host)query.getSingleResult();// DEBUT DE LA STACK D'ERREUR

}
catch (NoResultException e)
{
return null;
}
}
}
The type 'TransactionAttributeType.REQUIRED' spread in methods with EJB is it compatible with entityManager injected by javax.inject.Inject (cdi, i think)?
Should i put a flush somewhere because it is a update? Should i create a singleton for entityManager or should i use entityManagerFactory?

Thanks