Issue Details (XML | Word | Printable)

Key: DERBY-2787
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Anurag Shekhar
Reporter: Anurag Shekhar
Votes: 0
Watchers: 0
Operations

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

make entry for clob in connection so that temporary file is removed when a connection is closed or transaction is commited/rolledback

Created: 08/Jun/07 06:25 AM   Updated: 15/Jun/07 12:36 PM
Return to search
Component/s: JDBC
Affects Version/s: 10.3.1.4
Fix Version/s: 10.3.1.4

Time Tracking:
Not Specified

File Attachments:
  Size
File Licensed for inclusion in ASF works derby-2787.diff 2007-06-08 08:01 AM Anurag Shekhar 9 kB
File Licensed for inclusion in ASF works derby-2787v2.diff 2007-06-12 06:10 AM Anurag Shekhar 8 kB
Issue Links:
Dependants
 
Reference
 

Resolution Date: 13/Jun/07 02:06 PM


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Anurag Shekhar added a comment - 08/Jun/07 06:31 AM
DERBY-2729 introduces code required to cleanup the blob and clob during commit/rollback or when connection is closed. The only missing link for clob is to add an entry in EmbeddedConnection so that free method is called on EmbedClob.

Anurag Shekhar added a comment - 08/Jun/07 08:01 AM
This patch makes a call to connection.addLobMapping to add entry in connection. Once an entry is added EmbeddedConnection takes care of calling free method hence clearing file.

please see the description of DERBY-2729 for more info able SQLState changes. This patches follows similar scheme.

modified files

java/engine/org/apache/derby/impl/jdbc/EmbedClob.java

added call to Connection.addLobMapping in constructors.
moved checking for closed connection before check for valid flag in checkValidity method. This ensures that if the clob is freed because of closed connection proper sql code is set in SQLException.
    java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ClobStoredProcedureTest.java

Modified tests to get new value for locators. As the Clob now add itself to the connection stored procedure will be getting different value for locator.
      java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/BlobClob4BlobTest.java

If a clob is accessed after commit or after free SQLException gets a SSQLState of XJ217. Updated testClobAfterCommit to check for it.

Anurag Shekhar added a comment - 12/Jun/07 06:10 AM
fixed conflicts.
I have run jdbcapi/BlobClob4BlobTest after fixing the conflicts.
I am running all suites will post about the result after its done.

Anurag Shekhar added a comment - 12/Jun/07 09:48 AM
suites.All without any problem it can be considered for review/commit

Bernt M. Johnsen added a comment - 13/Jun/07 02:06 PM
Patch reviewed and found ok.
Committed revision 546881.