0 Replies Latest reply on Jan 25, 2008 9:52 AM by dreu zel

    need help on transaction management

    dreu zel Novice

      using jboss 4.2.2.ga, seam 2.0.0.ga ,jta, enterprise management

      I need transactionmanagement, but not with the classical helpers
      container transaction mangement commits or rollsback the transaction
      at the end , leading to timeouts and rolling back multiple correct transactions.


      I handle thousands of [independent] updates in a loop,
      every item in the loop is individualy commited or rolled back.

      seam inects me the entityManger
      em
      I can get the session em.getdelegate()
      



      as i do not want to setup container Transactions, nor the overall transaction rollback or timeout, I suspend potential active transactions
      and do not create new transactions automaticaly
      @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) //NOTSUPPORTES suspend all active transactions
      


      I suppose the aboce is correct


      within the loop I do not get transactions synchronised with the
      entity session manager

      loop{
       ses =(Session) em.getDelegate();
       txn=ses.getTransaction();//get transa
       //txn= ses.beginTransact
       txn.begin();
      

      complains: Could not register synchronization for container transaction

      switching to bean transactions

      @TransactionManagement(TransactionManagementType.BEAN)
      

      complains for bean problems :Could not register synchronization for container transaction bean managed transaction




      any Ideas of how to manualy controll the EntityManager transactions ?
      all help is welcome