Hi,
I have included this piece of
code before getting the DAO instance from DAOManager.
SqlMapDaoTransaction trans = (SqlMapDaoTransaction)
daoManager.getTransaction(daoManager.getDao(daoClass)); SqlMapClient sqlMapClient = trans.getSqlMap(); Connection conTemp = sqlMapClient.getDataSource().getConnection("test", "test"); sqlMapClient.setUserConnection(conTemp);
daoManager.getDao(daoClass); I thought of substituting the
connection in the sqlmap with my own connection.
But it gave me error
like
Cause:
com.ibatis.sqlmap.engine.transaction.TransactionException: TransactionManager
could not end this transaction. A user provided connection
is currently being used by this session. You must call
the rollback() method of the Connection directly. The calling
.setUserConnection (null) will clear the user provided
transaction.
at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.endTransaction(SqlMapExecutorDelegate.java:471)
at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.endTransaction(SqlMapSessionImpl.java:134) at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.endTransaction(SqlMapClientImpl.java:107) I have even tried supyling
sqlMapClient.endTransaction() and
sqlMapClient.commit() after the sqlMapClient.setU
serConnection(conTemp)
statement. But I got a error which goes like
"commit() cannot be given when you use container-managed
transactions". Is there any other round about
to do this? So that the SQL statements will be executed with the user supplied
connection.
Thanks and regards
Vijai Senthil P K
|
Passing logged in Username and password to iBATIS
Vijai Senthil Padmanabhan Kalaiyarasi Wed, 28 Sep 2005 13:09:08 -0700
- Re: Passing logged in Username and p... Vijai Senthil Padmanabhan Kalaiyarasi
- Re: Passing logged in Username ... Vijai Senthil Padmanabhan Kalaiyarasi
- Re: Passing logged in Username ... Vijai Senthil Padmanabhan Kalaiyarasi
- Passing logged in Username and ... Vijai Senthil Padmanabhan Kalaiyarasi
- Re: Passing logged in Usern... Clinton Begin