db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <derby-...@db.apache.org>
Subject [jira] Commented: (DERBY-790) SQLException used by the networked interface to Derby is not serializable
Date Wed, 27 Sep 2006 13:54:53 GMT
    [ http://issues.apache.org/jira/browse/DERBY-790?page=comments#action_12438128 ] 
            
Knut Anders Hatlen commented on DERBY-790:
------------------------------------------

Hi Francois,

I think the patch might be a little too simple. When sqlca_ is made
transient (and thereby null after deserialization), getMessage() could
make the message text grow. For instance, I tried to insert two rows
with identical primary keys into a table with addBatch() and
executeBatch(). When I extracted the SqlException from the
BatchUpdateException, serialized it and deserialized it, getMessage()
on the deserialized exception returned

Error for batch element #1: Error for batch element #1: The statement was aborted because
it would have caused a duplicate key value in a unique or primary key constraint or unique
index identified by 'SQL060927031919790' defined on 'T'.

Calling getMessage() a second time gave

Error for batch element #1: Error for batch element #1: Error for batch element #1: Error
for batch element #1: The statement was aborted because it would have caused a duplicate key
value in a unique or primary key constraint or unique index identified by 'SQL060927031919790'
defined on 'T'.

Each time getMessage() is called, "Error for batch element #1: " is
added to the message string.

A couple of minor comments/suggestions to the JUnit test:

  - testSerializedException() should call fail() after
    executeQuery(). Otherwise, the test succeeds if the query
    succeeds.

  - recreateSQLException() could throw Exception instead of catching
    all exceptions and calling fail(). This would make the code
    simpler, and it would preserve stack trace and nested exceptions
    if an unexpected error occurred.

  - maybe assertThrowableEquals() could be placed in BaseTestCase
    instead of BaseJDBCTestCase? It is not tied to JDBC as far as I
    can see.

Thanks.

> SQLException used by the networked interface to Derby is not serializable
> -------------------------------------------------------------------------
>
>                 Key: DERBY-790
>                 URL: http://issues.apache.org/jira/browse/DERBY-790
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC, Network Client, Network Server
>    Affects Versions: 10.1.1.0
>         Environment: Windows XP; WebLogic Server 9.0
>            Reporter: David Cabelus
>         Assigned To: Francois Orsini
>             Fix For: 10.2.2.0
>
>         Attachments: DERBY-790-v1.diff, DERBY-790-v1.stat
>
>
> When running RMI client tests with Derby,  many tests failed with the following message:
> Caused by: java.rmi.UnmarshalException: Failed to marshal error response: 
> 'org.apache.derby.client.am.SqlException: 'DROP TABLE' cannot be performed on 
> 'SDF014B7' because it does not exist.' because exception ; nested exception 
> is:
>         java.io.NotSerializableException: 
> org.apache.derby.client.net.NetSqlca
>         at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:191)
>         at 
> weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:176)
> This issue is a blocking issue for us.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message