2 Replies Latest reply on Oct 2, 2008 5:48 PM by Scott Olcott

    Specifing name of transaction component on the @Transactional annotation

    Scott Olcott Newbie

      For those of us not using JTA for transaction management it would be nice if it was possible to specify which which transaction component to use when using the @Transactional annotation.  This would be especially useful when using multiple databases.


      For example if in my components.xml I define the following transactions:


      <transaction:hibernate-transaction session="#{hibernateSession1}" />
        <transaction:hibernate-transaction session="#{hibernateSession2}" name="transaction2" />



      Then when I used the @Transaction annotation I could do something like:


      @Transactional(tranasaction="#{transaction2}")
      public void doSomething(){}



      and it would use #{transaction2} instead of the first one which would be the default.


      Also it would be nice if you could pass it an array of transactions to be used when a method accesses more than one database.


      Anyway this is just an idea and I am interested in what others think.