You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by Daniel John Debrunner <dj...@apache.org> on 2006/02/17 19:34:26 UTC

Re: svn commit: r378532 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests: master/DerbyNetClient/checkDataSource30.out suites/DerbyNetClient.exclude tests/jdbcapi/checkDataSource.java tests/jdbcapi/checkDataSource30.java

kmarsden@apache.org wrote:


> URL: http://svn.apache.org/viewcvs?rev=378532&view=rev
> Log:
> DERBY-435 jdbapi/checkDataSource30.java test should be changed or extended to test client DataSources
>  patch 2 - checkDataSource30 holdability testing for client
>  
> - Enables the checkDataSource30 test for holdability tests that are currently passing.
>   There appear to be several holdability bugs associated with network XA in additon to DERBY-966.
> 
> - Makes some progress toward getting checkDataSource.java to run with client, but it is not enabled yet.
>   - Changed to only run connection toString tests for embedded.
>   - Changed to only test SimpleDataSource for embedded

Can you expand on this last item. The purpose of the test is to check
all data sources for embedded, the comment implies to me that we are now
not testing EmbeddedDataSource. Or did I misunderstand?

>  - Changed to perform an explicit rollback of active transactions for client before performing a PooledConnection.getConnection()
>   I think this is an issue with embedded that it allows a PooledConnection.getConnection() with an active transaction, instead of throwing an error if the transaction is active.

I'm not sure this is a correct change, I thought it was defined that
PooledConnection.getConnection() closed the existing connection. I need
to find that reference.

Dan.



Re: svn commit: r378532 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests: master/DerbyNetClient/checkDataSource30.out suites/DerbyNetClient.exclude tests/jdbcapi/checkDataSource.java tests/jdbcapi/checkDataSource30.java

Posted by Kathey Marsden <km...@sbcglobal.net>.
Daniel John Debrunner wrote:

>>  - Changed to only test SimpleDataSource for embedded
>>    
>>
>
>Can you expand on this last item. The purpose of the test is to check
>all data sources for embedded, the comment implies to me that we are now
>not testing EmbeddedDataSource. Or did I misunderstand?
>
>  
>
This  was poorly worded.  Maybe move the only to the end.

- Changed to test SimpleDataSource for embedded only.


patch 1 changed the test to  use the TestUtil.getXXXDataSource methods
so that it could run with both client and embedded.
So, for example when run with -Dframework=DerbyNetClient  it will  test
ClientXADataSource instead of  EmbeddedXADataSource. SimpleDataSource is
relevant only to embedded so is not run for client.

Here are the three booleans and comments from the patch.  Dan mentioned
to me offline that  for
needRollbackBeforePCGetConnection the embedded behaviour is correct. So
that one need to have the comment changed and a Jira filed.  I will take
care of that in continuing work on DERBY-435 and also move the "only" to
the end of most sentences.


// Only test connection toString values for embedded.
    // Client connection toString values are not correlated at this time
and just
    // use default toString
    // These tests are exempted from other frameworks
    private static boolean testConnectionToString =
TestUtil.isEmbeddedFramework();
   
    // Only embedded supports SimpleDataSource (JSR169). 
    // These tests are exempted from other frameworks
    private static boolean testSimpleDataSource =
TestUtil.isEmbeddedFramework();

    // for a PooledConnection.getConnection() the connection gets closed.
    // Embedded automatically rolls back any activity on the connection.
    // Client requires the user to rollback and gives an SQLException 
    // java.sql.Connection.close() requested while a transaction is in
progress
    // I think client is right here (kmarsden), the user should have to
rollback
    private static boolean needRollbackBeforePCGetConnection =
        TestUtil.isDerbyNetClientFramework();
       





Re: svn commit: r378532 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests: master/DerbyNetClient/checkDataSource30.out suites/DerbyNetClient.exclude tests/jdbcapi/checkDataSource.java tests/jdbcapi/checkDataSource30.java

Posted by Daniel John Debrunner <dj...@apache.org>.
Daniel John Debrunner wrote:

> kmarsden@apache.org wrote:

>> - Changed to perform an explicit rollback of active transactions for client before performing a PooledConnection.getConnection()
>>  I think this is an issue with embedded that it allows a PooledConnection.getConnection() with an active transaction, instead of throwing an error if the transaction is active.
> 
> 
> I'm not sure this is a correct change, I thought it was defined that
> PooledConnection.getConnection() closed the existing connection. I need
> to find that reference.

Found the reference through comments in the Derby code for a method
called from EmbedPooledConnection.getConnection(), that was nice!

JDBC 3.0 section 11.4

A single physical PooledConnection object may generate many logical
Connection objects during its lifetime. For a given PooledConnection object,
only the most recently produced logical Connection object will be valid. Any
previously existing Connection object is automatically closed when the
associated
PooledConnection.getConnection method is called. Listeners (connection
pool managers) are not notified in this case.
This gives the application server a way to take a connection away from a
client.
This is an unlikely scenario but may be useful if the application server
is trying to
force an orderly shutdown.

So embedded is correct, I think this part of the test change should be
reverted.

Dan.