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 "Knut Anders Hatlen (JIRA)" <ji...@apache.org> on 2010/05/21 11:15:18 UTC

[jira] Commented: (DERBY-4671) Embedded driver does not work with jbossCache

    [ https://issues.apache.org/jira/browse/DERBY-4671?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12869913#action_12869913 ] 

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

The zip file contains a derby.log which shows the query that fails:

INSERT INTO jbosscache (fqn, node, parent) SELECT ?, ?, ? FROM jbosscache_D WHERE NOT EXISTS (SELECT fqn FROM jbosscache WHERE fqn = ?)

The NPE is easily reproducible in ij:

ij> create table t (x int);
0 rows inserted/updated/deleted
ij> prepare ps as 'insert into t select ? from t';
ERROR XJ001: Java exception: ': java.lang.NullPointerException'.

Preparation of the insert statement fails with a NullPointerException in Derby 10.6.1.0, whereas 10.5.3.0 and earlier versions successfully prepare and execute the query.

I'm not sure if it is intentional that the older versions allow ? in the select list, as the same select statement fails when it's not within an insert statement:

ij> prepare ps as 'select ? from t';
ERROR 42X34: There is a ? parameter in the select list.  This is not allowed.

I would have expected the same result from the insert statement. Anyhow, it should not fail with a NullPointerException.

> Embedded driver does not work with jbossCache
> ---------------------------------------------
>
>                 Key: DERBY-4671
>                 URL: https://issues.apache.org/jira/browse/DERBY-4671
>             Project: Derby
>          Issue Type: Bug
>    Affects Versions: 10.6.1.0
>         Environment: ------------------ Java Information ------------------
> Java Version:    1.5.0_12
> Java Vendor:     Sun Microsystems Inc.
> Java home:       c:\FDE\JDK1.5.0_12\jre
> Java classpath:  .;C:\Program Files\Java\jre1.5.0_06\lib\ext\QTJava.zip;C:\FDE\db-derby-10.6.1.0-bin/lib/derby.jar;C:\FDE\db-derby-10.6.1.0-bin/lib/derbynet.jar;C:\FDE\db-derby-10
> 6.1.0-bin/lib/derbyclient.jar;C:\FDE\db-derby-10.6.1.0-bin/lib/derbytools.jar
> OS name:         Windows XP
> OS architecture: x86
> OS version:      5.1
> Java user name:  rayohagan
> Java user home:  C:\Documents and Settings\rayohagan.FUTRIX
> Java user dir:   C:\FDE\db-derby-10.6.1.0-bin\bin
> java.specification.name: Java Platform API Specification
> java.specification.version: 1.5
> java.runtime.version: 1.5.0_12-b04
> --------- Derby Information --------
> JRE - JDBC: J2SE 5.0 - JDBC 3.0
> [C:\FDE\db-derby-10.6.1.0-bin\lib\derby.jar] 10.6.1.0 - (938214)
> [C:\FDE\db-derby-10.6.1.0-bin\lib\derbytools.jar] 10.6.1.0 - (938214)
> [C:\FDE\db-derby-10.6.1.0-bin\lib\derbynet.jar] 10.6.1.0 - (938214)
> [C:\FDE\db-derby-10.6.1.0-bin\lib\derbyclient.jar] 10.6.1.0 - (938214)
> ------------------------------------------------------
> ----------------- Locale Information -----------------
> Current Locale :  [English/New Zealand [en_NZ]]
> Found support for locale: [cs]
>          version: 10.6.1.0 - (938214)
> Found support for locale: [de_DE]
>          version: 10.6.1.0 - (938214)
> Found support for locale: [es]
>          version: 10.6.1.0 - (938214)
> Found support for locale: [fr]
>          version: 10.6.1.0 - (938214)
> Found support for locale: [hu]
>          version: 10.6.1.0 - (938214)
> Found support for locale: [it]
>          version: 10.6.1.0 - (938214)
> Found support for locale: [ja_JP]
>          version: 10.6.1.0 - (938214)
> Found support for locale: [ko_KR]
>          version: 10.6.1.0 - (938214)
> Found support for locale: [pl]
>          version: 10.6.1.0 - (938214)
> Found support for locale: [pt_BR]
>          version: 10.6.1.0 - (938214)
> Found support for locale: [ru]
>          version: 10.6.1.0 - (938214)
> Found support for locale: [zh_CN]
>          version: 10.6.1.0 - (938214)
> Found support for locale: [zh_TW]
>          version: 10.6.1.0 - (938214)
> ------------------------------------------------------
>            Reporter: Ray O'Hagan
>         Attachments: cache-config.xml, CacheIssue-eclipseProject.zip, CacheIssue.java
>
>
> When trying to use jbossCache (version 3.2.5) and an embedded derby driver the following exception is thrown when jbossCache tries to persist information to the database
> 48610 [AsyncCacheLoader-0] ERROR org.jboss.cache.loader.JDBCCacheLoader [] - Failed to insert node :Java exception: ': java.lang.NullPointerException'.
>  48610 [AsyncCacheLoader-0] WARN  org.jboss.cache.loader.AsyncCacheLoader [] - Failed to process async modifications: java.lang.IllegalStateException: Failed to insert node: Java e
> xception: ': java.lang.NullPointerException'.
>  48610 [AsyncCacheLoader-0] DEBUG org.jboss.cache.loader.AsyncCacheLoader [] - Exception:
>  java.lang.IllegalStateException: Failed to insert node: Java exception: ': java.lang.NullPointerException'.
>         at org.jboss.cache.loader.AdjListJDBCCacheLoader.insertNode(AdjListJDBCCacheLoader.java:562)
>         at org.jboss.cache.loader.JDBCCacheLoader.addNewSubtree(JDBCCacheLoader.java:367)
>         at org.jboss.cache.loader.JDBCCacheLoader.put(JDBCCacheLoader.java:110)
>         at org.jboss.cache.loader.AbstractCacheLoader.put(AbstractCacheLoader.java:303)
>         at org.jboss.cache.loader.AbstractDelegatingCacheLoader.put(AbstractDelegatingCacheLoader.java:110)
>         at org.jboss.cache.loader.AsyncCacheLoader.access$601(AsyncCacheLoader.java:105)
>         at org.jboss.cache.loader.AsyncCacheLoader$AsyncProcessor.put(AsyncCacheLoader.java:417)
>         at org.jboss.cache.loader.AsyncCacheLoader$AsyncProcessor.run0(AsyncCacheLoader.java:409)
>         at org.jboss.cache.loader.AsyncCacheLoader$AsyncProcessor.run(AsyncCacheLoader.java:371)
>         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
>         at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:138)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>         at java.lang.Thread.run(Thread.java:619)
> Caused by: java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
>         at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:95)
>         at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:142)
>         at org.apache.derby.impl.jdbc.Util.javaException(Util.java:299)
>         at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:403)
>         at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:346)
>         at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2269)
>         at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
>         at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(EmbedPreparedStatement.java:148)
>         at org.apache.derby.impl.jdbc.EmbedPreparedStatement20.<init>(EmbedPreparedStatement20.java:82)
>         at org.apache.derby.impl.jdbc.EmbedPreparedStatement30.<init>(EmbedPreparedStatement30.java:63)
>         at org.apache.derby.impl.jdbc.EmbedPreparedStatement40.<init>(EmbedPreparedStatement40.java:40)
>         at org.apache.derby.jdbc.Driver40.newEmbedPreparedStatement(Driver40.java:105)
>         at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(EmbedConnection.java:1607)
>         at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(EmbedConnection.java:1435)
>         at com.mchange.v2.c3p0.impl.NewProxyConnection.prepareStatement(NewProxyConnection.java:213)
>         at org.jboss.cache.loader.AdjListJDBCCacheLoader.prepareAndLogStatement(AdjListJDBCCacheLoader.java:90)
>         at org.jboss.cache.loader.AdjListJDBCCacheLoader.insertNode(AdjListJDBCCacheLoader.java:545)
>         ... 14 more
> 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.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:119)
>         at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70)
>         ... 30 more
> Caused by: java.lang.NullPointerException
>         at org.apache.derby.impl.sql.compile.CharTypeCompiler.convertible(CharTypeCompiler.java:54)
>         at org.apache.derby.impl.sql.compile.CharTypeCompiler.storable(CharTypeCompiler.java:100)
>         at org.apache.derby.impl.sql.compile.ResultColumn.checkStorableExpression(ResultColumn.java:887)
>         at org.apache.derby.impl.sql.compile.ResultColumn.checkStorableExpression(ResultColumn.java:879)
>         at org.apache.derby.impl.sql.compile.ResultColumnList.checkStorableExpressions(ResultColumnList.java:953)
>         at org.apache.derby.impl.sql.compile.InsertNode.bindStatement(InsertNode.java:456)
>         at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:324)
>         at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:90)
>         at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:828)
>         at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(EmbedPreparedStatement.java:130)
>         ... 23 more
> It works fine using ClientDriver.
> Sample code and configuration files are attached.

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