title: transaction is not getting roll backed with jta transaction manager
body: <p>I am new to Spring and hibernate please help,</p>
  
  <p>I am using (Jboss 6.0 Final as Server)</p>
  
  <p>org.springframework.transaction.jta.JtaTransactionManager </p>
  
  <p>as bean with properties set</p>
  
  <p>transactionManagerName as java:/TransactionManager and </p>
  
  <p>userTransactionName as java:comp/UserTransaction.</p>
  
  <p>In code I have set <pre>jtaTxManager</pre> property thr setters.</p>
  
  <p>Then</p>
  
  <pre>javax.transaction.TransactionManager tx = jtaTxManager.getTransactionManager();</pre>
  
  <p>and then transaction is started using  <pre>tx.begin()</pre> statement.</p>
  
  <p>I have used  <pre>sessionFactory.getCurrentSession()  </pre>to get session of hibernate</p>
  
  <p>at last I have used </p>
  
   <pre>tx.commit() </pre>
  
  <p>I am using hibernate to save multiple records within jta transaction
  but If in between any database error occurs between some record like constraint violation exception getting thrown on tx.commit() which is <pre>javax.transaction.RollbackException</pre> which when catch I used to call tx.rollback() but  my transaction is not getting rollback and getting following exception on tx.rollback().I have not set any type auto commit property in hibernate properties.</p>
  
  <p>But my first of records in gets saved in database ideally they should not saved but while rollback this exception occurs so i think that's why they are getting saved.</p>
  
  <pre>
  java.lang.IllegalStateException: BaseTransaction.rollback - [com.arjuna.ats.internal.jta.transaction.arjunacore.notx] [com.arjuna.ats.internal.jta.transaction.arjunacore.notx] no transaction!
  at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.rollback(BaseTransaction.java:158)
  at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.rollback(BaseTransactionManagerDelegate.java:114)
  </pre>