db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Siddharth Srivastava (JIRA)" <j...@apache.org>
Subject [jira] Updated: (DERBY-4907) EmbeddedXADataSource with ;create=true attribute set in setDatabaseName fails with java.sql.SQLException: Database not available
Date Thu, 24 Feb 2011 09:14:38 GMT

     [ https://issues.apache.org/jira/browse/DERBY-4907?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Siddharth Srivastava updated DERBY-4907:
----------------------------------------

    Attachment: derby4907.diff

In continuation to previous comment:

I have tried closing the connection in my tests.

With this 3 tests failed while running suites.All, namely,
1) AutomaticIndexStatisticsTests
2) ReplicationRun_Local_1Indexing
3) RolesTest

I tried running these tests individually:
AutomaticIndexStatisticsTests failed with the following error:

There was 1 failure:
1) testShutdownWhileScanningThenDelete(org.apache.derbyTesting.functionTests.tes
ts.store.AutomaticIndexStatisticsTest)junit.framework.AssertionFailedError: Fail
ed to delete 3 files (root=F:\eclipsework\testGarbage\system\singleUse\copyShutd
own: F:\eclipsework\testGarbage\system\singleUse\copyShutdown\seg0\c481.dat (isD
ir=false, canRead=true, canWrite=true, size=22351872), F:\eclipsework\testGarbag
e\system\singleUse\copyShutdown\seg0 (isDir=true, canRead=true, canWrite=true, s
ize=12288), F:\eclipsework\testGarbage\system\singleUse\copyShutdown (isDir=true
, canRead=true, canWrite=true, size=4096)
        at org.apache.derbyTesting.junit.BaseJDBCTestCase.assertDirectoryDeleted
(BaseJDBCTestCase.java:1496)
        at org.apache.derbyTesting.functionTests.tests.store.AutomaticIndexStati
sticsTest.testShutdownWhileScanningThenDelete(AutomaticIndexStatisticsTest.java:
188)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:
112)
        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
        at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
        at junit.extensions.TestSetup.run(TestSetup.java:25)
        at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57
)
        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
        at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
        at junit.extensions.TestSetup.run(TestSetup.java:25)

FAILURES!!!
Tests run: 7,  Failures: 1,  Errors: 0

Other two tests passed.


> EmbeddedXADataSource with ;create=true attribute set in setDatabaseName fails with java.sql.SQLException:
Database not available
> --------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-4907
>                 URL: https://issues.apache.org/jira/browse/DERBY-4907
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.1.3.1, 10.2.2.0, 10.3.3.0, 10.4.2.0, 10.5.3.0, 10.6.2.1
>            Reporter: Kathey Marsden
>            Assignee: Siddharth Srivastava
>            Priority: Minor
>              Labels: derby_triage10_8
>         Attachments: derby4907.diff, derby4907.diff, derby4907.diff, derby4907.diff,
derby4907.txt, derby4907_final.diff
>
>
> Setting the ;create=true attribute in setDatabaseName with EmbededXADataSource and EmbeddedXADataSource40
 fails with 
> $ java TestDerbyCreate
> Exception in thread "main" java.sql.SQLException: Database not available
>         at org.apache.derby.jdbc.EmbeddedXADataSource.setupResourceAdapter(Embe
> dedXADataSource.java:175)
>         at org.apache.derby.jdbc.EmbeddedXADataSource.getXAConnection(EmbeddedX
> DataSource.java:101)
>         at TestDerbyCreate.main(TestDerbyCreate.java:18)
>  	
> using the create attributie in databaseName works fine with EmbeddedDataSource.  
> Using setCreateDatabase("create") with EmbeddedXADataSource is a good work around and
I think generally preferable.
> import java.sql.*;
> import javax.sql.*;
> public class TestDerbyCreate
> {
>     public static void main(String[] args) throws Throwable
>     {
>         org.apache.derby.jdbc.EmbeddedXADataSource ds =
>             new 
> org.apache.derby.jdbc.EmbeddedXADataSource();
>         ds.setDatabaseName("TestDB;create=true");
>         ds.setUser("dbuser1");
>         ds.setPassword("dbpwd1");
> 	PooledConnection pooledConn = ds.getXAConnection();
>         Connection conn = pooledConn.getConnection();
>         System.out.println("Database product: " + 
> conn.getMetaData().getDatabaseProductName());
>         System.out.println("Database version: " + 
> conn.getMetaData().getDatabaseProductVersion());
>         System.out.println("Driver name:      " + 
> conn.getMetaData().getDriverName());
>         System.out.println("Driver version:   " + 
> conn.getMetaData().getDriverVersion());
>         System.out.println("JDBC driver major ve

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message