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] Commented: (DERBY-4907) EmbeddedXADataSource with ;create=true attribute set in setDatabaseName fails with java.sql.SQLException: Database not available
Date Sat, 19 Feb 2011 17:54:38 GMT

    [ https://issues.apache.org/jira/browse/DERBY-4907?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12996824#comment-12996824
] 

Siddharth Srivastava commented on DERBY-4907:
---------------------------------------------

When I run the suites.All, I get the following 2 errors

run "suites.All" I get this error : ( I emptied the directory from which I was running tests
before starting running suites.All)

[Error/failure logged at Sat Feb 19 15:40:32 IST 2011]
java.sql.SQLException: An IOException occurred while writing data to the file.
	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:98)
	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:142)
	at org.apache.derby.impl.jdbc.Util.seeNextException(Util.java:278)
	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:403)
	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:348)
	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2290)
	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:82)
	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1334)
	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(EmbedPreparedStatement.java:1686)
	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(EmbedPreparedStatement.java:1341)
	at org.apache.derbyTesting.functionTests.tests.tools.ImportExportBaseTest.doExportQueryLobsToExtFile(ImportExportBaseTest.java:197)
	at org.apache.derbyTesting.functionTests.tests.tools.ImportExportLobTest.testImportDataExportQueryLobsInExtFile(ImportExportLobTest.java:332)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at junit.framework.TestCase.runTest(TestCase.java:164)
	at junit.framework.TestCase.runBare(TestCase.java:130)
	at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:112)
	at junit.framework.TestResult$1.protect(TestResult.java:106)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.framework.TestResult.run(TestResult.java:109)
	at junit.framework.TestCase.run(TestCase.java:120)
	at junit.framework.TestSuite.runTest(TestSuite.java:230)
	at junit.framework.TestSuite.run(TestSuite.java:225)
	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
	at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.extensions.TestSetup.run(TestSetup.java:25)
	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
	at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.extensions.TestSetup.run(TestSetup.java:25)
	at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
	at junit.framework.TestSuite.runTest(TestSuite.java:230)
	at junit.framework.TestSuite.run(TestSuite.java:225)
	at junit.framework.TestSuite.runTest(TestSuite.java:230)
	at junit.framework.TestSuite.run(TestSuite.java:225)
	at junit.framework.TestSuite.runTest(TestSuite.java:230)
	at junit.framework.TestSuite.run(TestSuite.java:225)
	at junit.textui.TestRunner.doRun(TestRunner.java:121)
	at junit.textui.TestRunner.start(TestRunner.java:185)
	at junit.textui.TestRunner.main(TestRunner.java:143)
Caused by: java.sql.SQLException: An IOException occurred while writing data to the file.
	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:122)
	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:71)
	... 42 more
Caused by: java.sql.SQLException: Java exception: 'extinout\books.del (Access is denied):
java.io.FileNotFoundException'.
	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:122)
	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:71)
	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:142)
	at org.apache.derby.impl.jdbc.Util.javaException(Util.java:299)
	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:408)
	... 40 more
Caused by: java.io.FileNotFoundException: extinout\books.del (Access is denied)
	at java.io.FileOutputStream.open(Native Method)
	at java.io.FileOutputStream.<init>(Unknown Source)
	at java.io.FileOutputStream.<init>(Unknown Source)
	at org.apache.derby.impl.load.ExportWriteData.openFiles(ExportWriteData.java:108)
	at org.apache.derby.impl.load.ExportWriteData.run(ExportWriteData.java:93)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.apache.derby.impl.load.ExportWriteData.init(ExportWriteData.java:85)
	at org.apache.derby.impl.load.ExportWriteData.<init>(ExportWriteData.java:78)
	at org.apache.derby.impl.load.Export.getExportWriteData(Export.java:296)
	at org.apache.derby.impl.load.ExportAbstract.doAllTheWork(ExportAbstract.java:187)
	at org.apache.derby.impl.load.Export.doExport(Export.java:65)
	at org.apache.derby.impl.load.Export.exportQuery(Export.java:285)
	at org.apache.derby.catalog.SystemProcedures.SYSCS_EXPORT_QUERY_LOBS_TO_EXTFILE(SystemProcedures.java:1430)
	at org.apache.derby.exe.ac685dd88bx012ex3d61x7f08x00004762b9942.g0(Unknown Source)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.apache.derby.impl.services.reflect.ReflectMethod.invoke(ReflectMethod.java:46)
	at org.apache.derby.impl.sql.execute.CallStatementResultSet.open(CallStatementResultSet.java:75)
	at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(GenericPreparedStatement.java:436)
	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:317)
	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1242)
	... 35 more

2) [Error/failure logged at Sat Feb 19 17:04:10 IST 2011]
java.sql.SQLException: DERBY SQL error: SQLCODE: -1, SQLSTATE: XJ041, SQLERRMC: Failed to
create database 'F:\eclipsework\testGarbage\db_master\wombat', see the next exception for
details.::SQLSTATE: XBM0JDirectory F:\eclipsework\testGarbage\db_master\F:\eclipsework\testGarbage\db_master\wombat
already exists.
	at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:99)
	at org.apache.derby.client.am.SqlException.getSQLException(SqlException.java:358)
	at org.apache.derby.jdbc.ClientDriver.connect(ClientDriver.java:166)
	at java.sql.DriverManager.getConnection(Unknown Source)
	at java.sql.DriverManager.getConnection(Unknown Source)
	at org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun.bootMasterDatabase(ReplicationRun.java:868)
	at org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun.makeReadyForReplication(ReplicationRun.java:2746)
	at org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun_Local_1Indexing.testReplication_Local_1_Indexing(ReplicationRun_Local_1Indexing.java:70)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at junit.framework.TestCase.runTest(TestCase.java:164)
	at junit.framework.TestCase.runBare(TestCase.java:130)
	at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:112)
	at org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun.runBare(ReplicationRun.java:207)
	at junit.framework.TestResult$1.protect(TestResult.java:106)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.framework.TestResult.run(TestResult.java:109)
	at junit.framework.TestCase.run(TestCase.java:120)
	at junit.framework.TestSuite.runTest(TestSuite.java:230)
	at junit.framework.TestSuite.run(TestSuite.java:225)
	at junit.framework.TestSuite.runTest(TestSuite.java:230)
	at junit.framework.TestSuite.run(TestSuite.java:225)
	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
	at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.extensions.TestSetup.run(TestSetup.java:25)
	at junit.framework.TestSuite.runTest(TestSuite.java:230)
	at junit.framework.TestSuite.run(TestSuite.java:225)
	at junit.framework.TestSuite.runTest(TestSuite.java:230)
	at junit.framework.TestSuite.run(TestSuite.java:225)
	at junit.framework.TestSuite.runTest(TestSuite.java:230)
	at junit.framework.TestSuite.run(TestSuite.java:225)
	at junit.textui.TestRunner.doRun(TestRunner.java:121)
	at junit.textui.TestRunner.start(TestRunner.java:185)
	at junit.textui.TestRunner.main(TestRunner.java:143)
Caused by: org.apache.derby.client.am.SqlException: DERBY SQL error: SQLCODE: -1, SQLSTATE:
XJ041, SQLERRMC: Failed to create database 'F:\eclipsework\testGarbage\db_master\wombat',
see the next exception for details.::SQLSTATE: XBM0JDirectory F:\eclipsework\testGarbage\db_master\F:\eclipsework\testGarbage\db_master\wombat
already exists.
	at org.apache.derby.client.am.Connection.completeSqlca(Connection.java:2121)
	at org.apache.derby.client.net.NetConnectionReply.parseRdbAccessFailed(NetConnectionReply.java:541)
	at org.apache.derby.client.net.NetConnectionReply.parseAccessRdbError(NetConnectionReply.java:434)
	at org.apache.derby.client.net.NetConnectionReply.parseACCRDBreply(NetConnectionReply.java:297)
	at org.apache.derby.client.net.NetConnectionReply.readAccessDatabase(NetConnectionReply.java:121)
	at org.apache.derby.client.net.NetConnection.readSecurityCheckAndAccessRdb(NetConnection.java:846)
	at org.apache.derby.client.net.NetConnection.flowSecurityCheckAndAccessRdb(NetConnection.java:769)
	at org.apache.derby.client.net.NetConnection.flowUSRIDONLconnect(NetConnection.java:601)
	at org.apache.derby.client.net.NetConnection.flowConnect(NetConnection.java:408)
	at org.apache.derby.client.net.NetConnection.<init>(NetConnection.java:218)
	at org.apache.derby.client.net.NetConnection40.<init>(NetConnection40.java:79)
	at org.apache.derby.client.net.ClientJDBCObjectFactoryImpl40.newNetConnection(ClientJDBCObjectFactoryImpl40.java:269)
	at org.apache.derby.jdbc.ClientDriver.connect(ClientDriver.java:157)
	... 34 more

FAILURES!!!
Tests run: 13327,  Failures: 0,  Errors: 2

> 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.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