Hi,

You will need to create a new database, as the existing database is corrupt
and can't be fixed (well you can try, using the Recover tool).

If you still get an exception, could you post the complete error message
and stack trace (the NullPointerException)?

By the way, please either use the mailing list OR StackOverflow, but not
both. See also
http://stackoverflow.com/questions/16882889/corrupt-h2-database

Regards,
Thomas



On Sun, Jun 2, 2013 at 3:20 PM, Itay Weinberger <[email protected]> wrote:

> Thanks Thomas,
>
> I've tried removing the optional and dangerous flags, but to no avail. The
> database gets corrupted again following the connection close.
> There's no point resubmitting the log since it's the same as before, any
> more ideas I could try out?
>
> Thanks,
> Itay
>
> On Sunday, June 2, 2013 4:06:18 PM UTC+3, Thomas Mueller wrote:
>
>> Hi,
>>
>> What about _not_ using all the dangerous, and documented to be dangerous
>> options (LOG=0;UNDO_LOG=0;LOCK_MODE=0)**?
>>
>> Regards,
>> Thomas
>>
>>
>>
>> On Sun, Jun 2, 2013 at 2:53 PM, Itay Weinberger <[email protected]> wrote:
>>
>>> I'm using H2 1.3.172 on a Windows machine with the following connection
>>> string:
>>>
>>> jdbc:h2:tcp://localhost/dev/*******;LOG=0;UNDO_LOG=0;DB_CLOSE_**ON_EXIT=TRUE;IGNORECASE=TRUE;**OPTIMIZE_REUSE_RESULTS=0;**QUERY_TIMEOUT=180000;MAX_**OPERATION_MEMORY=0;MAX_MEMORY_**ROWS=30000;COMPRESS_LOB=NO;**LOCK_MODE=0;MULTI_THREADED=0;**CACHE_SIZE=1048576;TRACE_**LEVEL_FILE=2;
>>>
>>> I receive the following exception when trying to connect to an existing
>>> database:
>>>
>>> General error: "java.lang.**NullPointerException"
>>>
>>> Scenario:
>>>
>>>    - I have a highly complex process around the H2 database.
>>>    - It all works fine with no issues.
>>>    - When the IIS reaches an idle session timeout an attempt to close
>>>    any open connections is made.
>>>    -
>>>
>>>    Failure as shown in the trace log (last few lines):
>>>
>>>    06-02 15:32:33 jdbc[2]: /*SQL #:1*/UPDATE UserTokens SET 
>>> Timestamp_Expires = DATEADD('MINUTE', 20, Timestamp_Expires) WHERE Token = 
>>> '1812493846';06-02 15:32:33 jdbc[2]: /*SQL #:1*/SELECT QC_Result FROM 
>>> QueryCache WHERE QC_Query = 
>>> 'COMMAND::usp_Engine_Metrics_**FindByName||PARAM::@name%%**VarChar%%50%%Hands
>>>  Played||';06-02 15:32:33 jdbc[2]: /*SQL #:1*/SELECT RC_Result FROM 
>>> ResultsCache WHERE RC_ID = '5/2/2013 12:00:00 AM_6/1/2013 11:59:59 
>>> PM__Hands Played|_Day_True____0';06-02 15:32:33 jdbc[2]: /*SQL #:1*/UPDATE 
>>> UserTokens SET Timestamp_Expires = DATEADD('MINUTE', 20, Timestamp_Expires) 
>>> WHERE Token = '1812493846';06-02 15:32:33 jdbc[2]: /*SQL #:1*/INSERT INTO 
>>> UserState (US_ID, US_State) VALUES 
>>> ('**b72e861a3c04a5b1ab8282eb6605b9**e0','{\"view\":\"dashboard\",\**"dashboardID\":21,\"panelID\":**-1,\"reportID\":-1,\"fromdate\**":null,\"todate\":null,\"guid\**":\"**b72e861a3c04a5b1ab8282eb6605b9**e0\",\"timestamp\":\"2013-06-**02T12:32:33.183Z\"}');06-02
>>>  15:35:49 jdbc[2]: /*SQL */COMMIT;06-02 15:35:49 jdbc[2]: /*SQL 
>>> */ROLLBACK;06-02 15:35:49 database: disconnecting session #206-02 15:35:49 
>>> database: closing C:/Program Files (x86)/H2/service/dev/JarvisDB06-02 
>>> 15:35:49 database: close
>>>    java.lang.ArrayIndexOutOfBound**sException: 2048
>>>    at org.h2.store.Data.writeValue(D**ata.java:406)
>>>    at org.h2.store.Data.writeValue(D**ata.java:640)
>>>    at org.h2.index.PageBtreeIndex.wr**iteRow(PageBtreeIndex.java:396**)
>>>    at org.h2.index.PageBtreeNode.wri**teData(PageBtreeNode.java:446)
>>>    at org.h2.index.PageBtreeNode.wri**te(PageBtreeNode.java:420)
>>>    at org.h2.store.PageStore.writeBa**ck(PageStore.java:1012)
>>>    at org.h2.store.PageStore.writeBa**ck(PageStore.java:412)
>>>    at org.h2.store.PageStore.checkpo**int(PageStore.java:430)
>>>    at org.h2.engine.Database.closeOp**enFilesAndUnlock(Database.java**:1211)
>>>    at org.h2.engine.Database.close(D**atabase.java:1164)
>>>    at org.h2.engine.Database.removeS**ession(Database.java:1043)
>>>    at org.h2.engine.Session.close(Se**ssion.java:617)
>>>    at 
>>> org.h2.server.TcpServerThread.**closeSession(TcpServerThread.j**ava:177)
>>>    at org.h2.server.TcpServerThread.**process(TcpServerThread.java:2**72)
>>>    at org.h2.server.TcpServerThread.**run(TcpServerThread.java:151)
>>>    at java.lang.Thread.run(Unknown Source)06-02 15:35:49 database: 
>>> closed06-02 15:35:49 database: disconnected session #2
>>>
>>>
>>> I assume the issue with me closing the connection, but I could really
>>> use some guidance as to the exact cause and workaround.
>>>
>>>
>>>
>>> Many thanks,
>>>
>>> Itay
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "H2 Database" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to h2-database...@**googlegroups.com.
>>> To post to this group, send email to [email protected].
>>>
>>> Visit this group at http://groups.google.com/**
>>> group/h2-database?hl=en-US<http://groups.google.com/group/h2-database?hl=en-US>
>>> .
>>> For more options, visit 
>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>> .
>>>
>>>
>>>
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "H2 Database" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/h2-database?hl=en-US.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to