Hello Kolja,

you have found an internal limitation in the number of named subtransactions 
which may be a little low, and was not
documented too. Also there's currently no way like SUBTRANS END for unnamed 
sub-transactions to release them
(i.e. a RELEASE SAVEPOINT <NAME> statement). 

If it's not needed to be portable, you may want to issue

SUBTRANS BEGIN
SUBTRANS END
SUBTRANS ROLLBACK

statements instead of using the java.sql.Savepoint API. 

We are working on that issue, and will fix it in a next release. Sorry for any 
inconvenience caused
by this problem.

Regards
Alexander Schröder 
SAP DB, SAP Labs Berlin
 

-----Original Message-----
From: Kolja Kleist [mailto:[EMAIL PROTECTED] 
Sent: Mittwoch, 2. November 2005 17:05
To: 'Robert Klemme'
Cc: [email protected]
Subject: AW: Savepoints and JDBC driver

Thanks for the hint, but it doesn't solve the problem, that the savepoint
won't be released on the server side when calling
Connection.releaseSavepoint(Savepoint). BTW that was just ugly example code
to demonstrate the problem.

Regards,
Kolja

-----Ursprüngliche Nachricht-----
Von: Robert Klemme [mailto:[EMAIL PROTECTED] 
Gesendet: Mittwoch, 2. November 2005 16:41
An: Kolja Kleist
Cc: [email protected]
Betreff: Re: Savepoints and JDBC driver

You should put your release savepoint into a finally clause to ensure
it's always called.

robert

2005/11/2, Kolja Kleist <[EMAIL PROTECTED]>:
> Hello,
>
>
>
> I have a problem when using savepoints in the following scenario:
>
>
>
> public int myMethod(Connection conn){
>
>       Savepoint savepoint = null;
>
>
>
>       try {
>
>
>
>         // Create savepoint
>
>         savepoint = conn.setSavepoint();
>
>
>
>         // Do some SQL commands
>
>         int rows = doSQLStuff(conn);
>
>
>
>         // Release savepoint
>
>         conn.releaseSavepoint(savepoint);
>
>
>
>         return rows;
>
>       } catch (SQLException e) {
>
>         if (savepoint != null) {
>
>           try {
>
>             conn.rollback(savepoint);
>
>           } catch (SQLException e1) {
>
>             handleSQLException(e1);
>
>           }
>
>         }
>
>
>
>         handleSQLException(e);
>
>       }
>
>    return 0;
>
> }
>
>
>
> Using driver: package: com.sap.dbtech.jdbc, MaxDB JDBC Driver, MySQL
MaxDB,
> 7.6.0    Build 012-000-004-339
>
>
>
> The Connection used in this examples was initialized with "Auto Commit =
> false".
>
> The Connection will be committed after calling the example method several
> times.
>
> But when calling the method 51 times I've got the error: [-1111]: Too many
> savepoints
>
>
>
> While looking at the source code, I saw, that the method
> ConnectionSapDB.releaseSavepoint(Savepoint)
>
> doesn't communicates with the server thus the savepoint will not be
released
> on the server side.
>
> Is there a "RELEASE SAVEPOINT [xxx]" command in the server protocol?
>
>
>
> Regards,
>
> Kolja
>
>
>


-- 
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]


--
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to