Derby
  1. Derby
  2. DERBY-4804

Make database used in store.OSReadOnlyTest fully read-only

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 10.7.1.1
    • Fix Version/s: 10.7.1.1
    • Component/s: Test
    • Labels:
      None

      Description

      store.OSReadOnlyTest is supposed to emulate running Derby on a read-only media, but it turns out the database directory isn't made read-only - only the files inside the directories are.

      See http://db.markmail.org/thread/f3qlfx7teg7yk5hr for more details.

      1. DERBY-4804_3accept2errors.diff
        0.9 kB
        Myrna van Lunteren
      2. derby-4804-2a-common_file_ops.diff
        19 kB
        Kristian Waagan
      3. derby-4804-1a-test_change.diff
        6 kB
        Kristian Waagan

        Issue Links

          Activity

          Hide
          Kristian Waagan added a comment -

          Patch 1a changes the test to better simulate a read-only database.

          The straight-forward approach of making the directories read-only doesn't work, because Java version before Java SE 6 cannot make a file writable again after making it read-only. This makes it impossible to delete the directories/files from Java.

          Instead of disabling the test for Java version before Java SE 6, I decided to fool Derby by touching the db.lck file (if it doesn't exist) and making it read-only. This work-around should be removed when Java 6 is the lowest Java version we support (might take a while ).

          Patch ready for review.

          I will post a follow-up patch to refactor some of the file system routines, probably by moving them into PrivilegedFileOpsForTests.

          Show
          Kristian Waagan added a comment - Patch 1a changes the test to better simulate a read-only database. The straight-forward approach of making the directories read-only doesn't work, because Java version before Java SE 6 cannot make a file writable again after making it read-only. This makes it impossible to delete the directories/files from Java. Instead of disabling the test for Java version before Java SE 6, I decided to fool Derby by touching the db.lck file (if it doesn't exist) and making it read-only. This work-around should be removed when Java 6 is the lowest Java version we support (might take a while ). Patch ready for review. I will post a follow-up patch to refactor some of the file system routines, probably by moving them into PrivilegedFileOpsForTests.
          Hide
          Lily Wei added a comment -

          +1 on 1a patch. I only run windows 7 with sun 1.6.0_13 jvm. I did not run sun 1.5, 1.4 jvm or ibm jvm.

          Show
          Lily Wei added a comment - +1 on 1a patch. I only run windows 7 with sun 1.6.0_13 jvm. I did not run sun 1.5, 1.4 jvm or ibm jvm.
          Hide
          Kristian Waagan added a comment -

          Thanks for the review, Lily.
          Committed patch 1a (with some modified comments) to trunk with revision 998844.

          Show
          Kristian Waagan added a comment - Thanks for the review, Lily. Committed patch 1a (with some modified comments) to trunk with revision 998844.
          Hide
          Kristian Waagan added a comment -

          Attached patch 2a, moving some common file operations to PrivilegedFileOpsForTests instead of keeping them in the test itself.

          The following public methods were added:

          • BaseJDBCTestCase.
          • assertDirectoryDeleted
            Will delete a directory (also works for a single file) recursively, and all files will be attempted deleted. Files that cannot be deleted will be reported in the assert message.
          • PrivilegedFileOpsForTests
          • persistentRecursiveDelete(File, List)
            Will attempt to delete all files in the directory, and will return a list of files it couldn't delete.
          • getFileInfo(File)
            Obtains some information about a file, returned as a string. Currently returns isDir, canRead, canWrite, and size.

          In addition I made it possible to reuse a copy buffer in the copy routines, and changed a few throws clauses.

          Patch ready for review.

          Show
          Kristian Waagan added a comment - Attached patch 2a, moving some common file operations to PrivilegedFileOpsForTests instead of keeping them in the test itself. The following public methods were added: BaseJDBCTestCase. assertDirectoryDeleted Will delete a directory (also works for a single file) recursively, and all files will be attempted deleted. Files that cannot be deleted will be reported in the assert message. PrivilegedFileOpsForTests persistentRecursiveDelete(File, List) Will attempt to delete all files in the directory, and will return a list of files it couldn't delete. getFileInfo(File) Obtains some information about a file, returned as a string. Currently returns isDir, canRead, canWrite, and size. In addition I made it possible to reuse a copy buffer in the copy routines, and changed a few throws clauses. Patch ready for review.
          Hide
          Kristian Waagan added a comment -

          Committed patch 2a to trunk with revision 999796.
          I will wait a little while before resolving/closing.

          Show
          Kristian Waagan added a comment - Committed patch 2a to trunk with revision 999796. I will wait a little while before resolving/closing.
          Hide
          Myrna van Lunteren added a comment -

          Thanks for leaving this open, Kristian, I intend to run this test on some of the IBM platforms (AIX, OS/400) in the next few days, just to make sure things work there.

          Show
          Myrna van Lunteren added a comment - Thanks for leaving this open, Kristian, I intend to run this test on some of the IBM platforms (AIX, OS/400) in the next few days, just to make sure things work there.
          Hide
          Myrna van Lunteren added a comment - - edited

          Unfortunately, this test did now fail on OS/400 (with ibm 1.6):

          1) testOSReadOnly(org.apache.derbyTesting.functionTests.tests.store.OSReadOnlyTest)junit.framework.ComparisonFailure: Unexpected SQL state. expected:<25502> but was:<40XD1>
          at java.lang.Throwable.<init>(Throwable.java:196)
          at java.lang.Error.<init>(Error.java:49)
          at junit.framework.AssertionFailedError.<init>(AssertionFailedError.java:11)
          at junit.framework.ComparisonFailure.<init>(ComparisonFailure.java:19)
          at org.apache.derbyTesting.junit.BaseJDBCTestCase.assertSQLState(BaseJDBCTestCase.java:751)
          at org.apache.derbyTesting.junit.BaseJDBCTestCase.assertSQLState(BaseJDBCTestCase.java:814)
          at org.apache.derbyTesting.functionTests.tests.store.OSReadOnlyTest.assertExpectedInsertBehaviour(OSReadOnlyTest.java:271)
          at org.apache.derbyTesting.functionTests.tests.store.OSReadOnlyTest.testOSReadOnly(OSReadOnlyTest.java:146)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:88)
          at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
          at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
          at junit.extensions.TestSetup.run(TestSetup.java:23)
          at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
          at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
          at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
          at junit.extensions.TestSetup.run(TestSetup.java:23)
          at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
          at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
          at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
          at junit.extensions.TestSetup.run(TestSetup.java:23)
          Caused by: java.sql.SQLTransactionRollbackException: Container was opened in read-only mode.
          at java.lang.Throwable.<init>(Throwable.java:218)
          at java.lang.Exception.<init>(Exception.java:59)
          at java.sql.SQLException.<init>(SQLException.java:218)
          at java.sql.SQLTransactionRollbackException.<init>(SQLTransactionRollbackException.java:148)
          at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
          at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
          at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
          at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
          at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
          at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
          at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
          at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
          at org.apache.derby.impl.jdbc.EmbedStatement.executeUpdate(Unknown Source)
          at org.apache.derbyTesting.functionTests.tests.store.OSReadOnlyTest.assertExpectedInsertBehaviour(OSReadOnlyTest.java:267)
          ... 42 more
          Caused by: java.sql.SQLException: Container was opened in read-only mode.
          at java.lang.Throwable.<init>(Throwable.java:196)
          at java.lang.Exception.<init>(Exception.java:41)
          at java.sql.SQLException.<init>(SQLException.java:52)
          at org.apache.derby.impl.jdbc.EmbedSQLException.<init>(Unknown Source)
          at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
          at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
          ... 52 more
          Caused by: ERROR 40XD1: Container was opened in read-only mode.
          at java.lang.Throwable.<init>(Throwable.java:196)
          at java.lang.Exception.<init>(Exception.java:41)
          at org.apache.derby.iapi.error.StandardException.<init>(Unknown Source)
          at org.apache.derby.iapi.error.StandardException.<init>(Unknown Source)
          at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
          at org.apache.derby.impl.store.raw.data.BaseContainer.use(Unknown Source)
          at org.apache.derby.impl.store.raw.data.BaseContainerHandle.useContainer(Unknown Source)
          at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.openContainer(Unknown Source)
          at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.openContainer(Unknown Source)
          at org.apache.derby.impl.store.raw.xact.Xact.openContainer(Unknown Source)
          at org.apache.derby.impl.store.access.conglomerate.OpenConglomerate.init(Unknown Source)
          at org.apache.derby.impl.store.access.heap.Heap.open(Unknown Source)
          at org.apache.derby.impl.store.access.RAMTransaction.openConglomerate(Unknown Source)
          at org.apache.derby.impl.store.access.RAMTransaction.openCompiledConglomerate(Unknown Source)
          at org.apache.derby.impl.sql.execute.RowChangerImpl.openForUpdate(Unknown Source)
          at org.apache.derby.impl.sql.execute.RowChangerImpl.open(Unknown Source)
          at org.apache.derby.impl.sql.execute.RowChangerImpl.open(Unknown Source)
          at org.apache.derby.impl.sql.execute.InsertResultSet.normalInsertCore(Unknown Source)
          at org.apache.derby.impl.sql.execute.InsertResultSet.open(Unknown Source)
          at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source)
          at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
          ... 46 more
          2) testOSReadOnly(org.apache.derbyTesting.functionTests.tests.store.OSReadOnlyTest)junit.framework.ComparisonFailure: Unexpected SQL state. expected:<25502> but was:<40XD1>
          at java.lang.Throwable.<init>(Throwable.java:196)
          at java.lang.Error.<init>(Error.java:49)
          at junit.framework.AssertionFailedError.<init>(AssertionFailedError.java:11)
          at junit.framework.ComparisonFailure.<init>(ComparisonFailure.java:19)
          at org.apache.derbyTesting.junit.BaseJDBCTestCase.assertSQLState(BaseJDBCTestCase.java:751)
          at org.apache.derbyTesting.junit.BaseJDBCTestCase.assertSQLState(BaseJDBCTestCase.java:814)
          at org.apache.derbyTesting.functionTests.tests.store.OSReadOnlyTest.assertExpectedInsertBehaviour(OSReadOnlyTest.java:271)
          at org.apache.derbyTesting.functionTests.tests.store.OSReadOnlyTest.testOSReadOnly(OSReadOnlyTest.java:146)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:88)
          at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
          at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
          at junit.extensions.TestSetup.run(TestSetup.java:23)
          at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
          at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
          at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
          at junit.extensions.TestSetup.run(TestSetup.java:23)
          at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
          at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
          at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
          at junit.extensions.TestSetup.run(TestSetup.java:23)
          at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
          at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
          at junit.extensions.TestSetup.run(TestSetup.java:23)
          at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
          at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
          at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
          at junit.extensions.TestSetup.run(TestSetup.java:23)
          Caused by: java.sql.SQLTransactionRollbackException: Container was opened in read-only mode.
          at java.lang.Throwable.<init>(Throwable.java:196)
          at java.lang.Exception.<init>(Exception.java:41)
          at java.sql.SQLException.<init>(SQLException.java:52)
          at java.sql.SQLTransactionRollbackException.<init>(SQLTransactionRollbackException.java:82)
          at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown Source)
          at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
          at org.apache.derby.client.am.Statement.executeUpdate(Unknown Source)
          at org.apache.derbyTesting.functionTests.tests.store.OSReadOnlyTest.assertExpectedInsertBehaviour(OSReadOnlyTest.java:267)
          ... 51 more
          Caused by: org.apache.derby.client.am.SqlException: Container was opened in read-only mode.
          at java.lang.Throwable.<init>(Throwable.java:181)
          at java.lang.Exception.<init>(Exception.java:29)
          at org.apache.derby.client.am.SqlException.<init>(Unknown Source)
          at org.apache.derby.client.am.SqlException.<init>(Unknown Source)
          at org.apache.derby.client.am.Statement.completeSqlca(Unknown Source)
          at org.apache.derby.client.am.Statement.completeExecuteImmediate(Unknown Source)
          at org.apache.derby.client.net.NetStatementReply.parseEXCSQLIMMreply(Unknown Source)
          at org.apache.derby.client.net.NetStatementReply.readExecuteImmediate(Unknown Source)
          at org.apache.derby.client.net.StatementReply.readExecuteImmediate(Unknown Source)
          at org.apache.derby.client.net.NetStatement.readExecuteImmediate_(Unknown Source)
          at org.apache.derby.client.am.Statement.readExecuteImmediate(Unknown Source)
          at org.apache.derby.client.am.Statement.flowExecute(Unknown Source)
          at org.apache.derby.client.am.Statement.executeUpdateX(Unknown Source)
          ... 53 more

          I will try to figure out what's different, but suggestions are welcome.
          I am running these tests in the 'qsh', and I remember from past experiences with read/write experiments on this OS though that it's possible that file/dir permissions on the OS level prevent modifications in read/write permissions in the qsh level, so that could be one reason...

          Show
          Myrna van Lunteren added a comment - - edited Unfortunately, this test did now fail on OS/400 (with ibm 1.6): 1) testOSReadOnly(org.apache.derbyTesting.functionTests.tests.store.OSReadOnlyTest)junit.framework.ComparisonFailure: Unexpected SQL state. expected:<25502> but was:<40XD1> at java.lang.Throwable.<init>(Throwable.java:196) at java.lang.Error.<init>(Error.java:49) at junit.framework.AssertionFailedError.<init>(AssertionFailedError.java:11) at junit.framework.ComparisonFailure.<init>(ComparisonFailure.java:19) at org.apache.derbyTesting.junit.BaseJDBCTestCase.assertSQLState(BaseJDBCTestCase.java:751) at org.apache.derbyTesting.junit.BaseJDBCTestCase.assertSQLState(BaseJDBCTestCase.java:814) at org.apache.derbyTesting.functionTests.tests.store.OSReadOnlyTest.assertExpectedInsertBehaviour(OSReadOnlyTest.java:271) at org.apache.derbyTesting.functionTests.tests.store.OSReadOnlyTest.testOSReadOnly(OSReadOnlyTest.java:146) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:88) at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22) at junit.extensions.TestSetup$1.protect(TestSetup.java:19) at junit.extensions.TestSetup.run(TestSetup.java:23) at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57) at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22) at junit.extensions.TestSetup$1.protect(TestSetup.java:19) at junit.extensions.TestSetup.run(TestSetup.java:23) at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57) at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22) at junit.extensions.TestSetup$1.protect(TestSetup.java:19) at junit.extensions.TestSetup.run(TestSetup.java:23) Caused by: java.sql.SQLTransactionRollbackException: Container was opened in read-only mode. at java.lang.Throwable.<init>(Throwable.java:218) at java.lang.Exception.<init>(Exception.java:59) at java.sql.SQLException.<init>(SQLException.java:218) at java.sql.SQLTransactionRollbackException.<init>(SQLTransactionRollbackException.java:148) at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source) at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source) at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source) at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source) at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source) at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source) at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source) at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source) at org.apache.derby.impl.jdbc.EmbedStatement.executeUpdate(Unknown Source) at org.apache.derbyTesting.functionTests.tests.store.OSReadOnlyTest.assertExpectedInsertBehaviour(OSReadOnlyTest.java:267) ... 42 more Caused by: java.sql.SQLException: Container was opened in read-only mode. at java.lang.Throwable.<init>(Throwable.java:196) at java.lang.Exception.<init>(Exception.java:41) at java.sql.SQLException.<init>(SQLException.java:52) at org.apache.derby.impl.jdbc.EmbedSQLException.<init>(Unknown Source) at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source) at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source) ... 52 more Caused by: ERROR 40XD1: Container was opened in read-only mode. at java.lang.Throwable.<init>(Throwable.java:196) at java.lang.Exception.<init>(Exception.java:41) at org.apache.derby.iapi.error.StandardException.<init>(Unknown Source) at org.apache.derby.iapi.error.StandardException.<init>(Unknown Source) at org.apache.derby.iapi.error.StandardException.newException(Unknown Source) at org.apache.derby.impl.store.raw.data.BaseContainer.use(Unknown Source) at org.apache.derby.impl.store.raw.data.BaseContainerHandle.useContainer(Unknown Source) at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.openContainer(Unknown Source) at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.openContainer(Unknown Source) at org.apache.derby.impl.store.raw.xact.Xact.openContainer(Unknown Source) at org.apache.derby.impl.store.access.conglomerate.OpenConglomerate.init(Unknown Source) at org.apache.derby.impl.store.access.heap.Heap.open(Unknown Source) at org.apache.derby.impl.store.access.RAMTransaction.openConglomerate(Unknown Source) at org.apache.derby.impl.store.access.RAMTransaction.openCompiledConglomerate(Unknown Source) at org.apache.derby.impl.sql.execute.RowChangerImpl.openForUpdate(Unknown Source) at org.apache.derby.impl.sql.execute.RowChangerImpl.open(Unknown Source) at org.apache.derby.impl.sql.execute.RowChangerImpl.open(Unknown Source) at org.apache.derby.impl.sql.execute.InsertResultSet.normalInsertCore(Unknown Source) at org.apache.derby.impl.sql.execute.InsertResultSet.open(Unknown Source) at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source) at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source) ... 46 more 2) testOSReadOnly(org.apache.derbyTesting.functionTests.tests.store.OSReadOnlyTest)junit.framework.ComparisonFailure: Unexpected SQL state. expected:<25502> but was:<40XD1> at java.lang.Throwable.<init>(Throwable.java:196) at java.lang.Error.<init>(Error.java:49) at junit.framework.AssertionFailedError.<init>(AssertionFailedError.java:11) at junit.framework.ComparisonFailure.<init>(ComparisonFailure.java:19) at org.apache.derbyTesting.junit.BaseJDBCTestCase.assertSQLState(BaseJDBCTestCase.java:751) at org.apache.derbyTesting.junit.BaseJDBCTestCase.assertSQLState(BaseJDBCTestCase.java:814) at org.apache.derbyTesting.functionTests.tests.store.OSReadOnlyTest.assertExpectedInsertBehaviour(OSReadOnlyTest.java:271) at org.apache.derbyTesting.functionTests.tests.store.OSReadOnlyTest.testOSReadOnly(OSReadOnlyTest.java:146) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:88) at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22) at junit.extensions.TestSetup$1.protect(TestSetup.java:19) at junit.extensions.TestSetup.run(TestSetup.java:23) at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57) at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22) at junit.extensions.TestSetup$1.protect(TestSetup.java:19) at junit.extensions.TestSetup.run(TestSetup.java:23) at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57) at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22) at junit.extensions.TestSetup$1.protect(TestSetup.java:19) at junit.extensions.TestSetup.run(TestSetup.java:23) at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22) at junit.extensions.TestSetup$1.protect(TestSetup.java:19) at junit.extensions.TestSetup.run(TestSetup.java:23) at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57) at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22) at junit.extensions.TestSetup$1.protect(TestSetup.java:19) at junit.extensions.TestSetup.run(TestSetup.java:23) Caused by: java.sql.SQLTransactionRollbackException: Container was opened in read-only mode. at java.lang.Throwable.<init>(Throwable.java:196) at java.lang.Exception.<init>(Exception.java:41) at java.sql.SQLException.<init>(SQLException.java:52) at java.sql.SQLTransactionRollbackException.<init>(SQLTransactionRollbackException.java:82) at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown Source) at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source) at org.apache.derby.client.am.Statement.executeUpdate(Unknown Source) at org.apache.derbyTesting.functionTests.tests.store.OSReadOnlyTest.assertExpectedInsertBehaviour(OSReadOnlyTest.java:267) ... 51 more Caused by: org.apache.derby.client.am.SqlException: Container was opened in read-only mode. at java.lang.Throwable.<init>(Throwable.java:181) at java.lang.Exception.<init>(Exception.java:29) at org.apache.derby.client.am.SqlException.<init>(Unknown Source) at org.apache.derby.client.am.SqlException.<init>(Unknown Source) at org.apache.derby.client.am.Statement.completeSqlca(Unknown Source) at org.apache.derby.client.am.Statement.completeExecuteImmediate(Unknown Source) at org.apache.derby.client.net.NetStatementReply.parseEXCSQLIMMreply(Unknown Source) at org.apache.derby.client.net.NetStatementReply.readExecuteImmediate(Unknown Source) at org.apache.derby.client.net.StatementReply.readExecuteImmediate(Unknown Source) at org.apache.derby.client.net.NetStatement.readExecuteImmediate_(Unknown Source) at org.apache.derby.client.am.Statement.readExecuteImmediate(Unknown Source) at org.apache.derby.client.am.Statement.flowExecute(Unknown Source) at org.apache.derby.client.am.Statement.executeUpdateX(Unknown Source) ... 53 more I will try to figure out what's different, but suggestions are welcome. I am running these tests in the 'qsh', and I remember from past experiences with read/write experiments on this OS though that it's possible that file/dir permissions on the OS level prevent modifications in read/write permissions in the qsh level, so that could be one reason...
          Hide
          Kristian Waagan added a comment -

          Thanks for running the test on more platforms, Myrna.

          If the shell and the OS, possibly Java as well, aren't able to cooperate properly, there isn't much we can do except to accept both error messages.
          Unless you discover something crucial, I would suggest we allow both 25502 and 40XD1.

          Another experiment you can do, is to enable the line setting directories to read-only (currently commented out). This is not a solution to the problem, but it may get you past the current point of failure. The test should then fail when trying to delete the files instead.

          Show
          Kristian Waagan added a comment - Thanks for running the test on more platforms, Myrna. If the shell and the OS, possibly Java as well, aren't able to cooperate properly, there isn't much we can do except to accept both error messages. Unless you discover something crucial, I would suggest we allow both 25502 and 40XD1. Another experiment you can do, is to enable the line setting directories to read-only (currently commented out). This is not a solution to the problem, but it may get you past the current point of failure. The test should then fail when trying to delete the files instead.
          Hide
          Myrna van Lunteren added a comment -

          I'm attaching a patch that does accept SQLState 40XD1 or 25502.
          This passes on my iseries test environment.
          If this looks ok I suggest we commit this.

          Show
          Myrna van Lunteren added a comment - I'm attaching a patch that does accept SQLState 40XD1 or 25502. This passes on my iseries test environment. If this looks ok I suggest we commit this.
          Hide
          Kristian Waagan added a comment -

          +1 to commit, but I would suggest adding a comment about why we are allowing two different states (and also mention that 40XD1 currently is know to happen only on iSeries).

          Show
          Kristian Waagan added a comment - +1 to commit, but I would suggest adding a comment about why we are allowing two different states (and also mention that 40XD1 currently is know to happen only on iSeries).
          Hide
          Myrna van Lunteren added a comment -

          I committed the change to accept both SQLStates, after adding a comment about it happening only on iseries, with revision 1004378.

          Show
          Myrna van Lunteren added a comment - I committed the change to accept both SQLStates, after adding a comment about it happening only on iseries, with revision 1004378.
          Hide
          Myrna van Lunteren added a comment -

          I think this can now be marked as fixed...

          Show
          Myrna van Lunteren added a comment - I think this can now be marked as fixed...
          Hide
          Kristian Waagan added a comment -

          Daily regression tests passed. Closed issue.

          Show
          Kristian Waagan added a comment - Daily regression tests passed. Closed issue.

            People

            • Assignee:
              Kristian Waagan
              Reporter:
              Kristian Waagan
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development