2 Replies Latest reply on Dec 16, 2009 9:20 AM by ma5x

    Transactions with Home Objects and JDBC

    ma5x

      Hi,


      In a Project I'm using Seam 2.2.0GA and JBoss4.2.3GA.


      Because of the need for bulk insert I had to rewrite some of my code to jdbc2 so it runs as fast as it can.
      But I simply can't get my method to run in a transaction. If the JDBC insert throws an exception, than the method ends, but the
      inserts before that (both JDBC and through EntityManager) stay committed.


      I've tried using the @Transactional annotation, and quite a few others too (@App.Expceptio(rollback), @Trans.Attrib, just plain, etc) but I can't get it to work.
      I've even tried using UserTransaction, but got NotSupportedException at ut.begin().
      Also tried modifying the connection autocommit from the EntityManager / simply reusing the connection there. All I got were various Exceptions.


      So I need help. Can please someone tell me how to bundle my method in 1 transaction, that uses both EM and JDBC.


      thanks.