apache > db
Apache DB Project
 
Font size:      

Apache Derby 10.2.1.6 Release

Distributions

Use the links below to download a distribution of Apache Derby from the archives. You should always verify the integrity of distribution files downloaded from a mirror.

There are four different distributions:

  • bin distribution - contains the documentation, javadoc, and jar files for Derby.
  • lib distribution - contains only the jar files for Derby.
  • lib-debug distribution - contains jar files for Derby with source line numbers.
  • src distribution - contains the Derby source tree at the point which the binaries were built.

db-derby-10.2.1.6-bin.zip [PGP] [MD5]
db-derby-10.2.1.6-bin.tar.gz [PGP] [MD5]

db-derby-10.2.1.6-lib.zip [PGP] [MD5]
db-derby-10.2.1.6-lib.tar.gz [PGP] [MD5]

db-derby-10.2.1.6-lib-debug.zip [PGP] [MD5]
db-derby-10.2.1.6-lib-debug.tar.gz [PGP] [MD5]

db-derby-10.2.1.6-src.zip [PGP] [MD5]
db-derby-10.2.1.6-src.tar.gz [PGP] [MD5]

There are two separate Eclipse plugins for Derby:

  • derby_core_plugin - provides the Derby jar files to other plugins in Eclipse.
  • derby_ui_plugin - provides an Apache Derby Nature in Eclipse for easy database application development.

derby_core_plugin_10.2.1.452058.zip [PGP] [MD5]
derby_ui_plugin_1.1.0.zip [PGP] [MD5]

Please note: both plugins must be installed for full functionality. For information on installing and using the Derby plugins for Eclipse, please see the Using the 10.2 Core and 1.1 UI Derby plug-ins page.

Release Overview

These notes describe the difference between Derby release 10.2.1.6 and the preceding release 10.1.3.1.

Derby is a pure Java relational database engine using standard SQL and JDBC as its APIs. 10.2.1.6 is a feature release.

The following improvements distinguish 10.2.1.6 from 10.1.3.1:

  • Tools
    • The ij sql interpreter now has command-line help and two new commands: show tables and describe.
    • The ij connect statement now works in the J2ME/CDC environment.
    • Tools can now be invoked without specifying a classpath just by typing java -jar derbyrun.jar toolName.
  • Security
    • Databases can now be re-encrypted. See DERBY-1156.
    • Secure connections can now be required. See DERBY-928.
    • Support has been added for DRDA userid/password substitution. See DERBY-528.
    • SQL Standard GRANT/REVOKE support has been added for authenticated users. See the "User authorizations" section of the Developer's Guide.
  • Administration
    • New scripts have been added in the bin directory which follow Apache conventions. The scripts in the frameworks directory are deprecated and may be removed in future releases.
    • System tables have been added for access to diagnostic information previously available only through non-standard VTIs.
    • Online backup is now available through new system procedures.
    • Various Net Servlet improvements. See DERBY-117.
    • The network server now logs startup/shutdown messages to derby.log.
  • JDBC
    • The network driver now supports statement timeouts.
    • Large object streaming has been improved in the network driver.
    • The FOR UPDATE clause is no longer required when declaring an updatable ResultSet.
    • Scrollable, updatable, insensitive ResultSets are now supported.
    • Network client messages have been internationalized. See DERBY-400.
  • SQL
    • Expressions are now allowed in the GROUP BY clause.
    • Identity columns can be reset to start at a new value. Please consult documentation on the RESTART WITH clause of ALTER TABLE (found in the Reference Guide).
    • XPath/XQuery support has been improved.
    • New builtin math functions have been added and wired-in as JDBC escape functions. See the "Built-in functions" section of the Reference Guide.
    • Unary +/- are now allowed for ? parameters.
    • Optimizer overrides have been added.
    • Triggers can now call Java procedures.
    • The nullability of a column can be changed now.

For a comprehensive list of changes, consult the lists of new features and bug fixes below.

10.2.1.6 functionality includes:

  • Embedded engine with JDBC driver
  • Network Server
  • Network client JDBC driver
  • Command line tools: ij (SQL scripting), dblook (schema dump) and sysinfo (system info)

SQL support:

  • Schemas, tables, temporary tables, views, triggers, indexes, savepoints
  • Java procedures and functions
  • Standard datatypes including XML, BLOB, and CLOB
  • Sub-queries and joins
  • Primary key, foreign key, unique and check constraints
  • Referential actions
  • GRANT/REVOKE support for databases with SQL authorization.

Other features:

  • Full ACID transaction support with all four isolation levels
  • Row and table level locking
  • Configurable authentication including LDAP support
  • Import/Export
  • On-line backup and recovery support
  • Optional on-disk encryption including re-encryption of existing encrypted databases
  • Platform independent database format
  • Full support for Java 2 Security Manager

JDK/JDBC support:

  • JDK 1.3, 1.4, 1.5, and J2ME J2ME/CDC/Foundation Profile
  • JSR-169, JDBC 2.1, and JDBC 3.0 support

JDBC 4.0 Support

Derby 10.2.1.6 comes with source code for drivers which conform to a beta version of the JDBC standard, JDBC 4.0. This source code conforms to the following state of the JDBC 4.0 specification:

Due to license restrictions on the beta builds of JDK 6, Derby 10.2.1.6 does not contain compiled versions of JDBC 4.0 drivers. When run on Java SE 6, Derby 10.2.1.6 exposes the same JDBC 3.0 implementation seen when run on JDK 1.4 and 1.5. You may, however, compile Derby's JDBC 4.0 support yourself. This will let you use JDBC 4.0 features when you run Derby 10.2.1.6 on Java SE 6.

To build this optional JDBC 4.0 support yourself, please download the source distribution and consult BUILDING.txt. You may also follow a simplified set of instructions for building JDBC 4.0 support, which you may find in the "Building the Optional JDBC4 Support" section of the Derby 10.2 wiki page.

XML Support

If you intend to use any of the Derby XML operators, you must ensure that you have:

  • A JAXP parser in your classpath
  • Apache Xalan in your classpath

Apache Derby 10.2.1.6 has been tested with Xalan-Java Version 2.7.0. If you have a version of Xalan that is earlier than 2.7, the Derby XML operators may still work. However, it is possible that you will experience unexpected errors when using the Derby XML operators.

New Features

These features appear in Derby 10.2.1.6 but not in the preceding release 10.1.3.1.

Master JIRANew Feature
DERBY-31Statement.setQueryTimeout() support
DERBY-117Improvements on the NetServlet
DERBY-119ALTER TABLE change nullability
DERBY-239Online backup
DERBY-231FOR UPDATE clause
DERBY-326Improve Network Server large object streaming
DERBY-400Network client message strings not internationalized
DERBY-464Grant Revoke
DERBY-475New functions: ACOS, ASIN, ATAN, COS, SIN, TAN, PI, DEGREES, RADIANS, EXP, LN, LOG, LOG10, CEIL, CEILING, FLOOR
DERBY-506Client timeout mechanism
DERBY-515Network Server should log server start and shutdown time to derby.log
DERBY-551Invoke Java procedures from triggers
DERBY-528DRDA USRSSBPWD Security Mechanism
DERBY-571New syntax for invoking diagnostic VTIs
DERBY-573Optimizer directives
DERBY-582Unary plus/minus for parameters
DERBY-592New JDBC escape functions: ACOS, ASIN, ATAN, COS, SIN, TAN, PI, DEGREES, RADIANS, EXP, LOG, LOG10, CEILING, FLOOR
DERBY-597Enhance ij connect statement to work in J2ME/CDC/FP
DERBY-688Xml support for XPath
DERBY-690Scrollable Updatable ResultSet
DERBY-783Identity value restart
DERBY-883Enhance GROUP BY clause to support expressions
DERBY-928Restrict client connections,derby.drda.securityMechanism
DERBY-1019Simplify tool invocation
DERBY-1032Scripts adhering to Apache's conventions
DERBY-1156Database re-encryption
DERBY-1164'show tables' and 'describe' commands in ij
DERBY-1216Command line help for ij

Bug Fixes

List the bugs fixed by this release. These are bug fixes which turn up in Derby 10.2.1.6 but not in the preceding 10.1.3.1 release.

Issue IdDescription
DERBY-23just booting jdbc driver and shutting down seem to leak memory
DERBY-137Derby metadata always returns JDBC 2 result sets, even when JDBC 3 result sets are required.
DERBY-147ERROR 42X79 not consistant ? - same column name specified twice
DERBY-156Delete with alias on column fails
DERBY-171Need Correlation ID in UPDATE/DELETE statements
DERBY-176Derby throws ERROR XBCM1: Java linkage error thrown during load of generated class org.apache.derby.exe.aced07c066x0102xca87x3319x00004aa5686e1 during execution of large query
DERBY-213ResultSet.next() after last row of FORWARD_ONLY cursor throws an SQL Exception with Network Server
DERBY-231"FOR UPDATE" required for updatable result set to work
DERBY-253Client should throw not implemented exception for depricated setUnicodeStream/getUnicodeStream
DERBY-254SQLStates for SQLExceptions thrown from the client should not be null and should match embedded where possible
DERBY-304If by mistake you give he location for the db backup as the db itself , then windows created directories recursively until windows crashes!
DERBY-333Malformed if statement in org.apache.derby.impl.drda.Database.getDRDAStatement()
DERBY-336The wrong overload of StandardException::newException() is used in some cases
DERBY-349setByte() with executeBatch causes hang with client if mapping is invalid, e.g. setByte to DATE
DERBY-352Clobs on insert using streams should not instantiate into memory
DERBY-353It is desirable to have IDENTITY_VAL_LOCAL() function return last recent user specified value or system generated value for BY DEFAULT identity columns.
DERBY-404org.apache.derby.iapi.store.access.RowUtil.isRowEmpty has (never exercised) bug
DERBY-412Connection toString should show type information and the meaning of the identifier that it prints
DERBY-418outofmemory error when running large query in autocommit=false mode
DERBY-427An error message when running in XA environment says cloudscape.LOG rather than derby.log
DERBY-428NetworkClient PreparedStatement.executeBatch() hangs if batch is too large (ArrayIndexOutOfBoundsException in Network Server)
DERBY-438Update triggers on tables with BLOB and CLOB columns fail at execution time if the triggered-SQL-statement references the LOB column(s).
DERBY-445Client data sources lose the value of the connectionAttributes property when they are stored using the Reference interface
DERBY-446Client data source implementations cause security exception on storage to/from a Reference object
DERBY-471DatabaseMetaData.getXXXFunctions() methods return incorrect values.
DERBY-479Passing the return of a RETURN NULL ON NULL INPUT function to another function call throws linkage error.
DERBY-483Error message X0X07 has incorrect property name, db2j.database.classpath instead of derby.database.classpath
DERBY-501Client and embedded drivers differ on invoking a procedure that returns a single Dynamic resultSet using CallableStatement.executeQuery()
DERBY-517ResultSet - relative(int rows) behaves different in embedded and client/server mode when the positioning before the first row or after the last row.
DERBY-523Non logged operation that starts before the log archive mode is enabled can not be recovered during rollforward recovery.
DERBY-525getAsciiStreamshould replace non-ASCII characters with 0x3f, '?' to match embedded
DERBY-536The current build.properties for the Derby Help Plug-in for Eclipse does not work for creating a deployable plug-in
DERBY-541Read-only databases fail to boot after soft upgrade. Raises error message: 40XD1: Container was opened in read-only mode.
DERBY-555Unable to restart after disk is full
DERBY-567Improve Derby XML support to use XML parser found in JVM instead of using a hard-coded parser name (Xerces).
DERBY-569Derby network server is printing connection activity on System.out instead of logging it to derby.log
DERBY-578Grouped select from temporary table raises null pointer exception in byte code generator
DERBY-579Query timeout set for one statement may affect other statements with the same SQL string
DERBY-582Dynamic parameter should be allowed to be the operand of unary operator "-". Derby throws exception 42X36: The '-' operator is not allowed to take a ? parameter as an operand."
DERBY-592Expand table driven system function defintion added in DERBY-475 to allow definition of JDBC escaped functions.
DERBY-596jdbcapi/resultsetStream.java fails in DerbyNetClient Framework
DERBY-599Using setBlob interface, should not materialize the entire blob value into memory.
DERBY-609Returning ByteArrayInputStream from ResultSet is not appropriate
DERBY-611Network client: updateRow() causes a commit when autoCommit = true
DERBY-622sysinfo incorrectly requires permission on Derby jar files
DERBY-634Subquery materialization can cause stack overflow
DERBY-635Client socket connection doesn't report real socket exception
DERBY-648ij 'show connections' statement does not work in JSR169
DERBY-655getImportedKeys returns duplicate rows in some cases
DERBY-660CREATE PROCEDURE incorrectly allows the RETURNS NULL ON NULL INPUT clause
DERBY-694Statement exceptions cause all the connection's result sets to be closed with the client driver
DERBY-707providing RowLocation for deleted+purged row to GenericConglomerateController causes nullpointerexception
DERBY-709SecurityException thrown when passing a relative path name when backing up database
DERBY-714NullPointerException or ClassCastException if UPDATE or DELETE is performed on a diagnostic VTI
DERBY-718Network client: deleteRow() makes getter methods return nulls for the following rows.
DERBY-721State of InputStream retrieved from resultset is not clean , if there exists previous InputStream .
DERBY-730SQL statements that fail to parse remain in the statement cache.
DERBY-732ERROR XBCM1: Java linkage error thrown during load of generated class for query with large number of logical operators and substitution parameters.
DERBY-733Starvation in RAFContainer.readPage()
DERBY-756OutOfMemory Error on continous execution of select statement using COUNT() and DISTINCT on same connection
DERBY-781Materialize subqueries in select list where possible to avoid creating invariant resultsets many times.
DERBY-782Improvement on org.apache.derby.impl.jdbc.EmbedBlob#length()
DERBY-786Casting to a CLOB value does not truncate.
DERBY-787cursor closed as a sideeffect of closing another cursor with the same name on another connection
DERBY-802OutofMemory Error when reading large blob when statement type is ResultSet.TYPE_SCROLL_INSENSITIVE
DERBY-818Read-only embedded ResultSets incur performance penalty due to updateable ResultSet code.
DERBY-821Client driver: Implicitly close exhausted result sets on the server
DERBY-826sysinfo does not report the version of derby.jar if the class does not explictly contain it.
DERBY-836ResultSetMetaData.getColumnDisplaySize sometimes returns wrong values for DECIMAL columns
DERBY-876DatabaseMetaData.getSchemas() is not JDBC 3.0 compliant
DERBY-915EmbedDatabaseMetadata, EmbedDatabaseMetadata40, and client.net.NetDatabaseMetadata40 should not throw a "not implemented" exception
DERBY-922getSQLException() method in client.am.SqlException does not correctly chain exceptions
DERBY-939NullPointerException at ResultSet.close() time for simple query using UNION and INTERSECT
DERBY-959Allow use of DRDA QRYDTA block sizes greater than 32K
DERBY-965DatabaseMetadata method supportsResultSetConcurrency returns wrong result on network client
DERBY-982sysinfo api does not provide genus name for client
DERBY-992A corner case bug and missing optimization in ScrollInsensitiveResultSet
DERBY-1000For LDAP authentication: derby.authentication.server should support ldaps:// as part of the server url.
DERBY-1043Invalid column references are not caught in a trigger action statement when the referencing table of the column is the triggered table
DERBY-1060ResultSet methods should throw exception when the ResultSet is closed
DERBY-1064Delete cascade causes NULL values inserted into table when after delete Trigger fires
DERBY-1080Connection reset when using security mechanism=EUSRIDPWD results in protocol error.
DERBY-1087Updatable result sets behave different depending on the type of query used to generate the result set
DERBY-1095Closing an embedded connection does not seem to close associated EmbedStatements
DERBY-1113transaction logs files requried for recovery are getting deleted when backup and checkpointas are running in parallel.
DERBY-1117SQLException can lose stacktrace in some cases.
DERBY-1119Creating a schema with DumpParseTree, DumpBindTree properties set causes NullPointException.
DERBY-1142Metadata calls leak memory
DERBY-1172incorrect error message in updateRow() after a commit on a held scroll insensitive resultset
DERBY-1177updateObject with null as argument causes network driver to fail with NullPointerException
DERBY-1183Client java.sql.ResultSet.getCursorName() does not return the correct cursor name for Statements after the first execution
DERBY-1184'CallableStatement.registerOutParameter(int,int,String)' does nothing in client driver
DERBY-1190Network Server reports wrong product name when logging connections to derby.log
DERBY-1196Network server closes prepared statements prematurely if exception occurs during OPNQRY and can cause "'Statement' already closed" exception on reexecution
DERBY-1202SQLState DATA_SQLDATA_READ_INSTANTIATION_EXCEPTION has no message associated with it
DERBY-1234Verify that we raise SQLException when calling methods on closed java.sql objects
DERBY-1236Verify that applications can't manipulate the transaction state while inside a distributed transaction.
DERBY-1241When booting a database under security manager, boot may fail with message java.sql.SQLException: Java exception: 'access denied (java.io.FilePermission for logmirror.ctrl if database was not shutdown cleanly after previous access
DERBY-1249cursor operation conflict incorrectly handled in scrollable updatable resultsets
DERBY-1251cancelRowUpdates() affects rows updated with updateRow() in scrollable updatable resultsets
DERBY-1258Wrong value returned in a row trigger action statement if the table has column names that are identical when upper-cased.
DERBY-1266Client: Attempted deleteRow or updateRow while on insert row gives wrong error message
DERBY-1274Network Server does not shutdown the databases it has booted when started and shutdown from the command line
DERBY-1276Calling ResultSet.isLast() on a scrollable insensitive resultset, causes the entire ResultSet to be populated
DERBY-1277Call to rs.isLast() may cause rs.getXXX() return values from the last row instead of the current row in scrollable resultsets
DERBY-1279Bad column name in DatabaseMetaData.getColumns()
DERBY-1292ClassCastException in ClientDriver when using CLOB columns and batch updates
DERBY-1295Result sets of type TYPE_SCROLL_INSENSITIVE should not implicitly close due to positioning in autocommit mode
DERBY-1296Setting property derby.system.bootAll causes an Exception
DERBY-1304DROP view does not always completely remove view
DERBY-1313SUR: Use DRDA's extended diagnostic to send ROW_UPDATED and ROW_DELETED warnings.
DERBY-1314Differences between client and embedded when invoking stored procedures using Statement.executeUpdate()
DERBY-1322Missing resets of isOnInsertRow state in net client when navigating away via other than ResultSet#next
DERBY-1323Detectability methods rowUpdated, rowInserted, rowDeleted can be called from illegal states in both clients
DERBY-1326Network server may abandon sessions when Derby system is shutdown and this causes intermittent hangs in the client
DERBY-1356Positioned update/delete when positioned after last or before first causes NullPointerException
DERBY-1357Short-circuit logic in optimizer appears to be incorrect...
DERBY-1361positioned updates and deletes allowed after a commit without repositioning the cursor - if the table is indexed on the columns selected
DERBY-1364Client driver does not roll back the effects of a stored procedure when incorrectly invoked by executeQuery()/executeUpdate()
DERBY-1373Encrypted databases cannot be booted using the jar subprotocol (and possibly also using http/https/classpath)
DERBY-1382client: lobs fails silently with result sets of type TYPE_SCROLL_INSENSITIVE
DERBY-1384Increase default BLOB/CLOB length to maximum supported (2G?)
DERBY-1393PreparedStatement.setObject(int,Object,int) should throw SQLFeatureNotSupportedException for unsupported types
DERBY-1395Change the client SQLState to match that of embedded for the exception thrown on a closed statement whose connection is also closed
DERBY-1396ReEncodedInputStream may fail to read all of source Reader.
DERBY-1421ResultSet.updateBinaryStream fails when the result type is TYPE_SCROLL_INSENSITIVE
DERBY-1464runtimestatistics can show that an index is being used even when it isn't
DERBY-1473Add cut-off and truncation logic to streaming classes in the embedded driver
DERBY-1476PreparedStatement.setNull(int,int) should throw SQLFeatureNotSupportedException for unsupported types
DERBY-1481Client driver: ResultSet.beforeFirst() gives protocol error on scrollable, updatable result sets that are downgraded to read-only
DERBY-1493EmbeddedDriver does not implement PreparedStatement.setNull(int, int, String)
DERBY-1500PreparedStatement#setObject(int parameterIndex, Object x) throws SQL Exception when binding Short value in embedded mode
DERBY-1510'SQLBinary.readFromStream' can enter endless loop
DERBY-1533ArrayIndexOutOfBoundsException in DDMReader, on a specific data size
DERBY-1547Add svn version number to DatabaseMetaData getDatabaseProductVersion and getDriverVersion() to improve supportability
DERBY-1554IDENTITY_VAL_LOCAL() returned value is modified incorrectly by a multi-row INSERT statement.
DERBY-1571NetworkServerControlImpl.consoleExceptionPrintTrace() prints stack trace even when logWriter is null
DERBY-1574NullPointerException in UPDATE with COALESCE and subquery
DERBY-1586The attributesAsPassword property doesn't work correctly with EmbeddedConnectionPoolDataSource
DERBY-1587INTEGER function cannot be abbreviated
DERBY-1589CREATE TABLE throws NullPointerException in Derby SQL Standard Authorization after DROPs and REVOKES
DERBY-1619Sysinfo in 10.2 shows multiple entries if the derby jars reside in a directory with spaces in its name
DERBY-1621Trigger action statement is not recompile when there is a change that would affect it.
DERBY-1633Regression: The fields of views are not being calculated properly since 10.1.2.4
DERBY-1652Update trigger updating the same rows as the original update does not throw an exception ERROR 54038: "Maximum depth of nested triggers was exceeded" as it should
DERBY-1660SYSCS_BULK_INSERT fails with syntax error at PROPERTIES clause.
DERBY-1661Create index on large tables fails with too many open files , FileNotFoundException.
DERBY-1675Network Server should not send to client that it supports EUSRIDPWD when running against Sun JVM
DERBY-1681Regression (wrong results): Join predicate can be ignored for left-most child in a chain of nested unions.
DERBY-1692Client driver does not use the query timeout value set using Statement.setQueryTimeout() for subsequent executions using the same statement object
DERBY-1706NullPointerException occurs when trying to create a table in schema SESSION
DERBY-1707Specifying an incorrect optimizer property (constraint=null) gives NullPointerException
DERBY-1708Unprivileged user can perform lock table statement on a table which he/she does not have any access rights
DERBY-1714huge single insert statements fail with JVM error due to size of generated method
DERBY-1756Revert change in client that defaults the secmec to eusridpwd.
DERBY-1767insertRow(), updateRow() and deleteRow() cannot handle table names and column names containing double quotes
DERBY-1777Regression: query works in 10.1.2.1 but fails with NullPointerException in 10.2.1.1
DERBY-1784When qualifying a column name with its synonym name in the select list, Derby throws SQLSTATE 42X04.
DERBY-1786a crash during re-encryption of an existing database with lot of tables can make database unrecoverable on a next boot.
DERBY-1809Built-in functions not working in views.
DERBY-1811Embedded ResultSet.getTimestamp on a TIME column returns a java.sql.Timestamp with a date portion that can be incorrect.
DERBY-1817Race condition in network server's thread pool
DERBY-1854SYSCS_COMPRESS_TABLE corrupts table with a single column which is both a primary key and a foreign key
DERBY-1858A schema can be dropped by a non-schema owner in SQL authorization mode
DERBY-1866Assert failure in sane mode for queries that used to work in 10.1.2.1
DERBY-1891error 58009.C.19 refers to non-existent codepoint secktn - needs correcting
DERBY-1900The scripts under the /bin of the distribution does not have the executable permission

Issues

Please be aware of the following issues:


DERBY-253

Problem

PreparedStatement.setUnicodeStream() and ResultSet.getUnicodeStream() throw SQLException when invoked after upgrading to Apache Derby 10.2.

Symptoms

Calling either of these methods will result in an exception with SQLSTATE 0A000 and message: "Feature not implemented: ..."

Cause

PreparedStatement.setUnicodeStream() and ResultSet.getUnicodeStream() have been deprecated since JDBC 2.0. Derby's implemetation of these methods was broken, and it was decided that the methods should throw a not-implemented exception instead of being fixed.

Solution

This was an intentional change. No Derby product solution is offered.

Workaround

Use setCharacterStream() and getCharacterStream() instead of setUnicodeStream() and getUnicodeStream().


DERBY-668

Problem

Sysinfo classpath information was insufficiently detailed.

Symptoms

Sometimes it was hard to tell where the Derby classes were actually being loaded from in the JVM.

Cause

The algorithm that sysinfo used for analyzing and reporting on the application classpath was not robust.

Solution

The sysinfo tool now prints additional information about the origin of the classes and jars that it examines. The origin of a class might be: an entry in the application classpath, an entry in a class loader location list, a jar fetched due to being listed in the manifest entry of another jar, a standard extension in the JRE's extensions directory, a jar installed into the application server, or any of various other possibilities.

Workaround

No workaround. The behavior is now correct.


DERBY-721

Problem

Undefined results were returned to an application which opend an InputStream twice on the same column of a ResultSet.

Symptoms

The value siphoned out of the column was erratic.

Cause

Streams were being shared between the two readers.

Solution

Now we throw an exception if the application tries to open two streams on the same column in a ResultSet.

Workaround

Users must recode Applications which open multiple streams on the same column.


DERBY-781

Problem

When optimizing a query that has one or more non-flattenable subqueries in the FROM clause, Derby will now check to see if it is possible to perform a hash join with that subquery as the inner table. Prior to Derby 10.2, the optimizer would never consider a hash join with a subquery; it only did nested loop joins.

Symptoms

Execution performance of queries containing non-flattenable subqueries may change. The expectation is that the new (10.2) query plans will show improved performance over the old ones.

Another potential symptom is that the compilation time for such queries may increase. If this happens, the increase should only occur at compilation time; execution time should either improve or, at the very least, remain the same as in earlier versions of Derby.

Cause

If the optimizer chooses to do a hash join with a subquery, Derby only has to execute the subquery a single time per statement, after which Derby can just perform the desired join against the materialized result set. Depending on how many rows are in the outer table of the join, this once-per-statement execution of the subquery can lead to major performance improvements over the once-per-outer-row execution employed by earlier versions of Derby.

As for the extra compilation time, this is due to the simple fact that the optimizer is now doing more work--i.e. in addition to considering nested loop joins with subqueries, it is now _also_ considering hash joins with those subqueries, and that means that it could potentially take longer for the optimizer to finish its work. Note again that, if it occurs, the increased time should only occur at compilation time; execution time should either improve or, at the very least, remain the same as in earlier versions of Derby.

Solution

This was an intentional change to improve the execution plans chosen by the optimizer for queries having large and/or complex subqueries. The expectation is that the new behavior--and the subsequent query plans--will lead to improved performance over the old ones, so no further solution is required.

Workaround

There is no way to disable/workaround this new behavior since the symptom as described above is a good one for Derby.

That said, any user who notices a negative performance change after moving to Derby 10.2, and who believes that the difference in performance is related to this optimizer enhancement, is encouraged to visit the performance diagnosis page and to follow up with his/her findings on the Derby mailing lists.


DERBY-822

Problem

Queries may fail earlier and locks may be acquired earlier when executing queries. Location where errors occur in an embedded environment is different from the location where errors occur in a network environment.

Symptoms

Errors that happen as part of the normal execution path are moved earlier. For example, code to execute a query, with executeQuery() retrieve the result set metadata and then perform a next() might fail with a lock timeout on executeQuery() instead of next(). Locking changes are observed.

Cause

Pre-fetching moves execution of retrieval of data earlier for network client/server configurations.

Solution

This was an intentional behavior change to improve performance. No Derby product solution is offered.

Workaround

Application code needs to be changed to adjust error handling if needed.


DERBY-1130

Problem

Derby's client DataSources were using a wrong database name when getting a connection in the following case:

  • databaseName is not set as a Derby DataSource property
  • databaseName is set as a connection attribute using setConnectionAttributes method

Symptoms

Instead of throwing an exception saying databaseName is a required Derby DataSource property and must be set, client driver was using "null" as database name and returning a connection to database named "null".

Cause

The database name was constructed wrongly in the client driver.

Solution

This was solved by setting the internal database name property in the client driver correctly. Also ensured that databaseName set as a connection attribute will not be used by Derby's client DataSources.. This fix will be available in Derby versions 10.2 and above.

Workaround

If using release prior to version 10.2, make sure database name is set only as a DataSource property when using Derby's client DataSources.


DERBY-1295

Problem

Result sets of type TYPE_SCROLL_INSENSITIVE used to implicitly close when positioned at the end in autocommit mode.

Symptoms

Calling the ResultSet.next() method when positioned on the last row of a result set of type SCROLL_INSENSITIVE in auto commit mode used to cause the result set to be closed.

Cause

The JDBC specification allows a JDBC driver to implicitly close a ResultSet when the ResultSet type is TYPE_FORWARD_ONLY and the next method of ResultSet returns false. Derby also used to implicitly close result sets of type SCROLL_INSENSITIVE when the ResultSet.next() method returns false in auto commit mode.

Solution

The behavior of SCROLL_INSENSITIVE result sets in auto commit mode has been changed to comply with the JDBC4 specification. SCROLL_INSENSITIVE result sets are not implicitly closed when calling the ResultSet.next() method in auto commit mode while positioned on the last row.

Workaround

Fix applications which rely on the previous, non-standard behavior.


DERBY-1314

Problem

The behaviour of executeQuery() and executeUpdate() did not match the JDBC specification when invoking stored procedures.

Symptoms

  • When invoking a stored procedure with executeQuery() or executeUpdate(), an exception was thrown indicating that the procedure did not return the correct number of ResultSet objects, although the correct number of ResultSet objects was in fact returned.
  • When invoking a stored procedure with executeQuery() or executeUpdate(), and the procedure did not return the correct number of ResultSet objects, the query executed successfully.
  • With the network client driver, when invoking a stored procedure with executeUpdate(), the return value was -1, whereas the JDBC specification says it should be 0.

Cause

The methods executeQuery() and executeUpdate() were not implemented in compliance with the JDBC specification.

Solution

In Derby 10.2, the behaviour of the methods executeQuery() and executeUpdate() has been changed to match the JDBC specification.

Workaround

Use execute() instead of executeUpdate()/executeQuery() to invoke a stored procedure which does not return exactly 0 or 1 ResultSet objects.


DERBY-1323

Problem

For a JDBC ResultSet with type TYPE_FORWARD_ONLY, the methods rowUpdated, rowDeleted and rowInserted could previously be called while not on a row, i.e. before positioning in the result set, while on insertRow, after updateRow before new positioning, after deleteRow before new positioning and when after last row. This is now disallowed.

Symptoms

Calls to any of these methods while not on a row will now throw SQLException with SQLState 24000.

Cause

Derby now disallows these calls when not on a row.

Solution

Change the application to not call these methods unless on a row. Note that using them at all is rather meaningless for a ResultSet of type TYPE_FORWARD_ONLY since the returned result will always be 'false'. This is because once you modify a row, it can no longer be accessed, you need to move to the next row, if there is one, to get a new current row. Presently in Derby, these methods are only really meaningfully used for result sets of type TYPE_SCROLL_INSENSITIVE and of concurrency CONCUR_UPDATABLE in which case updated and deleted rows can be detected.

Workaround

Fix applications which rely on this non-standard behavior.


DERBY-1357

Problem

The optimizer will now abandon sub-optimal join orders as soon as it realizes that they cost more than the best join order so far.

This fix also ensures that, in the case of short-circuited join orders, Derby will still generate (and execute) an overall plan that matches the "best path" decisions made by the optimizer--which was not always the case prior to these changes.

Symptoms

Execution performance of large queries (esp. those with nested subqueries and/or with large FROM clauses) may change. The expectation is that the new (10.2) query plans will show improved performance over the old ones.

Cause

Since the optimizer is now spending less time evaluating sub-optimal join orders, it is possible that it will be able to try out more join orders before optimizer "timeout" occurs. As a result the optimizer can sometimes find better plans than it did in earlier versions of Derby.

Solution

This was an intentional change to fix behavior that was not working correctly in earlier versions of Derby. The expectation is that the new behavior--and the subsequent query plans--will lead to improved performance over the old ones, so no further solution is required.

Workaround

There is no way to disable/workaround this new behavior since the symptom as described above is a good one for Derby.

That said, any user who notices a negative performance change after moving to Derby 10.2, and who believes that the difference in performance is related to this optimizer change, is encouraged to visit the performance diagnosis page and to follow up with his/her findings on the Derby mailing lists.


DERBY-1384

Problem

Default BLOB/CLOB length should be the maximum length supported by Derby (2G-1)

Symptoms

An application that used BLOB will current reject values greater than 1M, changing the default means the application will now silently accept those values.

Cause

The allowable size of Derby LOBs has been increased.

Solution

This was an intentional change to make Derby conform to its own documentation.

Workaround

Fix applications which rely on Derby rejecting LOBs that are bigger than 1M.


DERBY-1621

Problem

Trigger action statement is not recompile when there is a change that would affect it.

Symptoms

(1) Trigger action such as an INSERT statement does not get recompiled when the underlying table is affected by a CREATE or DROP INDEX statement. e.g.:

         create table t (i int);
         create table t2 (i int);
         create trigger tt after insert on t for each statement mode db2sql insert into t2 values 1;
         insert into t values 1;
         select * from t2;
         create unique index tu on t2(i);
         insert into t values 1;
         select * from t2;
         insert into t values 1;
         1 row inserted/updated/deleted

The above example creates an unique index on table t2. when the trigger is fired, it did not raise an unique constraint error.

(2) When the trigger action statement underlying view gets dropped, the trigger statement did not get recompiled. e.g.:

         create table t11 (c111 int not null primary key, c112 int);
         insert into t11 values(1,1);
         insert into t11 values(2,2);
         create view v21 as select * from user1.t11;
         create table t31 (c311 int);
         create table t32 (c321 int);
         create trigger tr31t31 after insert on t31 for each statement mode db2sql insert into t32 values (select c111 from user1.v21 where c112=1);
         insert into t31 values(1);
         select * from t31;
         select * from t32;
         drop view v21;
         insert into t31 values(1);

In the above example, a view which the trigger action references is dropped; however, the last SQL INSERT statement did not throw an error.

(3) Conglomerate does not exist occurs in a specific case after dropping a table referenced by a trigger. The trigger action is not being recompiled and raises SQLSTATE XSAI2 even though the table being dropped was recreated again. e.g.:

         create table t1 (id int, name varchar(20));
         create table t2 (id int);
         create trigger test_trigger after insert on t2 for each row mode db2sql insert into t1 values(100, 'hundred');
         insert into t2 values(1);
         insert into t2 values(1);
         select * from t1;
         drop table t1;
         insert into t2 values(1);
         create table t1 (id int, name varchar(20));
         insert into t2 values(1);

In the above example, a table which the trigger action references is dropped. The last INSERT statement should execute successfully but it raises SQLSTATE XSAI2: The conglomerate (896) requested does not exist.

Cause

Derby did not perform invalidation of the trigger action when object(s) that the trigger references are modified or dropped; hence, resulting in the stated problem above. The affected versions are Derby 10.0 and 10.1.

Solution

A fix to resolve the above Derby symptoms is available in 10.2.

Workaround

None.


DERBY-1652

Problem

In some cases, an after update trigger does not get fired upon itself when its trigger action contains an update statement on the trigger's subject table.

Symptoms

(1) When defining a trigger for the first time for a table, e.g.:

  
        CREATE TABLE "TEST" ("TESTID" INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1),
                             "INFO" INTEGER NOT NULL,
                             "TIMESTAMP" TIMESTAMP NOT NULL DEFAULT '1980-01-01-00.00.00.000000');
    
        CREATE TRIGGER UPDATE_TEST
        AFTER UPDATE ON TEST
        REFERENCING OLD AS OLD
        FOR EACH ROW MODE DB2SQL
            UPDATE TEST SET TIMESTAMP = CURRENT_TIMESTAMP WHERE TESTID = OLD.TESTID;
  
        INSERT INTO TEST (INFO) VALUES (1), (2), (3);

        UPDATE TEST SET INFO = 1 WHERE TESTID = 2;

The above update statement executes successfully which it is incorrect. The system should have issued SQLSTATE 54038 since it self-triggers to its maximum depth of 16.

(2) With the above example, when an user upgrades to a higher version and issues the same update statement:

        UPDATE TEST SET INFO = 1 WHERE TESTID = 2;
        ERROR 54038: Maximum depth of nested triggers was exceeded.

The SQLSTATE 54038 is issued in this case because after database upgrade, the trigger action will be invalidated by the system and will force a recompilation of the trigger when it is fired. The system generates the correct execution plan this time and since the trigger behavior have changed, this might cause applications to break unexpectedly.

Cause

Derby's did not generate the correct execution plan for self-trigger invocation when such a trigger is declared for the first time on the subject table; hence, resulting in the stated problem above. The affected version is Derby 10.0 and 10.1.

Solution

A fix to resolve the above Derby symptom is available in 10.1 and 10.2. thrown now.

Workaround

If self-trigger invocation was not intended by the application, the application can select which column(s) on the update statement can cause the trigger to fire in the CREATE TRIGGER statement. i.e.:

   CREATE TRIGGER update_test
   AFTER UPDATE OF INFO ON test
   REFERENCING OLD AS old
   FOR EACH ROW MODE DB2SQL
       UPDATE test SET timestamp=current_timestamp WHERE testid=old.testid;

In the above statement, the trigger will only fire when an update is made to the "info" column instead of any column(s).


DERBY-1867

Problem

With IBM 1.4.1 JVM, trying to connect to the server using the derby client with security mechanism 8 (USRSSSBPWD) will result in error.

Symptoms

Connecting using the client driver with security mechanism 8 will throw the following error ERROR XJ112: Security exception encountered, see next exception for details. The stack trace will show that the problem is caused by java.security.NoSuchAlgorithmException: SHA1PRNG SecureRandom not available

Cause

Current USRSSBPWD implementation uses SHA1PRNG algorithm to generate random number(seed) that gets exchanged between client and the server. The SHA1PRNG algorithm is not available with the JCE provider that comes with IBM JVM version 1.4.1.

Solution

You must use another JCE provider.

Workaround

If you need to use the security mechanism 8, then make sure that support for SHA1PRNG is available in the JCE provider that is available with a particular JVM. For e.g. Use IBM 1.4.2 JVM that has support for SHA1PRNG or the Sun JVMs.

Build Environment

Derby release 10.2.1.6 was built using the following environment:

  • Branch - Source code came from the 10.2 branch.
  • Machine - Cygwin on Microsoft Windows XP Professional Version 2002 Service Pack 2.
  • Ant - Apache Ant version 1.6.5 compiled on June 2 2005.
  • JDK 1.4 - Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_08-b03).
  • JDK 1.3 - Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_16-b06).
  • JDK 1.6 - The optional JDBC4 drivers were not compiled.
  • OSGi - The osgi.jar was used to build org.apache.derby.osgi.EmbeddedActivator.
  • Compiler - The 1.4.2_08-b03 javac was used to compile all classes.
  • JSR 169 - J2ME support was built using java.sun.com/j2me (j2me_cdc_fp-1_0_2).

Testing

Tests were run on the following platforms. Results are listed separately for each platform.

Type testplatform, jvm versionby:
derbyall suiteSolaris 10 x86 using JDK 6 (rc build 100)John Embretsen
derbyall suiteSolarisKnut Anders Hatlen
derbyall suiteBSDKnut Anders Hatlen
derbyall suiteBSDKnut Anders Hatlen
derbyall suiteRHEL4.0 (Linux 2.6.9-34.ELsmp, Sun JDK 1.4.2_08-b03)Rick Hillegas
derbyall suiteSLES 10.0 Kernel 2.6.16.21-0.15-bigsmp #1 SMP - ibm142 and ibm15Rajesh Kartha
derbyall suiteRHEL 4.0 ES Kernel 2.6.9-42.0.2.ELsmp on an i686 - ibm15 (-Xjit:count-0)Rajesh Kartha
derbyall suiteAIX with ibm15 (Xjit:count=0)Manjula G. Kuty
derbyall suite with the 10.2.1.5 RCibm142 and ibm15Manjula G. Kuty
derbyall suite-Mike Matrigalli
derbyall suiteWindows XPYip Ng
derbyall suiteHP-UX 11.11Vemund Ostgaard
derbyall suiteHP-UX v1.11 i, HP 1.5.0.03Vermund van de Scheur
derbyall suiteRHAS 4 64-bits (lin), Sun 1.4.2, 1.5.0_04, 1.6.0-rcHenri van de Scheur
derbyall suiteRHAS 3 64-bits (linN-1), Sun 1.4.2, 1.5.0_04, 1.6.0-rcHenri van de Scheur
derbyall suiteRHAS 4 32-bits (lin32), Sun 1.4.2, 1.5.0_04, 1.6.0-rcHenri van de Scheur
derbyall suiteSolaris 10 X86 64-bits (sol), Sun 1.4.2, 1.5.0_04, 1.6.0-rcHenri van de Scheur
derbyall suiteSolaris Nevada X86 64-bits (solN+1), Sun 1.4.2, 1.5.0_04, 1.6.0-rcHenri van de Scheur
derbyall suiteSolaris 9 X86 32-bits (solN-1), Sun 1.4.2, 1.5.0_04, 1.6.0-rcHenri van de Scheur
derbyall suiteSolaris 10 X86 32-bits (sol32), Sun 1.4.2, 1.5.0_04, 1.6.0-rcHenri van de Scheur
derbyall suiteSolaris 10 SPARC 64 bits (sparc), Sun 1.4.2, 1.5.0_04, 1.6.0-rcHenri van de Scheur
derbyall suiteSolaris Nevada SPARC 64 bits (sparcN+1), Sun 1.4.2, 1.5.0_04, 1.6.0-rcHenri van de Scheur
derbyall suiteSolaris 9 SPARC 64 bits (sparcN-1), Sun 1.4.2, 1.5.0_04, 1.6.0-rcHenri van de Scheur
derbyall suiteSolaris 8 SPARC 64 bits (sparcN-2), Sun 1.4.2, 1.5.0_04, 1.6.0-rcHenri van de Scheur
derbyall suiteWindows 2003 EE (win), Sun 1.4.2, 1.5.0_04, 1.6.0-rcHenri van de Scheur
derbyall suiteWindows 2000 as (winN-1), Sun 1.4.2, 1.5.0_04, 1.6.0-rcHenri van de Scheur
derbyall suiteWindows XP Prof (winxp), Sun 1.4.2, 1.5.0_04, 1.6.0-rcHenri van de Scheur
derbyall suiteRHEL 4.0 64-bits, IBM 1.5 (jit 0)Myrna van Lunteren
Torque tutorial: http://db.apache.org/derby/integrate/db_torque.html-Jean Andersen
lightly tested the eclipse plugins on eclipse 3.2 on fedora (added a derby nature, used ij to create and populate a database, and ran sysinfo)-Jean Andersen
DdlUtils example: http://db.apache.org/derby/integrate/db_ddlutils.html-Jean Andersen
ODBC testsDB2 Runtime Client (v8)Army Brown
long running testSolaris 10 x86 using JDK 6 (rc build 100)John Embretsen
performance tests with the 10.2.1.5 RC for both embedded and network server mode, tests included single user, multi userlinux (Suse version 9) and windows (win2k) for the IBM JVM ( 1.4.2)Sunitha Kambhampati
long running testsLinux and Windows with IBM 15 and 142Manjula G. Kuty
Signatures verified-Andrew McIntyre
large data volume testsSolaris 10 1/06 s10x_u1wos_19a X86 64bits, Sun 1.5.0 ( 1.5.0_07-b03)Ole Solberg
crashed derby engine few times when DML's are in progress, database recovered fine-Suresh Thalamati
tested scripts-Myrna van Lunteren

Several test issues were reported, such as DERBY-937(1.5), DERBY-1221(1.5), DERBY-734(1.6), DERBY-1585(1.6), DERBY-1629(1.6), DERBY-1883(1.4), but no specific code issues were noted.

Tests for a specific platform can be run using the derbyTesting.jar file that can be found in the lib directory of the -lib or -bin distributions.

Instructions on how to run the tests can be found in the testing README.

Verifying releases

It is essential that you verify the integrity of the downloaded files using the PGP and MD5 signatures. MD5 verification ensures the file was not corrupted during the download process. PGP verification ensures that the file came from a certain person.

The PGP signatures can be verified using PGP or GPG. First download the Apache Derby KEYS as well as the asc signature file for the particular distribution. It is important that you get these files from the ultimate trusted source - the main ASF distribution site, rather than from a mirror. Then verify the signatures using ...

% pgpk -a KEYS
% pgpv db-derby-X.Y.tar.gz.asc

or

% pgp -ka KEYS
% pgp db-derby-X.Y.tar.gz.asc

or

% gpg --import KEYS
% gpg --verify db-derby-X.Y.tar.gz.asc

To verify the MD5 signature on the files, you need to use a program called md5 or md5sum, which is included in many unix distributions. It is also available as part of GNU Textutils. Windows users can get binary md5 programs from here, here, or here.

We strongly recommend you verify your downloads with both PGP and MD5.