Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

setAutoCommit? (more)

2 posts in JDBC Connect (product renamed to JConnect) Last posting was on 1997-05-21 16:47:19.0Z
chelsel Posted on 1997-05-13 15:20:01.0Z
Message-ID: <337886A0.79C0@spacelab.net>
Date: Tue, 13 May 1997 11:20:01 -0400
From: chelsel <chelsel@spacelab.net>
Reply-To: chelsel@spacelab.net
X-Mailer: Mozilla 3.01 [fr] (WinNT; I)
MIME-Version: 1.0
Subject: setAutoCommit? (more)
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.jdbcconnect
Lines: 14
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:835
Article PK: 252587

I tried setting chained transaction mode off but I'm still getting the
SQLException on the last cstmt.execute along the lines of 'this sp can
only execute in unchained transaction mode...' I'm just trying to use
setAutoCommit(false). Do I have to put the set chained off command
INSIDE the stored procedure?

Statement stmt=con.createStatement();
stmt.execute("set chained off");
stmt.close();
con.setAutoCommit(false);

cstmt=con.prepareCall("{ call yld_delyield(?)}");
cstmt.setString(1,"USD");
cstmt.execute();
cstmt.close();


David Clegg Posted on 1997-05-21 16:47:19.0Z
Message-ID: <33832717.389150D@sybase.com>
Date: Wed, 21 May 1997 09:47:19 -0700
From: David Clegg <davec@sybase.com>
X-Mailer: Mozilla 2.01 (X11; I; Linux 1.2.13 i586)
MIME-Version: 1.0
To: chelsel@spacelab.net
Subject: Re: setAutoCommit? (more)
References: <337886A0.79C0@spacelab.net>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.jdbcconnect
Lines: 27
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:797
Article PK: 252549

When you created your stored procedure your session was in autocommit
mode (setAutoCommit(true)), or "set chained off"), which is the default
for $SYBASE/bin/isql
You are now trying to execute the stored procedure in a different
transaction mode.

You can use the 'sp_procxmode ANYMODE' system stored procedure to
enable use of your stored procedure from any transaction mode --
but you have to figure out whether that is logically correct.

dave

>
> I tried setting chained transaction mode off but I'm still getting the
> SQLException on the last cstmt.execute along the lines of 'this sp can
> only execute in unchained transaction mode...' I'm just trying to use
> setAutoCommit(false). Do I have to put the set chained off command
> INSIDE the stored procedure?
>
> Statement stmt=con.createStatement();
> stmt.execute("set chained off");
> stmt.close();
> con.setAutoCommit(false);
>
> cstmt=con.prepareCall("{ call yld_delyield(?)}");
> cstmt.setString(1,"USD");
> cstmt.execute();
> cstmt.close();