db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geert Bevin <gbe...@gmail.com>
Subject Embedded driver create=true problem
Date Fri, 26 Aug 2005 09:45:27 GMT
Hello,

in Derby 10.0.2.1, when you add create=true to the embedded driver's
jdbc connection url, the database is created together with the user
schema for the one that's opening the connection. Only after both are
created, the SQL command is actually executed.

It seems that this behavior changed in Derby 10.1.1.0. The database is
created, but the SQL is executed before the user schema is created.
This generates errors like this:

WARNING: com.uwyn.rife.database.exceptions.ExecutionErrorException:
Error while executing the SQL 'CREATE TABLE newsitem (id INTEGER NOT
NULL GENERATED ALWAYS AS IDENTITY, moment TIMESTAMP NOT NULL, title
VARCHAR(120) NOT NULL, PRIMARY KEY (id), CHECK (title != ''))'.
    at com.uwyn.rife.database.DbStatement.executeUpdate(DbStatement.java:646)
    at com.uwyn.rife.database.DbStatement.executeUpdate(DbStatement.java:673)
    at com.uwyn.rife.database.DbQueryManager.executeUpdate(DbQueryManager.java:173)
    at com.uwyn.rife.database.querymanagers.generic.databasedrivers.org_apache_derby_jdbc_EmbeddedDriver.install(org_apache_derby_jdbc_EmbeddedDriver.java:65)
    at com.uwyn.rife.database.querymanagers.generic.GenericQueryManagerDelegate.install(GenericQueryManagerDelegate.java:73)
    at com.uwyn.rife.jumpstart.InstallParticipant.initialize(InstallParticipant.java:33)
    at com.uwyn.rife.rep.BlockingParticipant.run(BlockingParticipant.java:250)
    at java.lang.Thread.run(Thread.java:613)
Caused by: SQL Exception: Schema 'NEWS' does not exist
    at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
    at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown
Source)
    at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown
Source)
    at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown
Source)
    at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown
Source)
    at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
    at org.apache.derby.impl.jdbc.EmbedStatement.executeUpdate(Unknown Source)
    at com.uwyn.rife.database.DbStatement.executeUpdate(DbStatement.java:638)
    ... 7 more

If you wait a while and re-issue the same SQL command afterwards, it
succeeds. I'm quite puzzled why this behavior changed, since in its
latest form it's quite useless. Any comments about this?

Thanks,

Geert

-- 
Geert Bevin                       Uwyn bvba
"Use what you need"               Avenue de Scailmont 34
http://www.uwyn.com               7170 Manage
gbevin[remove] at uwyn dot com    Tel +32 64 84 80 03

PGP Fingerprint : 4E21 6399 CD9E A384 6619  719A C8F4 D40D 309F D6A9
Public PGP key  : available at servers pgp.mit.edu, wwwkeys.pgp.net

Mime
View raw message