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 "Dan Karp (JIRA)" <ji...@apache.org> on 2007/02/17 21:51:05 UTC

[jira] Created: (DERBY-2353) intermittent NPEs during DELETE ops in a reasonably large transaction

intermittent NPEs during DELETE ops in a reasonably large transaction
---------------------------------------------------------------------

                 Key: DERBY-2353
                 URL: https://issues.apache.org/jira/browse/DERBY-2353
             Project: Derby
          Issue Type: Bug
          Components: Store
    Affects Versions: 10.2.2.0
         Environment: Seen on both Windows XP and Mac OS X 10.4
            Reporter: Dan Karp


I'm intermittently seeing NPEs thrown while using the embedded driver to rewrite several rows in a single transaction.  Here's the set of commands that were executed on the transaction; the last one is the one that failed:

SELECT entry_id FROM zimbra.directory WHERE UPPER(zimbra_id) = '0F850D84-7096-4534-9389-9D85AFC17E8A' AND entry_type = 'acct'
DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRACONTACTMAXNUMENTRIES'
INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraContactMaxNumEntries', '0')
DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFGALAUTOCOMPLETEENABLED'
INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefGalAutoCompleteEnabled', 'FALSE')
DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFMAILPOLLINGINTERVAL'
INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefMailPollingInterval', '5m')
DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFGROUPMAILBY'
INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefGroupMailBy', 'conversation')
DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAFEATUREVIEWINHTMLENABLED'
INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraFeatureViewInHtmlEnabled', 'TRUE')
DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFMESSAGEVIEWHTMLPREFERRED'
INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefMessageViewHtmlPreferred', 'TRUE')
DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFREADINGPANEENABLED'
INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefReadingPaneEnabled', 'TRUE')
DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAFEATUREGALAUTOCOMPLETEENABLED'
INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraFeatureGalAutoCompleteEnabled', 'TRUE')
DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFCALENDARUSEQUICKADD'


Here's the stack trace:

Caused by: java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:89)
	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:100)
	at org.apache.derby.impl.jdbc.Util.javaException(Util.java:219)
	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:386)
	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:345)
	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:1378)
	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1272)
	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(EmbedPreparedStatement.java:1635)
	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(EmbedPreparedStatement.java:299)
	at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:233)
	at com.zimbra.cs.db.DebugPreparedStatement.executeUpdate(DebugPreparedStatement.java:154)


And here's the schema:

CREATE TABLE directory (
   entry_id    INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
   entry_type  CHAR(4) NOT NULL,
   entry_name  VARCHAR(128) NOT NULL,
   zimbra_id   CHAR(36),
   modified    SMALLINT NOT NULL
);

CREATE UNIQUE INDEX i_directory_zimbra_id ON directory(zimbra_id);
CREATE UNIQUE INDEX i_directory_entry_type_name ON directory(entry_type, entry_name);


CREATE TABLE directory_attrs (
   entry_id    INTEGER NOT NULL,
   name        VARCHAR(255) NOT NULL,
   value       VARCHAR(10240) NOT NULL,

   CONSTRAINT fk_dattr_entry_id FOREIGN KEY (entry_id) REFERENCES directory(entry_id)
      ON DELETE CASCADE
);

CREATE INDEX i_dattr_entry_id_name ON directory_attrs(entry_id, name);
CREATE INDEX i_dattr_name ON directory_attrs(name);

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


[jira] Commented: (DERBY-2353) intermittent NPEs during DELETE ops in a reasonably large transaction

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

Kathey Marsden commented on DERBY-2353:
---------------------------------------

I wonder if this issue still occurs. I noticed the code in question has been rearranged quite a bit.  I am curious to know if the NPE still occurrs and if so what is the new stack trace?

Thanks

Kathey


> intermittent NPEs during DELETE ops in a reasonably large transaction
> ---------------------------------------------------------------------
>
>                 Key: DERBY-2353
>                 URL: https://issues.apache.org/jira/browse/DERBY-2353
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Seen on both Windows XP and Mac OS X 10.4
>            Reporter: Dan Karp
>
> I'm intermittently seeing NPEs thrown while using the embedded driver to rewrite several rows in a single transaction.  Here's the set of commands that were executed on the transaction; the last one is the one that failed:
> SELECT entry_id FROM zimbra.directory WHERE UPPER(zimbra_id) = '0F850D84-7096-4534-9389-9D85AFC17E8A' AND entry_type = 'acct'
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRACONTACTMAXNUMENTRIES'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraContactMaxNumEntries', '0')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFGALAUTOCOMPLETEENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefGalAutoCompleteEnabled', 'FALSE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFMAILPOLLINGINTERVAL'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefMailPollingInterval', '5m')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFGROUPMAILBY'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefGroupMailBy', 'conversation')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAFEATUREVIEWINHTMLENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraFeatureViewInHtmlEnabled', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFMESSAGEVIEWHTMLPREFERRED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefMessageViewHtmlPreferred', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFREADINGPANEENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefReadingPaneEnabled', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAFEATUREGALAUTOCOMPLETEENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraFeatureGalAutoCompleteEnabled', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFCALENDARUSEQUICKADD'
> Here's the stack trace:
> Caused by: java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:89)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:100)
> 	at org.apache.derby.impl.jdbc.Util.javaException(Util.java:219)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:386)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:345)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:1378)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1272)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(EmbedPreparedStatement.java:1635)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(EmbedPreparedStatement.java:299)
> 	at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:233)
> 	at com.zimbra.cs.db.DebugPreparedStatement.executeUpdate(DebugPreparedStatement.java:154)
> And here's the schema:
> CREATE TABLE directory (
>    entry_id    INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
>    entry_type  CHAR(4) NOT NULL,
>    entry_name  VARCHAR(128) NOT NULL,
>    zimbra_id   CHAR(36),
>    modified    SMALLINT NOT NULL
> );
> CREATE UNIQUE INDEX i_directory_zimbra_id ON directory(zimbra_id);
> CREATE UNIQUE INDEX i_directory_entry_type_name ON directory(entry_type, entry_name);
> CREATE TABLE directory_attrs (
>    entry_id    INTEGER NOT NULL,
>    name        VARCHAR(255) NOT NULL,
>    value       VARCHAR(10240) NOT NULL,
>    CONSTRAINT fk_dattr_entry_id FOREIGN KEY (entry_id) REFERENCES directory(entry_id)
>       ON DELETE CASCADE
> );
> CREATE INDEX i_dattr_entry_id_name ON directory_attrs(entry_id, name);
> CREATE INDEX i_dattr_name ON directory_attrs(name);

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


[jira] Updated: (DERBY-2353) intermittent NPEs during DELETE ops in a reasonably large transaction

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

Kathey Marsden updated DERBY-2353:
----------------------------------

    Derby Categories: [High Value Fix]

This issue and possible dup DERBY_4043 seem to have been hit by quite a few users, marking it High Value.


> intermittent NPEs during DELETE ops in a reasonably large transaction
> ---------------------------------------------------------------------
>
>                 Key: DERBY-2353
>                 URL: https://issues.apache.org/jira/browse/DERBY-2353
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Seen on both Windows XP and Mac OS X 10.4
>            Reporter: Dan Karp
>
> I'm intermittently seeing NPEs thrown while using the embedded driver to rewrite several rows in a single transaction.  Here's the set of commands that were executed on the transaction; the last one is the one that failed:
> SELECT entry_id FROM zimbra.directory WHERE UPPER(zimbra_id) = '0F850D84-7096-4534-9389-9D85AFC17E8A' AND entry_type = 'acct'
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRACONTACTMAXNUMENTRIES'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraContactMaxNumEntries', '0')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFGALAUTOCOMPLETEENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefGalAutoCompleteEnabled', 'FALSE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFMAILPOLLINGINTERVAL'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefMailPollingInterval', '5m')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFGROUPMAILBY'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefGroupMailBy', 'conversation')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAFEATUREVIEWINHTMLENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraFeatureViewInHtmlEnabled', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFMESSAGEVIEWHTMLPREFERRED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefMessageViewHtmlPreferred', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFREADINGPANEENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefReadingPaneEnabled', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAFEATUREGALAUTOCOMPLETEENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraFeatureGalAutoCompleteEnabled', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFCALENDARUSEQUICKADD'
> Here's the stack trace:
> Caused by: java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:89)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:100)
> 	at org.apache.derby.impl.jdbc.Util.javaException(Util.java:219)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:386)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:345)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:1378)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1272)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(EmbedPreparedStatement.java:1635)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(EmbedPreparedStatement.java:299)
> 	at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:233)
> 	at com.zimbra.cs.db.DebugPreparedStatement.executeUpdate(DebugPreparedStatement.java:154)
> And here's the schema:
> CREATE TABLE directory (
>    entry_id    INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
>    entry_type  CHAR(4) NOT NULL,
>    entry_name  VARCHAR(128) NOT NULL,
>    zimbra_id   CHAR(36),
>    modified    SMALLINT NOT NULL
> );
> CREATE UNIQUE INDEX i_directory_zimbra_id ON directory(zimbra_id);
> CREATE UNIQUE INDEX i_directory_entry_type_name ON directory(entry_type, entry_name);
> CREATE TABLE directory_attrs (
>    entry_id    INTEGER NOT NULL,
>    name        VARCHAR(255) NOT NULL,
>    value       VARCHAR(10240) NOT NULL,
>    CONSTRAINT fk_dattr_entry_id FOREIGN KEY (entry_id) REFERENCES directory(entry_id)
>       ON DELETE CASCADE
> );
> CREATE INDEX i_dattr_entry_id_name ON directory_attrs(entry_id, name);
> CREATE INDEX i_dattr_name ON directory_attrs(name);

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


[jira] Reopened: (DERBY-2353) intermittent NPEs during DELETE ops in a reasonably large transaction

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

Knut Anders Hatlen reopened DERBY-2353:
---------------------------------------


A repro was posted on derby-user: http://mail-archives.apache.org/mod_mbox/db-derby-user/200901.mbox/%3c21725256.post@talk.nabble.com%3e

Note that you need to set derby.language.logQueryPlan=true in order to reproduce the NPE.

> intermittent NPEs during DELETE ops in a reasonably large transaction
> ---------------------------------------------------------------------
>
>                 Key: DERBY-2353
>                 URL: https://issues.apache.org/jira/browse/DERBY-2353
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Seen on both Windows XP and Mac OS X 10.4
>            Reporter: Dan Karp
>
> I'm intermittently seeing NPEs thrown while using the embedded driver to rewrite several rows in a single transaction.  Here's the set of commands that were executed on the transaction; the last one is the one that failed:
> SELECT entry_id FROM zimbra.directory WHERE UPPER(zimbra_id) = '0F850D84-7096-4534-9389-9D85AFC17E8A' AND entry_type = 'acct'
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRACONTACTMAXNUMENTRIES'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraContactMaxNumEntries', '0')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFGALAUTOCOMPLETEENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefGalAutoCompleteEnabled', 'FALSE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFMAILPOLLINGINTERVAL'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefMailPollingInterval', '5m')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFGROUPMAILBY'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefGroupMailBy', 'conversation')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAFEATUREVIEWINHTMLENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraFeatureViewInHtmlEnabled', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFMESSAGEVIEWHTMLPREFERRED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefMessageViewHtmlPreferred', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFREADINGPANEENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefReadingPaneEnabled', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAFEATUREGALAUTOCOMPLETEENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraFeatureGalAutoCompleteEnabled', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFCALENDARUSEQUICKADD'
> Here's the stack trace:
> Caused by: java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:89)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:100)
> 	at org.apache.derby.impl.jdbc.Util.javaException(Util.java:219)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:386)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:345)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:1378)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1272)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(EmbedPreparedStatement.java:1635)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(EmbedPreparedStatement.java:299)
> 	at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:233)
> 	at com.zimbra.cs.db.DebugPreparedStatement.executeUpdate(DebugPreparedStatement.java:154)
> And here's the schema:
> CREATE TABLE directory (
>    entry_id    INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
>    entry_type  CHAR(4) NOT NULL,
>    entry_name  VARCHAR(128) NOT NULL,
>    zimbra_id   CHAR(36),
>    modified    SMALLINT NOT NULL
> );
> CREATE UNIQUE INDEX i_directory_zimbra_id ON directory(zimbra_id);
> CREATE UNIQUE INDEX i_directory_entry_type_name ON directory(entry_type, entry_name);
> CREATE TABLE directory_attrs (
>    entry_id    INTEGER NOT NULL,
>    name        VARCHAR(255) NOT NULL,
>    value       VARCHAR(10240) NOT NULL,
>    CONSTRAINT fk_dattr_entry_id FOREIGN KEY (entry_id) REFERENCES directory(entry_id)
>       ON DELETE CASCADE
> );
> CREATE INDEX i_dattr_entry_id_name ON directory_attrs(entry_id, name);
> CREATE INDEX i_dattr_name ON directory_attrs(name);

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


[jira] Resolved: (DERBY-2353) intermittent NPEs during DELETE ops in a reasonably large transaction

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

Kathey Marsden resolved DERBY-2353.
-----------------------------------

    Resolution: Cannot Reproduce

No response since inquiry in Feb 2008.  Closing CNR. This can be reopened if it is still an issue.


> intermittent NPEs during DELETE ops in a reasonably large transaction
> ---------------------------------------------------------------------
>
>                 Key: DERBY-2353
>                 URL: https://issues.apache.org/jira/browse/DERBY-2353
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Seen on both Windows XP and Mac OS X 10.4
>            Reporter: Dan Karp
>
> I'm intermittently seeing NPEs thrown while using the embedded driver to rewrite several rows in a single transaction.  Here's the set of commands that were executed on the transaction; the last one is the one that failed:
> SELECT entry_id FROM zimbra.directory WHERE UPPER(zimbra_id) = '0F850D84-7096-4534-9389-9D85AFC17E8A' AND entry_type = 'acct'
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRACONTACTMAXNUMENTRIES'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraContactMaxNumEntries', '0')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFGALAUTOCOMPLETEENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefGalAutoCompleteEnabled', 'FALSE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFMAILPOLLINGINTERVAL'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefMailPollingInterval', '5m')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFGROUPMAILBY'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefGroupMailBy', 'conversation')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAFEATUREVIEWINHTMLENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraFeatureViewInHtmlEnabled', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFMESSAGEVIEWHTMLPREFERRED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefMessageViewHtmlPreferred', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFREADINGPANEENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefReadingPaneEnabled', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAFEATUREGALAUTOCOMPLETEENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraFeatureGalAutoCompleteEnabled', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFCALENDARUSEQUICKADD'
> Here's the stack trace:
> Caused by: java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:89)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:100)
> 	at org.apache.derby.impl.jdbc.Util.javaException(Util.java:219)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:386)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:345)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:1378)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1272)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(EmbedPreparedStatement.java:1635)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(EmbedPreparedStatement.java:299)
> 	at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:233)
> 	at com.zimbra.cs.db.DebugPreparedStatement.executeUpdate(DebugPreparedStatement.java:154)
> And here's the schema:
> CREATE TABLE directory (
>    entry_id    INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
>    entry_type  CHAR(4) NOT NULL,
>    entry_name  VARCHAR(128) NOT NULL,
>    zimbra_id   CHAR(36),
>    modified    SMALLINT NOT NULL
> );
> CREATE UNIQUE INDEX i_directory_zimbra_id ON directory(zimbra_id);
> CREATE UNIQUE INDEX i_directory_entry_type_name ON directory(entry_type, entry_name);
> CREATE TABLE directory_attrs (
>    entry_id    INTEGER NOT NULL,
>    name        VARCHAR(255) NOT NULL,
>    value       VARCHAR(10240) NOT NULL,
>    CONSTRAINT fk_dattr_entry_id FOREIGN KEY (entry_id) REFERENCES directory(entry_id)
>       ON DELETE CASCADE
> );
> CREATE INDEX i_dattr_entry_id_name ON directory_attrs(entry_id, name);
> CREATE INDEX i_dattr_name ON directory_attrs(name);

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


[jira] Commented: (DERBY-2353) intermittent NPEs during DELETE ops in a reasonably large transaction

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12474388 ] 

Knut Anders Hatlen commented on DERBY-2353:
-------------------------------------------

The stack trace doesn't provide very much information. Derby doesn't use initCause() or setStackTrace() on the exceptions because they are not available in Java 1.3, so the stack trace of the original exception is not shown. However, Derby's SQLException overrides printStackTrace() so that it prints the stack trace of the original exception (in this case the NullPointerException). If you could get a reference to the SQLException (invoke getCause() on your exception until you get the SQLException) and call printStackTrace() on that object, the stack trace of the NullPointerException would be printed. It is also possible that you will find the original stack trace in derby.log. Sorry for the inconvenience.

> intermittent NPEs during DELETE ops in a reasonably large transaction
> ---------------------------------------------------------------------
>
>                 Key: DERBY-2353
>                 URL: https://issues.apache.org/jira/browse/DERBY-2353
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Seen on both Windows XP and Mac OS X 10.4
>            Reporter: Dan Karp
>
> I'm intermittently seeing NPEs thrown while using the embedded driver to rewrite several rows in a single transaction.  Here's the set of commands that were executed on the transaction; the last one is the one that failed:
> SELECT entry_id FROM zimbra.directory WHERE UPPER(zimbra_id) = '0F850D84-7096-4534-9389-9D85AFC17E8A' AND entry_type = 'acct'
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRACONTACTMAXNUMENTRIES'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraContactMaxNumEntries', '0')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFGALAUTOCOMPLETEENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefGalAutoCompleteEnabled', 'FALSE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFMAILPOLLINGINTERVAL'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefMailPollingInterval', '5m')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFGROUPMAILBY'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefGroupMailBy', 'conversation')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAFEATUREVIEWINHTMLENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraFeatureViewInHtmlEnabled', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFMESSAGEVIEWHTMLPREFERRED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefMessageViewHtmlPreferred', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFREADINGPANEENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefReadingPaneEnabled', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAFEATUREGALAUTOCOMPLETEENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraFeatureGalAutoCompleteEnabled', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFCALENDARUSEQUICKADD'
> Here's the stack trace:
> Caused by: java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:89)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:100)
> 	at org.apache.derby.impl.jdbc.Util.javaException(Util.java:219)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:386)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:345)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:1378)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1272)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(EmbedPreparedStatement.java:1635)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(EmbedPreparedStatement.java:299)
> 	at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:233)
> 	at com.zimbra.cs.db.DebugPreparedStatement.executeUpdate(DebugPreparedStatement.java:154)
> And here's the schema:
> CREATE TABLE directory (
>    entry_id    INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
>    entry_type  CHAR(4) NOT NULL,
>    entry_name  VARCHAR(128) NOT NULL,
>    zimbra_id   CHAR(36),
>    modified    SMALLINT NOT NULL
> );
> CREATE UNIQUE INDEX i_directory_zimbra_id ON directory(zimbra_id);
> CREATE UNIQUE INDEX i_directory_entry_type_name ON directory(entry_type, entry_name);
> CREATE TABLE directory_attrs (
>    entry_id    INTEGER NOT NULL,
>    name        VARCHAR(255) NOT NULL,
>    value       VARCHAR(10240) NOT NULL,
>    CONSTRAINT fk_dattr_entry_id FOREIGN KEY (entry_id) REFERENCES directory(entry_id)
>       ON DELETE CASCADE
> );
> CREATE INDEX i_dattr_entry_id_name ON directory_attrs(entry_id, name);
> CREATE INDEX i_dattr_name ON directory_attrs(name);

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


[jira] Commented: (DERBY-2353) intermittent NPEs during DELETE ops in a reasonably large transaction

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12669613#action_12669613 ] 

Knut Anders Hatlen commented on DERBY-2353:
-------------------------------------------

I think the problem may be that the NoRowsResultSet family of ResultSets doesn't know which ResultSet is the top-level ResultSet. NoPutResultSetImpl.close() makes sure that some code is only executed for the top node: printing of query plan and closing of activation for single-execution statements. NoRowsResultSetImpl.close() executes that code for all ResultSets.

So here's what seems to be happening (using the repro from the derby-user thread): When close() is called on the top-level DeleteCascadeResultSet, it prints the query plan and closes the activation. Later the close() method of the child DeleteCascadeResultSet is called (the one that's performing the cascading delete), and because the activation is closed, the RuntimeStatistics object is null and we get the NPE when we try to print the query plan.

Note that the activation is only closed by the ResultSet's close() method if it's a single-execution activation. This means that we won't see the problem if we're using prepared statements, as they are not single-execution. I verified this by replacing the following line in the repro script:

delete from collectives;

with

prepare p as 'delete from collectives';
execute p;

and then the statement didn't throw an exception.

I guess we could fix it along these lines:

  - make sure that the child DeleteCascadeResultSets don't close the activation

  - make sure DeleteCascadeResultSet.cleanUp() cleans up the child ResultSets before it calls super.cleanUp() (which ends up calling close() and closing the activation). Right now it closes itself first and then its children.

> intermittent NPEs during DELETE ops in a reasonably large transaction
> ---------------------------------------------------------------------
>
>                 Key: DERBY-2353
>                 URL: https://issues.apache.org/jira/browse/DERBY-2353
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Seen on both Windows XP and Mac OS X 10.4
>            Reporter: Dan Karp
>
> I'm intermittently seeing NPEs thrown while using the embedded driver to rewrite several rows in a single transaction.  Here's the set of commands that were executed on the transaction; the last one is the one that failed:
> SELECT entry_id FROM zimbra.directory WHERE UPPER(zimbra_id) = '0F850D84-7096-4534-9389-9D85AFC17E8A' AND entry_type = 'acct'
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRACONTACTMAXNUMENTRIES'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraContactMaxNumEntries', '0')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFGALAUTOCOMPLETEENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefGalAutoCompleteEnabled', 'FALSE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFMAILPOLLINGINTERVAL'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefMailPollingInterval', '5m')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFGROUPMAILBY'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefGroupMailBy', 'conversation')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAFEATUREVIEWINHTMLENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraFeatureViewInHtmlEnabled', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFMESSAGEVIEWHTMLPREFERRED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefMessageViewHtmlPreferred', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFREADINGPANEENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefReadingPaneEnabled', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAFEATUREGALAUTOCOMPLETEENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraFeatureGalAutoCompleteEnabled', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFCALENDARUSEQUICKADD'
> Here's the stack trace:
> Caused by: java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:89)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:100)
> 	at org.apache.derby.impl.jdbc.Util.javaException(Util.java:219)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:386)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:345)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:1378)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1272)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(EmbedPreparedStatement.java:1635)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(EmbedPreparedStatement.java:299)
> 	at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:233)
> 	at com.zimbra.cs.db.DebugPreparedStatement.executeUpdate(DebugPreparedStatement.java:154)
> And here's the schema:
> CREATE TABLE directory (
>    entry_id    INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
>    entry_type  CHAR(4) NOT NULL,
>    entry_name  VARCHAR(128) NOT NULL,
>    zimbra_id   CHAR(36),
>    modified    SMALLINT NOT NULL
> );
> CREATE UNIQUE INDEX i_directory_zimbra_id ON directory(zimbra_id);
> CREATE UNIQUE INDEX i_directory_entry_type_name ON directory(entry_type, entry_name);
> CREATE TABLE directory_attrs (
>    entry_id    INTEGER NOT NULL,
>    name        VARCHAR(255) NOT NULL,
>    value       VARCHAR(10240) NOT NULL,
>    CONSTRAINT fk_dattr_entry_id FOREIGN KEY (entry_id) REFERENCES directory(entry_id)
>       ON DELETE CASCADE
> );
> CREATE INDEX i_dattr_entry_id_name ON directory_attrs(entry_id, name);
> CREATE INDEX i_dattr_name ON directory_attrs(name);

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


[jira] Resolved: (DERBY-2353) intermittent NPEs during DELETE ops in a reasonably large transaction

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

Knut Anders Hatlen resolved DERBY-2353.
---------------------------------------

       Resolution: Fixed
    Fix Version/s: 10.6.0.0
                   10.5.1.1

> intermittent NPEs during DELETE ops in a reasonably large transaction
> ---------------------------------------------------------------------
>
>                 Key: DERBY-2353
>                 URL: https://issues.apache.org/jira/browse/DERBY-2353
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Seen on both Windows XP and Mac OS X 10.4
>            Reporter: Dan Karp
>            Assignee: Knut Anders Hatlen
>             Fix For: 10.5.1.1, 10.6.0.0
>
>         Attachments: d2353.diff
>
>
> I'm intermittently seeing NPEs thrown while using the embedded driver to rewrite several rows in a single transaction.  Here's the set of commands that were executed on the transaction; the last one is the one that failed:
> SELECT entry_id FROM zimbra.directory WHERE UPPER(zimbra_id) = '0F850D84-7096-4534-9389-9D85AFC17E8A' AND entry_type = 'acct'
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRACONTACTMAXNUMENTRIES'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraContactMaxNumEntries', '0')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFGALAUTOCOMPLETEENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefGalAutoCompleteEnabled', 'FALSE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFMAILPOLLINGINTERVAL'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefMailPollingInterval', '5m')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFGROUPMAILBY'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefGroupMailBy', 'conversation')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAFEATUREVIEWINHTMLENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraFeatureViewInHtmlEnabled', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFMESSAGEVIEWHTMLPREFERRED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefMessageViewHtmlPreferred', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFREADINGPANEENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefReadingPaneEnabled', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAFEATUREGALAUTOCOMPLETEENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraFeatureGalAutoCompleteEnabled', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFCALENDARUSEQUICKADD'
> Here's the stack trace:
> Caused by: java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:89)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:100)
> 	at org.apache.derby.impl.jdbc.Util.javaException(Util.java:219)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:386)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:345)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:1378)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1272)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(EmbedPreparedStatement.java:1635)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(EmbedPreparedStatement.java:299)
> 	at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:233)
> 	at com.zimbra.cs.db.DebugPreparedStatement.executeUpdate(DebugPreparedStatement.java:154)
> And here's the schema:
> CREATE TABLE directory (
>    entry_id    INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
>    entry_type  CHAR(4) NOT NULL,
>    entry_name  VARCHAR(128) NOT NULL,
>    zimbra_id   CHAR(36),
>    modified    SMALLINT NOT NULL
> );
> CREATE UNIQUE INDEX i_directory_zimbra_id ON directory(zimbra_id);
> CREATE UNIQUE INDEX i_directory_entry_type_name ON directory(entry_type, entry_name);
> CREATE TABLE directory_attrs (
>    entry_id    INTEGER NOT NULL,
>    name        VARCHAR(255) NOT NULL,
>    value       VARCHAR(10240) NOT NULL,
>    CONSTRAINT fk_dattr_entry_id FOREIGN KEY (entry_id) REFERENCES directory(entry_id)
>       ON DELETE CASCADE
> );
> CREATE INDEX i_dattr_entry_id_name ON directory_attrs(entry_id, name);
> CREATE INDEX i_dattr_name ON directory_attrs(name);

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


[jira] Updated: (DERBY-2353) intermittent NPEs during DELETE ops in a reasonably large transaction

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

Knut Anders Hatlen updated DERBY-2353:
--------------------------------------

    Attachment: d2353.diff

Here's a simple fix for the issue (patch file d2353.diff). The patch just adds an extra check for activation.isClosed() and skips printing the query plan if the activation has been closed. This means that if the top-level result set closes the activation, the child result sets won't print their own query plans. However, all that information is already printed by the parent, so there's no need to print it again by the children.

The patch also has a test case that fails with a NullPointerException without the fix.

Running the regression tests now.

> intermittent NPEs during DELETE ops in a reasonably large transaction
> ---------------------------------------------------------------------
>
>                 Key: DERBY-2353
>                 URL: https://issues.apache.org/jira/browse/DERBY-2353
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Seen on both Windows XP and Mac OS X 10.4
>            Reporter: Dan Karp
>            Assignee: Knut Anders Hatlen
>         Attachments: d2353.diff
>
>
> I'm intermittently seeing NPEs thrown while using the embedded driver to rewrite several rows in a single transaction.  Here's the set of commands that were executed on the transaction; the last one is the one that failed:
> SELECT entry_id FROM zimbra.directory WHERE UPPER(zimbra_id) = '0F850D84-7096-4534-9389-9D85AFC17E8A' AND entry_type = 'acct'
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRACONTACTMAXNUMENTRIES'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraContactMaxNumEntries', '0')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFGALAUTOCOMPLETEENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefGalAutoCompleteEnabled', 'FALSE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFMAILPOLLINGINTERVAL'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefMailPollingInterval', '5m')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFGROUPMAILBY'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefGroupMailBy', 'conversation')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAFEATUREVIEWINHTMLENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraFeatureViewInHtmlEnabled', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFMESSAGEVIEWHTMLPREFERRED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefMessageViewHtmlPreferred', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFREADINGPANEENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefReadingPaneEnabled', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAFEATUREGALAUTOCOMPLETEENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraFeatureGalAutoCompleteEnabled', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFCALENDARUSEQUICKADD'
> Here's the stack trace:
> Caused by: java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:89)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:100)
> 	at org.apache.derby.impl.jdbc.Util.javaException(Util.java:219)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:386)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:345)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:1378)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1272)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(EmbedPreparedStatement.java:1635)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(EmbedPreparedStatement.java:299)
> 	at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:233)
> 	at com.zimbra.cs.db.DebugPreparedStatement.executeUpdate(DebugPreparedStatement.java:154)
> And here's the schema:
> CREATE TABLE directory (
>    entry_id    INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
>    entry_type  CHAR(4) NOT NULL,
>    entry_name  VARCHAR(128) NOT NULL,
>    zimbra_id   CHAR(36),
>    modified    SMALLINT NOT NULL
> );
> CREATE UNIQUE INDEX i_directory_zimbra_id ON directory(zimbra_id);
> CREATE UNIQUE INDEX i_directory_entry_type_name ON directory(entry_type, entry_name);
> CREATE TABLE directory_attrs (
>    entry_id    INTEGER NOT NULL,
>    name        VARCHAR(255) NOT NULL,
>    value       VARCHAR(10240) NOT NULL,
>    CONSTRAINT fk_dattr_entry_id FOREIGN KEY (entry_id) REFERENCES directory(entry_id)
>       ON DELETE CASCADE
> );
> CREATE INDEX i_dattr_entry_id_name ON directory_attrs(entry_id, name);
> CREATE INDEX i_dattr_name ON directory_attrs(name);

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


[jira] Commented: (DERBY-2353) intermittent NPEs during DELETE ops in a reasonably large transaction

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12697782#action_12697782 ] 

Knut Anders Hatlen commented on DERBY-2353:
-------------------------------------------

(Commenting via mail. JIRA is down so it's not possible to update the
status of the issue at the moment.)

The regression tests passed, and I committed the patch to trunk
(revision 763900) and to 10.5 (revision 763901).


> intermittent NPEs during DELETE ops in a reasonably large transaction
> ---------------------------------------------------------------------
>
>                 Key: DERBY-2353
>                 URL: https://issues.apache.org/jira/browse/DERBY-2353
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Seen on both Windows XP and Mac OS X 10.4
>            Reporter: Dan Karp
>            Assignee: Knut Anders Hatlen
>         Attachments: d2353.diff
>
>
> I'm intermittently seeing NPEs thrown while using the embedded driver to rewrite several rows in a single transaction.  Here's the set of commands that were executed on the transaction; the last one is the one that failed:
> SELECT entry_id FROM zimbra.directory WHERE UPPER(zimbra_id) = '0F850D84-7096-4534-9389-9D85AFC17E8A' AND entry_type = 'acct'
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRACONTACTMAXNUMENTRIES'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraContactMaxNumEntries', '0')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFGALAUTOCOMPLETEENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefGalAutoCompleteEnabled', 'FALSE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFMAILPOLLINGINTERVAL'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefMailPollingInterval', '5m')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFGROUPMAILBY'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefGroupMailBy', 'conversation')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAFEATUREVIEWINHTMLENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraFeatureViewInHtmlEnabled', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFMESSAGEVIEWHTMLPREFERRED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefMessageViewHtmlPreferred', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFREADINGPANEENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefReadingPaneEnabled', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAFEATUREGALAUTOCOMPLETEENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraFeatureGalAutoCompleteEnabled', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFCALENDARUSEQUICKADD'
> Here's the stack trace:
> Caused by: java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:89)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:100)
> 	at org.apache.derby.impl.jdbc.Util.javaException(Util.java:219)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:386)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:345)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:1378)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1272)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(EmbedPreparedStatement.java:1635)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(EmbedPreparedStatement.java:299)
> 	at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:233)
> 	at com.zimbra.cs.db.DebugPreparedStatement.executeUpdate(DebugPreparedStatement.java:154)
> And here's the schema:
> CREATE TABLE directory (
>    entry_id    INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
>    entry_type  CHAR(4) NOT NULL,
>    entry_name  VARCHAR(128) NOT NULL,
>    zimbra_id   CHAR(36),
>    modified    SMALLINT NOT NULL
> );
> CREATE UNIQUE INDEX i_directory_zimbra_id ON directory(zimbra_id);
> CREATE UNIQUE INDEX i_directory_entry_type_name ON directory(entry_type, entry_name);
> CREATE TABLE directory_attrs (
>    entry_id    INTEGER NOT NULL,
>    name        VARCHAR(255) NOT NULL,
>    value       VARCHAR(10240) NOT NULL,
>    CONSTRAINT fk_dattr_entry_id FOREIGN KEY (entry_id) REFERENCES directory(entry_id)
>       ON DELETE CASCADE
> );
> CREATE INDEX i_dattr_entry_id_name ON directory_attrs(entry_id, name);
> CREATE INDEX i_dattr_name ON directory_attrs(name);

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


[jira] Commented: (DERBY-2353) intermittent NPEs during DELETE ops in a reasonably large transaction

Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12483054 ] 

Kristian Waagan commented on DERBY-2353:
----------------------------------------

I don't think setting 'derby.stream.error.method' actually disables logging, it just creates a "black hole" for all the logging output.
You should make sure 'derby.language.logQueryPlan' is set to false, and also 'derby.language.logStatementText' as well. You can keep the 'derby.stream.error.method' if you want to get rid of derby.log, or you can remove it and check what is written to the log.

If you still get the error, it would help to see your derby.properties file and also what is printed to derby.log.

> intermittent NPEs during DELETE ops in a reasonably large transaction
> ---------------------------------------------------------------------
>
>                 Key: DERBY-2353
>                 URL: https://issues.apache.org/jira/browse/DERBY-2353
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Seen on both Windows XP and Mac OS X 10.4
>            Reporter: Dan Karp
>
> I'm intermittently seeing NPEs thrown while using the embedded driver to rewrite several rows in a single transaction.  Here's the set of commands that were executed on the transaction; the last one is the one that failed:
> SELECT entry_id FROM zimbra.directory WHERE UPPER(zimbra_id) = '0F850D84-7096-4534-9389-9D85AFC17E8A' AND entry_type = 'acct'
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRACONTACTMAXNUMENTRIES'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraContactMaxNumEntries', '0')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFGALAUTOCOMPLETEENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefGalAutoCompleteEnabled', 'FALSE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFMAILPOLLINGINTERVAL'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefMailPollingInterval', '5m')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFGROUPMAILBY'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefGroupMailBy', 'conversation')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAFEATUREVIEWINHTMLENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraFeatureViewInHtmlEnabled', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFMESSAGEVIEWHTMLPREFERRED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefMessageViewHtmlPreferred', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFREADINGPANEENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefReadingPaneEnabled', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAFEATUREGALAUTOCOMPLETEENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraFeatureGalAutoCompleteEnabled', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFCALENDARUSEQUICKADD'
> Here's the stack trace:
> Caused by: java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:89)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:100)
> 	at org.apache.derby.impl.jdbc.Util.javaException(Util.java:219)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:386)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:345)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:1378)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1272)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(EmbedPreparedStatement.java:1635)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(EmbedPreparedStatement.java:299)
> 	at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:233)
> 	at com.zimbra.cs.db.DebugPreparedStatement.executeUpdate(DebugPreparedStatement.java:154)
> And here's the schema:
> CREATE TABLE directory (
>    entry_id    INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
>    entry_type  CHAR(4) NOT NULL,
>    entry_name  VARCHAR(128) NOT NULL,
>    zimbra_id   CHAR(36),
>    modified    SMALLINT NOT NULL
> );
> CREATE UNIQUE INDEX i_directory_zimbra_id ON directory(zimbra_id);
> CREATE UNIQUE INDEX i_directory_entry_type_name ON directory(entry_type, entry_name);
> CREATE TABLE directory_attrs (
>    entry_id    INTEGER NOT NULL,
>    name        VARCHAR(255) NOT NULL,
>    value       VARCHAR(10240) NOT NULL,
>    CONSTRAINT fk_dattr_entry_id FOREIGN KEY (entry_id) REFERENCES directory(entry_id)
>       ON DELETE CASCADE
> );
> CREATE INDEX i_dattr_entry_id_name ON directory_attrs(entry_id, name);
> CREATE INDEX i_dattr_name ON directory_attrs(name);

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


[jira] Commented: (DERBY-2353) intermittent NPEs during DELETE ops in a reasonably large transaction

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12474650 ] 

Knut Anders Hatlen commented on DERBY-2353:
-------------------------------------------

Thanks for posting the complete stack trace! The NPE is thrown in some code that is only executed when the derby.language.logQueryPlan property is true. You might be able to work around this bug by disabling the logging of query plans.

> intermittent NPEs during DELETE ops in a reasonably large transaction
> ---------------------------------------------------------------------
>
>                 Key: DERBY-2353
>                 URL: https://issues.apache.org/jira/browse/DERBY-2353
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Seen on both Windows XP and Mac OS X 10.4
>            Reporter: Dan Karp
>
> I'm intermittently seeing NPEs thrown while using the embedded driver to rewrite several rows in a single transaction.  Here's the set of commands that were executed on the transaction; the last one is the one that failed:
> SELECT entry_id FROM zimbra.directory WHERE UPPER(zimbra_id) = '0F850D84-7096-4534-9389-9D85AFC17E8A' AND entry_type = 'acct'
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRACONTACTMAXNUMENTRIES'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraContactMaxNumEntries', '0')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFGALAUTOCOMPLETEENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefGalAutoCompleteEnabled', 'FALSE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFMAILPOLLINGINTERVAL'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefMailPollingInterval', '5m')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFGROUPMAILBY'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefGroupMailBy', 'conversation')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAFEATUREVIEWINHTMLENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraFeatureViewInHtmlEnabled', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFMESSAGEVIEWHTMLPREFERRED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefMessageViewHtmlPreferred', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFREADINGPANEENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefReadingPaneEnabled', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAFEATUREGALAUTOCOMPLETEENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraFeatureGalAutoCompleteEnabled', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFCALENDARUSEQUICKADD'
> Here's the stack trace:
> Caused by: java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:89)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:100)
> 	at org.apache.derby.impl.jdbc.Util.javaException(Util.java:219)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:386)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:345)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:1378)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1272)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(EmbedPreparedStatement.java:1635)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(EmbedPreparedStatement.java:299)
> 	at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:233)
> 	at com.zimbra.cs.db.DebugPreparedStatement.executeUpdate(DebugPreparedStatement.java:154)
> And here's the schema:
> CREATE TABLE directory (
>    entry_id    INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
>    entry_type  CHAR(4) NOT NULL,
>    entry_name  VARCHAR(128) NOT NULL,
>    zimbra_id   CHAR(36),
>    modified    SMALLINT NOT NULL
> );
> CREATE UNIQUE INDEX i_directory_zimbra_id ON directory(zimbra_id);
> CREATE UNIQUE INDEX i_directory_entry_type_name ON directory(entry_type, entry_name);
> CREATE TABLE directory_attrs (
>    entry_id    INTEGER NOT NULL,
>    name        VARCHAR(255) NOT NULL,
>    value       VARCHAR(10240) NOT NULL,
>    CONSTRAINT fk_dattr_entry_id FOREIGN KEY (entry_id) REFERENCES directory(entry_id)
>       ON DELETE CASCADE
> );
> CREATE INDEX i_dattr_entry_id_name ON directory_attrs(entry_id, name);
> CREATE INDEX i_dattr_name ON directory_attrs(name);

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


[jira] Assigned: (DERBY-2353) intermittent NPEs during DELETE ops in a reasonably large transaction

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

Knut Anders Hatlen reassigned DERBY-2353:
-----------------------------------------

    Assignee: Knut Anders Hatlen

> intermittent NPEs during DELETE ops in a reasonably large transaction
> ---------------------------------------------------------------------
>
>                 Key: DERBY-2353
>                 URL: https://issues.apache.org/jira/browse/DERBY-2353
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Seen on both Windows XP and Mac OS X 10.4
>            Reporter: Dan Karp
>            Assignee: Knut Anders Hatlen
>
> I'm intermittently seeing NPEs thrown while using the embedded driver to rewrite several rows in a single transaction.  Here's the set of commands that were executed on the transaction; the last one is the one that failed:
> SELECT entry_id FROM zimbra.directory WHERE UPPER(zimbra_id) = '0F850D84-7096-4534-9389-9D85AFC17E8A' AND entry_type = 'acct'
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRACONTACTMAXNUMENTRIES'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraContactMaxNumEntries', '0')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFGALAUTOCOMPLETEENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefGalAutoCompleteEnabled', 'FALSE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFMAILPOLLINGINTERVAL'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefMailPollingInterval', '5m')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFGROUPMAILBY'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefGroupMailBy', 'conversation')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAFEATUREVIEWINHTMLENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraFeatureViewInHtmlEnabled', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFMESSAGEVIEWHTMLPREFERRED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefMessageViewHtmlPreferred', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFREADINGPANEENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefReadingPaneEnabled', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAFEATUREGALAUTOCOMPLETEENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraFeatureGalAutoCompleteEnabled', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFCALENDARUSEQUICKADD'
> Here's the stack trace:
> Caused by: java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:89)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:100)
> 	at org.apache.derby.impl.jdbc.Util.javaException(Util.java:219)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:386)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:345)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:1378)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1272)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(EmbedPreparedStatement.java:1635)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(EmbedPreparedStatement.java:299)
> 	at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:233)
> 	at com.zimbra.cs.db.DebugPreparedStatement.executeUpdate(DebugPreparedStatement.java:154)
> And here's the schema:
> CREATE TABLE directory (
>    entry_id    INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
>    entry_type  CHAR(4) NOT NULL,
>    entry_name  VARCHAR(128) NOT NULL,
>    zimbra_id   CHAR(36),
>    modified    SMALLINT NOT NULL
> );
> CREATE UNIQUE INDEX i_directory_zimbra_id ON directory(zimbra_id);
> CREATE UNIQUE INDEX i_directory_entry_type_name ON directory(entry_type, entry_name);
> CREATE TABLE directory_attrs (
>    entry_id    INTEGER NOT NULL,
>    name        VARCHAR(255) NOT NULL,
>    value       VARCHAR(10240) NOT NULL,
>    CONSTRAINT fk_dattr_entry_id FOREIGN KEY (entry_id) REFERENCES directory(entry_id)
>       ON DELETE CASCADE
> );
> CREATE INDEX i_dattr_entry_id_name ON directory_attrs(entry_id, name);
> CREATE INDEX i_dattr_name ON directory_attrs(name);

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


[jira] Commented: (DERBY-2353) intermittent NPEs during DELETE ops in a reasonably large transaction

Posted by "J.J. Zhuang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12482310 ] 

J.J. Zhuang commented on DERBY-2353:
------------------------------------

I still see it after I disabled derby logging.  The way I disabled logging is by setting system property "derby.stream.error.method" to a stub class.  That got rid of the derby.log output.

Is there another logging mechanism I need to disable in order to workaround the NPE?  Thanks!

> intermittent NPEs during DELETE ops in a reasonably large transaction
> ---------------------------------------------------------------------
>
>                 Key: DERBY-2353
>                 URL: https://issues.apache.org/jira/browse/DERBY-2353
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Seen on both Windows XP and Mac OS X 10.4
>            Reporter: Dan Karp
>
> I'm intermittently seeing NPEs thrown while using the embedded driver to rewrite several rows in a single transaction.  Here's the set of commands that were executed on the transaction; the last one is the one that failed:
> SELECT entry_id FROM zimbra.directory WHERE UPPER(zimbra_id) = '0F850D84-7096-4534-9389-9D85AFC17E8A' AND entry_type = 'acct'
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRACONTACTMAXNUMENTRIES'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraContactMaxNumEntries', '0')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFGALAUTOCOMPLETEENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefGalAutoCompleteEnabled', 'FALSE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFMAILPOLLINGINTERVAL'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefMailPollingInterval', '5m')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFGROUPMAILBY'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefGroupMailBy', 'conversation')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAFEATUREVIEWINHTMLENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraFeatureViewInHtmlEnabled', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFMESSAGEVIEWHTMLPREFERRED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefMessageViewHtmlPreferred', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFREADINGPANEENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefReadingPaneEnabled', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAFEATUREGALAUTOCOMPLETEENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraFeatureGalAutoCompleteEnabled', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFCALENDARUSEQUICKADD'
> Here's the stack trace:
> Caused by: java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:89)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:100)
> 	at org.apache.derby.impl.jdbc.Util.javaException(Util.java:219)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:386)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:345)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:1378)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1272)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(EmbedPreparedStatement.java:1635)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(EmbedPreparedStatement.java:299)
> 	at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:233)
> 	at com.zimbra.cs.db.DebugPreparedStatement.executeUpdate(DebugPreparedStatement.java:154)
> And here's the schema:
> CREATE TABLE directory (
>    entry_id    INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
>    entry_type  CHAR(4) NOT NULL,
>    entry_name  VARCHAR(128) NOT NULL,
>    zimbra_id   CHAR(36),
>    modified    SMALLINT NOT NULL
> );
> CREATE UNIQUE INDEX i_directory_zimbra_id ON directory(zimbra_id);
> CREATE UNIQUE INDEX i_directory_entry_type_name ON directory(entry_type, entry_name);
> CREATE TABLE directory_attrs (
>    entry_id    INTEGER NOT NULL,
>    name        VARCHAR(255) NOT NULL,
>    value       VARCHAR(10240) NOT NULL,
>    CONSTRAINT fk_dattr_entry_id FOREIGN KEY (entry_id) REFERENCES directory(entry_id)
>       ON DELETE CASCADE
> );
> CREATE INDEX i_dattr_entry_id_name ON directory_attrs(entry_id, name);
> CREATE INDEX i_dattr_name ON directory_attrs(name);

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


[jira] Commented: (DERBY-2353) intermittent NPEs during DELETE ops in a reasonably large transaction

Posted by "Dan Karp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12474606 ] 

Dan Karp commented on DERBY-2353:
---------------------------------

java.lang.NullPointerException
	at org.apache.derby.impl.sql.execute.NoRowsResultSetImpl.finish(NoRowsResultSetImpl.java:410)
	at org.apache.derby.impl.sql.execute.DeleteResultSet.finish(DeleteResultSet.java:650)
	at org.apache.derby.impl.sql.execute.BaseActivation.close(BaseActivation.java:407)
	at org.apache.derby.impl.sql.GenericActivationHolder.execute(GenericActivationHolder.java:305)
	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:356)
	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1182)
	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(EmbedPreparedStatement.java:1635)
	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(EmbedPreparedStatement.java:299)
	at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:233)
	at com.zimbra.cs.db.DebugPreparedStatement.executeUpdate(DebugPreparedStatement.java:154)

> intermittent NPEs during DELETE ops in a reasonably large transaction
> ---------------------------------------------------------------------
>
>                 Key: DERBY-2353
>                 URL: https://issues.apache.org/jira/browse/DERBY-2353
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Seen on both Windows XP and Mac OS X 10.4
>            Reporter: Dan Karp
>
> I'm intermittently seeing NPEs thrown while using the embedded driver to rewrite several rows in a single transaction.  Here's the set of commands that were executed on the transaction; the last one is the one that failed:
> SELECT entry_id FROM zimbra.directory WHERE UPPER(zimbra_id) = '0F850D84-7096-4534-9389-9D85AFC17E8A' AND entry_type = 'acct'
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRACONTACTMAXNUMENTRIES'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraContactMaxNumEntries', '0')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFGALAUTOCOMPLETEENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefGalAutoCompleteEnabled', 'FALSE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFMAILPOLLINGINTERVAL'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefMailPollingInterval', '5m')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFGROUPMAILBY'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefGroupMailBy', 'conversation')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAFEATUREVIEWINHTMLENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraFeatureViewInHtmlEnabled', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFMESSAGEVIEWHTMLPREFERRED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefMessageViewHtmlPreferred', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFREADINGPANEENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraPrefReadingPaneEnabled', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAFEATUREGALAUTOCOMPLETEENABLED'
> INSERT INTO zimbra.directory_attrs (entry_id, name, value) VALUES (8, 'zimbraFeatureGalAutoCompleteEnabled', 'TRUE')
> DELETE FROM zimbra.directory_attrs WHERE entry_id = 8 AND UPPER(name) = 'ZIMBRAPREFCALENDARUSEQUICKADD'
> Here's the stack trace:
> Caused by: java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:89)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:100)
> 	at org.apache.derby.impl.jdbc.Util.javaException(Util.java:219)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:386)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:345)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:1378)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1272)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(EmbedPreparedStatement.java:1635)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(EmbedPreparedStatement.java:299)
> 	at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:233)
> 	at com.zimbra.cs.db.DebugPreparedStatement.executeUpdate(DebugPreparedStatement.java:154)
> And here's the schema:
> CREATE TABLE directory (
>    entry_id    INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
>    entry_type  CHAR(4) NOT NULL,
>    entry_name  VARCHAR(128) NOT NULL,
>    zimbra_id   CHAR(36),
>    modified    SMALLINT NOT NULL
> );
> CREATE UNIQUE INDEX i_directory_zimbra_id ON directory(zimbra_id);
> CREATE UNIQUE INDEX i_directory_entry_type_name ON directory(entry_type, entry_name);
> CREATE TABLE directory_attrs (
>    entry_id    INTEGER NOT NULL,
>    name        VARCHAR(255) NOT NULL,
>    value       VARCHAR(10240) NOT NULL,
>    CONSTRAINT fk_dattr_entry_id FOREIGN KEY (entry_id) REFERENCES directory(entry_id)
>       ON DELETE CASCADE
> );
> CREATE INDEX i_dattr_entry_id_name ON directory_attrs(entry_id, name);
> CREATE INDEX i_dattr_name ON directory_attrs(name);

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