ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chema <demablo...@gmail.com>
Subject Re: java.sql.SQLException: You cannot commit during a managed transaction
Date Fri, 03 Oct 2008 13:01:36 GMT
That doesn't work because sqlMap.delete() performs commit automatically.
I'm using the transaction manager of JBoss , with JNDI/JDBC.
Can I disabled this ? By code is not possible because Jboss TX manager
throws a SQLExeception.
Another w/a ?

Thanls !








2008/10/3 Kai Grabfelder <nospam@kinokai.de>:
> if you are using CTM (container managed transactions), like in your case, you can't start,
commit or end
> transactions manually. The container is doing this for you.
>
> The following should work
>> sqlMap.delete("deleteRecords", param);
>
> If it does not I think your sqlmap configuration is not correct. Could you post it here?
>
> Regards
>
> Kai
>
> --- Original Nachricht ---
> Absender: Chema
> Datum: 03.10.2008 12:53
>> Hello:
>>
>> I'm using JBoss 3.2 and EJB 2.0 with iBatis 2.3.0
>> I've got configured a external transaction manager in SQLMap
>> configuration file.
>>
>> When an EJB component ( session bean ) tries to delete record using by
>> iBatis sqlMap client, JBoss retrieve this
>> error:
>>
>> 11:02:09,406 ERROR [Connection] Error calling Connection.commit:
>> java.sql.SQLException: You cannot commit during a managed transaction!
>>         at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.jdbcCommit(BaseWrapperManagedConnection.java:525)
>>
>>
>>
>> This error happens when I perform this
>>
>> sqlMap.startTransaction();
>> sqlMap.delete("deleteRecords", param);
>> sqlMap.commitTransaction();
>> sqlMap.endTransaction();
>>
>>
>> And with a single call (automatic transaction):
>>
>> sqlMap.delete("deleteRecords", param);
>>
>>
>> I would like to delegate all transaction issues to external
>> transaction manager ( in this case, JBoss)
>> How I can solved this ? Any w/a ?
>>
>>
>> Thanks !!
>>
>
>

Mime
View raw message