db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gabriele Kahlout <gabri...@mysimpatico.com>
Subject Re: Hanging around derby.log, how to center it?
Date Fri, 26 Mar 2010 22:33:25 GMT
Okay, so this (uncommented or commented lines):

 final Properties prop = new java.util.Properties();
            prop.setProperty("derby.locks.deadlockTrace", "true");
            prop.setProperty("derby.stream.error.logSeverityLevel",
Integer.toString(20000));
            prop.setProperty("derby.language.logStatementText", "true");
            //final File log = new File(dir.getAbsolutePath() +
File.pathSeparator + "derby.log");
            //prop.setProperty("derby.stream.error.file",
log.getAbsolutePath());
            prop.store(new FileOutputStream(new File(dir,
"derby.properties")), "derby.properties");

The log keeps getting created in the working directory, and also
nothing is written into it although I get:


java.sql.SQLTransactionRollbackException: A lock could not be obtained
within the time requested
        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 com.mysimpatico.memorizeasy.engine.Database.destroyDb(Database.java:552)
        at com.mysimpatico.memorizeasy.EmpiricalTest.tearDown(EmpiricalTest.java:32)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
        at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:37)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:73)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
        at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
        at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
        at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
        at junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:39)
        at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:515)
        at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:1031)
        at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:888)
Caused by: java.sql.SQLException: A lock could not be obtained within
the time requested
        at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown
Source)
        at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown
Source)
        ... 31 more
Caused by: ERROR 40XL1: A lock could not be obtained within the time requested
        at org.apache.derby.iapi.error.StandardException.newException(Unknown
Source)
        at org.apache.derby.impl.services.locks.ConcurrentLockSet.lockObject(Unknown
Source)
        at org.apache.derby.impl.services.locks.AbstractPool.lockObject(Unknown
Source)
        at org.apache.derby.impl.services.locks.ConcurrentPool.lockObject(Unknown
Source)
        at org.apache.derby.impl.store.raw.xact.ContainerLocking3.lockContainer(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.openConglomerate(Unknown
Source)
        at org.apache.derby.impl.sql.execute.DDLConstantAction.lockTableForDDL(Unknown
Source)
        at org.apache.derby.impl.sql.execute.DropTableConstantAction.executeConstantAction(Unknown
Source)
        at org.apache.derby.impl.sql.execute.MiscResultSet.open(Unknown Source)
        at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown
Source)
        at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown
Source)
        ... 25 more

2010/3/17, Knut Anders Hatlen <Knut.Hatlen@sun.com>:
> On 03/17/10 22:10, Gabriele Kahlout wrote:
>> Does this look okay:
>>
>>   final Properties prop = new java.util.Properties();
>>             prop.store(new FileOutputStream(new File(dir,
>> "derby.properties")), "derby.properties");
>>             prop.setProperty("derby.locks.deadlockTrace", "true");
>>             prop.setProperty("derby.stream.error.logSeverityLevel",
>> Integer.toString(20000));
>>             prop.setProperty("derby.language.logStatementText", "true");
>>             prop.setProperty("derby.stream.error.file",
>> dir.getAbsolutePath()+"derby.log");
>
> No, you need to call store() after you have called setProperty().
> Otherwise, you'll just create an empty properties file.
>
> --
> Knut Anders
>


-- 
Regards,
K. Gabriele

--- unchanged since 25/1/10 ---
P.S. Unless a notification (LON), please reply either with an answer
OR with " ACK" appended to this subject within 48 hours. Otherwise, I
might resend.
In(LON, this) ∨ In(48h, TimeNow) ∨ ∃x. In(x, MyInbox) ∧ IsAnswerTo(x,
this) ∨ (In(subject(this), subject(x)) ∧ In(ACK, subject(x)) ∧
¬IsAnswerTo(x,this)) ⇒ ¬IResend(this).

Also note that correspondence may be received only from specified a
priori senders, or if the subject of this email ends with a code, eg.
-LICHT01X, then also from senders whose reply contains it.
∀x. In(x, MyInbox) ⇒ In(senderAddress(x), MySafeSenderList) ∨ (∃y.
In(y, subject(this) ) ∧ In(y,x) ∧ isCodeLike(y, -LICHT01X) ).

Mime
View raw message