[ 
http://issues.apache.org/jira/browse/IBATIS-165?page=comments#action_12314949 ] 

Clinton Begin commented on IBATIS-165:
--------------------------------------


In the case of a user transaction, the TX manager will still be called, so you 
always need a transaction manager.  Most people do provide one, even if they 
are managing user transactions themseles.  The reason being, lazy loading 
cannot work without a TX manager and a datasource.

The solution to the problem is probably for us to provide a USER transaction 
manager type, so that you can configura a TX manager that knows you'll be 
managing transactions yourself, and essentially does very little so as not to 
get in your way.

Clinton

> NPE when using userConnection in SqlMapExecutorDelegate.endTransaction()
> ------------------------------------------------------------------------
>
>          Key: IBATIS-165
>          URL: http://issues.apache.org/jira/browse/IBATIS-165
>      Project: iBatis for Java
>         Type: Bug
>   Components: SQL Maps
>     Versions: 2.1.0
>  Environment: Managed environment - WebSphere 3.5, AIX
>     Reporter: Marc Fleischeuers

>
> I get a NPE in SqlMapExecutorDelegate, when it accesses txManager, see below 
> stacktrace.
>       at 
> com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.endTransaction(SqlMapExecutorDelegate.java:776)
>       at 
> com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.endTransaction(SqlMapSessionImpl.java:141)
>       at 
> com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.endTransaction(SqlMapClientImpl.java:114)
>       at 
> com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.autoEndTransaction(SqlMapExecutorDelegate.java:860)
>       at 
> com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:617)
>       at 
> com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:109)
>       at 
> com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(SqlMapClientImpl.java:81)
> txManager is null and it's supposed to be; I'm providing a userConnection and 
> performing transaction management myself. 
> In SqlMapExecutorDelegate.queryForList(...): when I provide a userConnection, 
> trans is set to new UserTransaction() so autoStart is false. This eventually 
> leads to invocation on txManager in endTransaction(), throwing the NPE 
> (there's probably an NPE thrown in startTransaction as well!). I think in the 
> case of a userConnection, txManager should not be called.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to