You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Hauke Rabe (JIRA)" <ji...@apache.org> on 2008/04/01 10:24:24 UTC

[jira] Created: (DBCP-264) clear batch when closing statement

clear batch when closing statement
----------------------------------

                 Key: DBCP-264
                 URL: https://issues.apache.org/jira/browse/DBCP-264
             Project: Commons Dbcp
          Issue Type: Bug
    Affects Versions: 1.2.2
            Reporter: Hauke Rabe


If a statement contains batch statements, these statements should be cleared on close. 

Szenario:
A pooled statement contains already some batch statements before an error occured. This error will be handled and finally the statement will be closed. Cause, it is a pooled statement the batch statements will be remaining in the pooled statement. On the next request the pooled statement will execute the batch statements from the first request.

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


[jira] Updated: (DBCP-264) clear batch when closing statement

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DBCP-264?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Yandell updated DBCP-264:
-------------------------------

    Fix Version/s: 1.3

Looks like this should be looked at for 1.3.

> clear batch when closing statement
> ----------------------------------
>
>                 Key: DBCP-264
>                 URL: https://issues.apache.org/jira/browse/DBCP-264
>             Project: Commons Dbcp
>          Issue Type: Bug
>    Affects Versions: 1.2.2
>            Reporter: Hauke Rabe
>             Fix For: 1.3
>
>
> If a statement contains batch statements, these statements should be cleared on close. 
> Szenario:
> A pooled statement contains already some batch statements before an error occured. This error will be handled and finally the statement will be closed. Cause, it is a pooled statement the batch statements will be remaining in the pooled statement. On the next request the pooled statement will execute the batch statements from the first request.

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


[jira] Updated: (DBCP-264) clear batch when closing statement

Posted by "Phil Steitz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DBCP-264?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Phil Steitz updated DBCP-264:
-----------------------------

    Attachment: clearBatchPatch.txt

The logical place to insert a clearBatch is in PoolablePreparedStatement's passivate method.  The attached patch does that, but swallows any SQLException that occurs.  Since driver support for this is optional, I don't think we would want to propagate the associated SQLExceptions here; but I don't either like the swallowing and the fact that the try/throw/catch will be executed on every passivate for drivers that do not support batch processing.   Anyone have a better idea?

> clear batch when closing statement
> ----------------------------------
>
>                 Key: DBCP-264
>                 URL: https://issues.apache.org/jira/browse/DBCP-264
>             Project: Commons Dbcp
>          Issue Type: Bug
>    Affects Versions: 1.2.2
>            Reporter: Hauke Rabe
>             Fix For: 1.3
>
>         Attachments: clearBatchPatch.txt
>
>
> If a statement contains batch statements, these statements should be cleared on close. 
> Szenario:
> A pooled statement contains already some batch statements before an error occured. This error will be handled and finally the statement will be closed. Cause, it is a pooled statement the batch statements will be remaining in the pooled statement. On the next request the pooled statement will execute the batch statements from the first request.

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


[jira] Resolved: (DBCP-264) clear batch when closing statement

Posted by "Phil Steitz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DBCP-264?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Phil Steitz resolved DBCP-264.
------------------------------

    Resolution: Fixed

> clear batch when closing statement
> ----------------------------------
>
>                 Key: DBCP-264
>                 URL: https://issues.apache.org/jira/browse/DBCP-264
>             Project: Commons Dbcp
>          Issue Type: Bug
>    Affects Versions: 1.2.2
>            Reporter: Hauke Rabe
>             Fix For: 1.3
>
>         Attachments: clearBatchPatch.txt, DBCP-264-clearBatch.patch
>
>
> If a statement contains batch statements, these statements should be cleared on close. 
> Szenario:
> A pooled statement contains already some batch statements before an error occured. This error will be handled and finally the statement will be closed. Cause, it is a pooled statement the batch statements will be remaining in the pooled statement. On the next request the pooled statement will execute the batch statements from the first request.

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


[jira] Commented: (DBCP-264) clear batch when closing statement

Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DBCP-264?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12667843#action_12667843 ] 

Niall Pemberton commented on DBCP-264:
--------------------------------------

OK I committed that patch with the volatile change:

http://svn.apache.org/viewvc?view=rev&revision=738288

> clear batch when closing statement
> ----------------------------------
>
>                 Key: DBCP-264
>                 URL: https://issues.apache.org/jira/browse/DBCP-264
>             Project: Commons Dbcp
>          Issue Type: Bug
>    Affects Versions: 1.2.2
>            Reporter: Hauke Rabe
>             Fix For: 1.3
>
>         Attachments: clearBatchPatch.txt, DBCP-264-clearBatch.patch
>
>
> If a statement contains batch statements, these statements should be cleared on close. 
> Szenario:
> A pooled statement contains already some batch statements before an error occured. This error will be handled and finally the statement will be closed. Cause, it is a pooled statement the batch statements will be remaining in the pooled statement. On the next request the pooled statement will execute the batch statements from the first request.

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


[jira] Commented: (DBCP-264) clear batch when closing statement

Posted by "Hauke Rabe (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DBCP-264?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12584053#action_12584053 ] 

Hauke Rabe commented on DBCP-264:
---------------------------------

Add to org.apache.commons.dbcp.DelegatingStatement#close()  method call clearBatch()



> clear batch when closing statement
> ----------------------------------
>
>                 Key: DBCP-264
>                 URL: https://issues.apache.org/jira/browse/DBCP-264
>             Project: Commons Dbcp
>          Issue Type: Bug
>    Affects Versions: 1.2.2
>            Reporter: Hauke Rabe
>
> If a statement contains batch statements, these statements should be cleared on close. 
> Szenario:
> A pooled statement contains already some batch statements before an error occured. This error will be handled and finally the statement will be closed. Cause, it is a pooled statement the batch statements will be remaining in the pooled statement. On the next request the pooled statement will execute the batch statements from the first request.

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


[jira] Commented: (DBCP-264) clear batch when closing statement

Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DBCP-264?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12667099#action_12667099 ] 

Niall Pemberton commented on DBCP-264:
--------------------------------------

How about setting a flag when addBatch() is called and only trying to call clearBatch() if that flag is set?

> clear batch when closing statement
> ----------------------------------
>
>                 Key: DBCP-264
>                 URL: https://issues.apache.org/jira/browse/DBCP-264
>             Project: Commons Dbcp
>          Issue Type: Bug
>    Affects Versions: 1.2.2
>            Reporter: Hauke Rabe
>             Fix For: 1.3
>
>         Attachments: clearBatchPatch.txt
>
>
> If a statement contains batch statements, these statements should be cleared on close. 
> Szenario:
> A pooled statement contains already some batch statements before an error occured. This error will be handled and finally the statement will be closed. Cause, it is a pooled statement the batch statements will be remaining in the pooled statement. On the next request the pooled statement will execute the batch statements from the first request.

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


[jira] Commented: (DBCP-264) clear batch when closing statement

Posted by "Phil Steitz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DBCP-264?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12667155#action_12667155 ] 

Phil Steitz commented on DBCP-264:
----------------------------------

Second patch looks good to me.  Might want to make the flag volatile, though.

> clear batch when closing statement
> ----------------------------------
>
>                 Key: DBCP-264
>                 URL: https://issues.apache.org/jira/browse/DBCP-264
>             Project: Commons Dbcp
>          Issue Type: Bug
>    Affects Versions: 1.2.2
>            Reporter: Hauke Rabe
>             Fix For: 1.3
>
>         Attachments: clearBatchPatch.txt, DBCP-264-clearBatch.patch
>
>
> If a statement contains batch statements, these statements should be cleared on close. 
> Szenario:
> A pooled statement contains already some batch statements before an error occured. This error will be handled and finally the statement will be closed. Cause, it is a pooled statement the batch statements will be remaining in the pooled statement. On the next request the pooled statement will execute the batch statements from the first request.

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


[jira] Updated: (DBCP-264) clear batch when closing statement

Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DBCP-264?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Niall Pemberton updated DBCP-264:
---------------------------------

    Attachment: DBCP-264-clearBatch.patch

> clear batch when closing statement
> ----------------------------------
>
>                 Key: DBCP-264
>                 URL: https://issues.apache.org/jira/browse/DBCP-264
>             Project: Commons Dbcp
>          Issue Type: Bug
>    Affects Versions: 1.2.2
>            Reporter: Hauke Rabe
>             Fix For: 1.3
>
>         Attachments: clearBatchPatch.txt, DBCP-264-clearBatch.patch
>
>
> If a statement contains batch statements, these statements should be cleared on close. 
> Szenario:
> A pooled statement contains already some batch statements before an error occured. This error will be handled and finally the statement will be closed. Cause, it is a pooled statement the batch statements will be remaining in the pooled statement. On the next request the pooled statement will execute the batch statements from the first request.

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


[jira] Closed: (DBCP-264) clear batch when closing statement

Posted by "Phil Steitz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DBCP-264?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Phil Steitz closed DBCP-264.
----------------------------


> clear batch when closing statement
> ----------------------------------
>
>                 Key: DBCP-264
>                 URL: https://issues.apache.org/jira/browse/DBCP-264
>             Project: Commons Dbcp
>          Issue Type: Bug
>    Affects Versions: 1.2.2
>            Reporter: Hauke Rabe
>             Fix For: 1.3
>
>         Attachments: clearBatchPatch.txt, DBCP-264-clearBatch.patch
>
>
> If a statement contains batch statements, these statements should be cleared on close. 
> Szenario:
> A pooled statement contains already some batch statements before an error occured. This error will be handled and finally the statement will be closed. Cause, it is a pooled statement the batch statements will be remaining in the pooled statement. On the next request the pooled statement will execute the batch statements from the first request.

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