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]