2 Replies Latest reply on Jan 9, 2008 3:31 AM by guix

    JBOSS 4.2.1  + EJB3.0 : Native executes don't rollback!

    guix

      Hi:
      I am using jboss 4.2.1 with ejb3 default configuration

      If I make a native query execute update in a Session bean:

      User user = new User(userId);
      myEntityManager.persist(user);
      
      String insertUserInOldTable = "insert into olduserstable values('" + userId + "');
      myEntityManager.createNativeQuery(insertUserInOldTable ).executeUpdate();
      
      String userCreate = "CREATE USER " + userId + " IDENTIFIED BY " + userPassword + " DEFAULT TABLESPACE TB1 TEMPORARY TABLESPACE TEMPORARY PROFILE P1";
      myEntityManager.createNativeQuery(userCreate).executeUpdate();


      If the "create user " statement fails, the Entity bean code rolls back correctly but the insert statement does not roll back.

      Why?

      We need t