1 Reply Latest reply on Jan 13, 2010 3:12 AM by kapitanpetko

    Transactional Seam-Ejb problem

      Hi Everybody,

      I'm experiencing a problem with transactions inside a statefful session Bean scoped in a conversation.
      I'm using Spring JPA for the Backend; the spring service(behind a pring DAO) is injected inside mu session bean with seam @In annotation.


      My problem is the following:

      I have one method which starts the convesation annotated as follows:

              @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
              @Begin(join=true,flushMode=FlushModeType.AUTO)
           public void adjustClient()

      This method will create a new temporary Adjustment Entity which is auto generated (sequence Key in Oracle Databse) this adjustment object should only be saved to the database only when the user hits a save button that ends the conversation:

        @End
          @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
      public void save()

      What happens know is that the adjustClient() method is committing to the database even it has this annotation:
      @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)

      Here is what I have in my components.xml file:

         <tx:ejb-transaction/> 

      <persistence:managed-persistence-context name="entityManager"
                      entity-manager-factory="#{entityManagerFactorySpring}" auto-create="true"/>

      I’m really done with this one I can't use the flush mode cause we are using openJPA(1.2) and this a a company standard, and not going to be changed sooner.
      Any kind of help would be appreciated.