You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by "Jagadeesan, Siva" <si...@csfb.com> on 2004/12/28 17:00:25 UTC

Calling a Sybase Store Procedure

Hi Guys:

I am having problem when I am trying to call a store procedure through IBatis.

This is the exception I am getting,

Caused by: 
com.sybase.jdbc2.jdbc.SybSQLException: Stored procedure 'proc_next_id' may be
run only in unchained transaction mode. The 'SET CHAINED OFF' command will
cause the current session to use unchained transaction mode.

I am able to call this store proc using direct JDBC.

I think it is something to do with Connection.

Has anyone came across this problem

Rgds,
--Siva Jagadeesan

==============================================================================
This message is for the sole use of the intended recipient. If you received
this message in error please delete it and notify us. If this message was
misdirected, CSFB does not waive any confidentiality or privilege. CSFB
retains and monitors electronic communications sent through its network.
Instructions transmitted over this system are not binding on CSFB until they
are confirmed by us. Message transmission is not guaranteed to be secure.
==============================================================================


Re: Calling a Sybase Store Procedure

Posted by Clinton Begin <cl...@gmail.com>.
You have to run certain SYBASE stored procedures with AutoCommit=ON. 
However, iBATIS does not support autocommit (by design).  So, at this
time you'll need to supply your own connection (set autocommit=true)
to .setUserConnection().

You can use the same datasource to get a new connection from the
SqlMapClient (.getDataSource()), then set autocommit to true, then
.setUserConnection().  Just be sure to manage it and close it
properly.

Sorry for the roundabout solution, I'm looking for a better one.  Too
bad Sybase does this to us.

Cheers,
Clinton


On Tue, 28 Dec 2004 16:00:25 -0000, Jagadeesan, Siva
<si...@csfb.com> wrote:
> Hi Guys:
> 
> I am having problem when I am trying to call a store procedure through IBatis.
> 
> This is the exception I am getting,
> 
> Caused by:
> com.sybase.jdbc2.jdbc.SybSQLException: Stored procedure 'proc_next_id' may be
> run only in unchained transaction mode. The 'SET CHAINED OFF' command will
> cause the current session to use unchained transaction mode.
> 
> I am able to call this store proc using direct JDBC.
> 
> I think it is something to do with Connection.
> 
> Has anyone came across this problem
> 
> Rgds,
> --Siva Jagadeesan
> 
> ==============================================================================
> This message is for the sole use of the intended recipient. If you received
> this message in error please delete it and notify us. If this message was
> misdirected, CSFB does not waive any confidentiality or privilege. CSFB
> retains and monitors electronic communications sent through its network.
> Instructions transmitted over this system are not binding on CSFB until they
> are confirmed by us. Message transmission is not guaranteed to be secure.
> ==============================================================================
> 
>