You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Dag H. Wanvik (JIRA)" <ji...@apache.org> on 2008/05/23 00:13:57 UTC

[jira] Created: (DERBY-3687) Make client driver allow nested savepoints

Make client driver allow nested savepoints
------------------------------------------

                 Key: DERBY-3687
                 URL: https://issues.apache.org/jira/browse/DERBY-3687
             Project: Derby
          Issue Type: Improvement
          Components: Network Client
            Reporter: Dag H. Wanvik


Currently, only the embedded driver allows nested savepoints, cf. the attached repro.
In the interest of harmonizing the drivers it would be nice to make the client driver allow this as well.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-3687) Make client driver allow nested savepoints

Posted by "Dag H. Wanvik (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3687?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12599237#action_12599237 ] 

Dag H. Wanvik commented on DERBY-3687:
--------------------------------------

I checked the standard, and SQL savepoints do allow nesting, cf. section 4.35.2 in ISO/IEC 9075-2:2003:

"An SQL-transaction has one or more savepoint levels, exactly one of which is the current savepoint level. The
savepoint levels of an SQL-transaction are nested, such that when a new savepoint level NSL is established,
the current savepoint level CSL ceases to be current and NSL becomes current. When NSL is destroyed, CSL
becomes current again."

So the standard is not prohibiting this functionality in SQL. Then what is the reason?


> Make client driver allow nested savepoints
> ------------------------------------------
>
>                 Key: DERBY-3687
>                 URL: https://issues.apache.org/jira/browse/DERBY-3687
>             Project: Derby
>          Issue Type: Improvement
>          Components: Network Client
>            Reporter: Dag H. Wanvik
>
> Currently, only the embedded driver allows nested savepoints, cf. the attached repro.
> In the interest of harmonizing the drivers it would be nice to make the client driver allow this as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-3687) Make client driver allow nested savepoints

Posted by "Dag H. Wanvik (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3687?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12599240#action_12599240 ] 

Dag H. Wanvik commented on DERBY-3687:
--------------------------------------

I tried to comment out the check for this in Xact.java, and voila, the repro worked!
(I commented out the call to throwExceptionIfSQLSavepointNotAllowed(kindOfSavepoint)).

I don't know about any side effect of doing this, though, but I add this observation just as
 a data point for now.

> Make client driver allow nested savepoints
> ------------------------------------------
>
>                 Key: DERBY-3687
>                 URL: https://issues.apache.org/jira/browse/DERBY-3687
>             Project: Derby
>          Issue Type: Improvement
>          Components: Network Client
>            Reporter: Dag H. Wanvik
>         Attachments: Main.java
>
>
> Currently, only the embedded driver allows nested savepoints, cf. the attached repro.
> In the interest of harmonizing the drivers it would be nice to make the client driver allow this as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-3687) Make client driver allow nested savepoints

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3687?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12599228#action_12599228 ] 

Kathey Marsden commented on DERBY-3687:
---------------------------------------

It does appear that client uses SQL savepoints from 
am.Connection.java:setSavepointX ...

String sql = "SAVEPOINT \"" + savepointName + "\" ON ROLLBACK RETAIN CURSORS";
            stmt.executeX(sql);
        } 


> Make client driver allow nested savepoints
> ------------------------------------------
>
>                 Key: DERBY-3687
>                 URL: https://issues.apache.org/jira/browse/DERBY-3687
>             Project: Derby
>          Issue Type: Improvement
>          Components: Network Client
>            Reporter: Dag H. Wanvik
>
> Currently, only the embedded driver allows nested savepoints, cf. the attached repro.
> In the interest of harmonizing the drivers it would be nice to make the client driver allow this as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-3687) Make client driver allow nested savepoints

Posted by "Rami Ojares (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3687?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12800688#action_12800688 ] 

Rami Ojares commented on DERBY-3687:
------------------------------------

What is this talk about "nested" savepoints?
If I have a transaction and I set a savepoint, then execute some statements and set another savepoint.
Would you call the second savepoint nested?
And if so, why?
To me the transaction seems to have a list of statements and at some points in that list there are svapoints.
They don't seem nested to me.

Further according to my experience derby seems to allow only one savepoint.
I don't know why.
Clarification would be greatly appreciated.

> Make client driver allow nested savepoints
> ------------------------------------------
>
>                 Key: DERBY-3687
>                 URL: https://issues.apache.org/jira/browse/DERBY-3687
>             Project: Derby
>          Issue Type: Improvement
>          Components: Network Client
>            Reporter: Dag H. Wanvik
>         Attachments: Main.java
>
>
> Currently, only the embedded driver allows nested savepoints, cf. the attached repro.
> In the interest of harmonizing the drivers it would be nice to make the client driver allow this as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-3687) Make client driver allow nested savepoints

Posted by "Dag H. Wanvik (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3687?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12800744#action_12800744 ] 

Dag H. Wanvik commented on DERBY-3687:
--------------------------------------

For explanation of nested savepoints, cf. the quote from the SQL standard reproduced above (section 4.35.2 in ISO/IEC 9075-2:2003).
https://issues.apache.org/jira/browse/DERBY-3687?focusedCommentId=12599237&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#action_12599237

> Make client driver allow nested savepoints
> ------------------------------------------
>
>                 Key: DERBY-3687
>                 URL: https://issues.apache.org/jira/browse/DERBY-3687
>             Project: Derby
>          Issue Type: Improvement
>          Components: Network Client
>            Reporter: Dag H. Wanvik
>         Attachments: Main.java
>
>
> Currently, only the embedded driver allows nested savepoints, cf. the attached repro.
> In the interest of harmonizing the drivers it would be nice to make the client driver allow this as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-3687) Make client driver allow nested savepoints

Posted by "Dag H. Wanvik (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3687?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12599216#action_12599216 ] 

Dag H. Wanvik commented on DERBY-3687:
--------------------------------------

In the repro, the client driver gives an error:

3B002: java.sql.SQLException: The maximum number of savepoints has been reached.


> Make client driver allow nested savepoints
> ------------------------------------------
>
>                 Key: DERBY-3687
>                 URL: https://issues.apache.org/jira/browse/DERBY-3687
>             Project: Derby
>          Issue Type: Improvement
>          Components: Network Client
>            Reporter: Dag H. Wanvik
>
> Currently, only the embedded driver allows nested savepoints, cf. the attached repro.
> In the interest of harmonizing the drivers it would be nice to make the client driver allow this as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-3687) Make client driver allow nested savepoints

Posted by "Dag H. Wanvik (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-3687?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dag H. Wanvik updated DERBY-3687:
---------------------------------

    Attachment: Main.java

uploading repro.

> Make client driver allow nested savepoints
> ------------------------------------------
>
>                 Key: DERBY-3687
>                 URL: https://issues.apache.org/jira/browse/DERBY-3687
>             Project: Derby
>          Issue Type: Improvement
>          Components: Network Client
>            Reporter: Dag H. Wanvik
>         Attachments: Main.java
>
>
> Currently, only the embedded driver allows nested savepoints, cf. the attached repro.
> In the interest of harmonizing the drivers it would be nice to make the client driver allow this as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-3687) Make client driver allow nested savepoints

Posted by "Dag H. Wanvik (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-3687?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dag H. Wanvik updated DERBY-3687:
---------------------------------

    Bug behavior facts: [Embedded/Client difference]

> Make client driver allow nested savepoints
> ------------------------------------------
>
>                 Key: DERBY-3687
>                 URL: https://issues.apache.org/jira/browse/DERBY-3687
>             Project: Derby
>          Issue Type: Improvement
>          Components: Network Client
>            Reporter: Dag H. Wanvik
>         Attachments: Main.java
>
>
> Currently, only the embedded driver allows nested savepoints, cf. the attached repro.
> In the interest of harmonizing the drivers it would be nice to make the client driver allow this as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-3687) Make client driver allow nested savepoints

Posted by "Dag H. Wanvik (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3687?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12601789#action_12601789 ] 

Dag H. Wanvik commented on DERBY-3687:
--------------------------------------

I see there are tests in SavepointJDBC30Test.java, cases #17, #18 and #19 and #48, which
test various (illegal) nesting scenarios:

- testNoNestedSavepointsWhenUsingSQL (SQL inside SQL)
- testNoNestedSavepointsInsideJdbcSavepoint (JDBC inside SQL)
- testNoNestedSavepointsInsideSqlSavepoint (SQL inside SQL)
- xtestNestedSavepoints (SQL inside JDBC; not enabled, cf. x in fixture name ?)

I can understand why it is wise to avoid mixing the two savepoint kinds, but can someone enlighten me as to the rationale for not allowing nesting of SQL savepoints? (keeping in mind that the standard doesn't dictate this; is this some kind of compatibility decision?)

> Make client driver allow nested savepoints
> ------------------------------------------
>
>                 Key: DERBY-3687
>                 URL: https://issues.apache.org/jira/browse/DERBY-3687
>             Project: Derby
>          Issue Type: Improvement
>          Components: Network Client
>            Reporter: Dag H. Wanvik
>         Attachments: Main.java
>
>
> Currently, only the embedded driver allows nested savepoints, cf. the attached repro.
> In the interest of harmonizing the drivers it would be nice to make the client driver allow this as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-3687) Make client driver allow nested savepoints

Posted by "Dag H. Wanvik (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3687?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12599221#action_12599221 ] 

Dag H. Wanvik commented on DERBY-3687:
--------------------------------------

Found this comment in Xact.java:

// SQL savepoint can't be nested inside other user defined savepoints. To 
// enforce this, we check if there are already user savepoint(SQL/JDBC)
// defined in the transaction. If yes, then throw an exception

So, does the client use the SQL version of savepoints (not documented), and that's
why they can't be nested? And if so, why?

> Make client driver allow nested savepoints
> ------------------------------------------
>
>                 Key: DERBY-3687
>                 URL: https://issues.apache.org/jira/browse/DERBY-3687
>             Project: Derby
>          Issue Type: Improvement
>          Components: Network Client
>            Reporter: Dag H. Wanvik
>
> Currently, only the embedded driver allows nested savepoints, cf. the attached repro.
> In the interest of harmonizing the drivers it would be nice to make the client driver allow this as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.