Issue Details (XML | Word | Printable)

Key: DERBY-3723
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Kristian Waagan
Reporter: Kristian Waagan
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Derby

Reset current schema to default (user name) when creating a new logical connection in the client driver

Created: 16/Jun/08 10:14 AM   Updated: 04/May/09 06:21 PM
Return to search
Component/s: JDBC, Network Client
Affects Version/s: 10.1.3.1, 10.2.2.0, 10.3.3.0, 10.4.1.3
Fix Version/s: 10.4.2.0, 10.5.1.1

Time Tracking:
Not Specified

File Attachments:
  Size
File Licensed for inclusion in ASF works derby-3723-1a-client_schema_reset.diff 2008-06-20 02:13 PM Kristian Waagan 2 kB
Environment: Primarily when connection pooling and statement caching are used.

Bug behavior facts: Performance
Resolution Date: 30/Jun/08 12:43 PM


 Description  « Hide
The current schema is used as part of the lookup key for the client side JDBC statement cache. With the current implementation, the schema is explicitly fetched from the server by executing a "VALUES CURRENT SCHEMA" query after a new logical connection has been created. This hurts performance when using the JDBC statement cache, and in some cases it performs worse than running without a client side JDBC statement cache.

The performance can be improved by resetting the current schema to the default on the client when a new logical connection is created. The user name is used as the default schema in Derby.

Note that this issue is regarding logical connections. There is no API for changing the user name, or default schema, for a logical connection. This ensures the schema must be set to the associated user name for a newly created logical connection.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Kristian Waagan added a comment - 20/Jun/08 02:13 PM
'derby-3723-1a-client_schema_reset.diff' makes the client driver reset the current schema to the user name for the physical connection when a new logical connection is created.

Regression tests passed with Solaris 10 and Sun JDK 1.6.
Patch ready for review.

Kristian Waagan made changes - 20/Jun/08 02:13 PM
Field Original Value New Value
Attachment derby-3723-1a-client_schema_reset.diff [ 12384383 ]
Kristian Waagan made changes - 20/Jun/08 02:17 PM
Derby Info [Patch Available]
Repository Revision Date User Message
ASF #671128 Tue Jun 24 11:09:02 UTC 2008 kristwaa DERBY-3723: Reset current schema to default (user name) when creating a new logical connection in the client driver.
Resets the schema to the associated user name for the physical connection when creating a new logical connection (which is currently implemented as resetting the physical connection).
Also made 'Connection.user_' final.
Patch file: DERBY-3723-1a-client_schema_reset.diff
Files Changed
MODIFY /db/derby/code/trunk/java/client/org/apache/derby/client/am/Connection.java

Kristian Waagan added a comment - 24/Jun/08 11:15 AM
Committed 'derby-3723-1a-client_schema_reset.diff' to trunk with revision 671128.
Will backport to the 10.4 branch soon.

Kristian Waagan made changes - 24/Jun/08 11:15 AM
Derby Info [Patch Available]
Repository Revision Date User Message
ASF #672749 Mon Jun 30 12:36:36 UTC 2008 kristwaa DERBY-3581 / DERBY-3723: Backports.
Merged revisions 667568 and 671128 from trunk.
The former is a code clean up patch, the latter a change of behavior in the same area of the code. The variable holding the current schema in the client driver is now reset to the user name when a new logical connection is created.
Files Changed
MODIFY /db/derby/code/branches/10.4/java/client/org/apache/derby/client/am/Connection.java
MODIFY /db/derby/code/branches/10.4/java/client/org/apache/derby/client/net/NetConnection.java
MODIFY /db/derby/code/branches/10.4/java/client/org/apache/derby/client/ClientPooledConnection.java

Kristian Waagan added a comment - 30/Jun/08 12:43 PM
Backported patch 1a to the 10.4 branch with revision 672749. The commit also included some of the patches for DERBY-3581.

Kristian Waagan made changes - 30/Jun/08 12:43 PM
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
Kristian Waagan added a comment - 10/Jul/08 09:47 AM
Closing.

Kristian Waagan made changes - 10/Jul/08 09:47 AM
Status Resolved [ 5 ] Closed [ 6 ]
Rick Hillegas made changes - 04/Aug/08 08:24 PM
Fix Version/s 10.4.1.4 [ 12313112 ]
Fix Version/s 10.4.2.0 [ 12313345 ]
Myrna van Lunteren made changes - 04/May/09 06:21 PM
Fix Version/s 10.5.0.0 [ 12313010 ]
Fix Version/s 10.5.1.1 [ 12313771 ]