Re: [h2] H2 Database - Connection Closes Abruptly

2016-06-30 Thread Steve McLeod
As a first step, update to the latest release H2 jar (1.3.176) or the 
latest beta jar (1.4.192).

As a second step, try to find reliable steps to reproduce the problem. This 
helps fix the problem.




On Friday, 24 June 2016 09:26:43 UTC+2, Ranjit K wrote:
>
> My question to you more specifically is “how to do we prevent H2 DB or 
> tables from getting corrupt?”
>
>  
>
> We think that since the connection to database is getting closed abruptly, 
> it might be causing the following SELECT query to fail (which can possibly 
> be due to database/table corruption).
>
> On Friday, 24 June 2016 01:34:56 UTC+5:30, Ranjit K wrote:
>>
>> What are the reasons H2 database can get corrupted? Is it possible that 
>> the 1st exception is the reason behind 2nd exception?
>>
>> On Thursday, 23 June 2016 21:52:10 UTC+5:30, Noel Grandin wrote:
>>>
>>> The first exception is occurring because somewhere your code is 
>>> forgetting to close a java.sql.Connection
>>>
>>> The second exception is occurring because your DB has become corrupted.
>>> ​
>>>
>>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


Re: [h2] H2 Database - Connection Closes Abruptly

2016-06-24 Thread Noel Grandin



On 2016/06/24 9:26 AM, Ranjit K wrote:

My question to you more specifically is “how to do we prevent H2 DB or tables 
from getting corrupt?”



We don't know. Normally it is related to machine-specific issues, dodgy hardware or drives, frequent power 
interruptions, that kind of thing.


Sometimes it is a bug, but without a test-case, impossible to track down.




We think that since the connection to database is getting closed abruptly, it 
might be causing the following SELECT
query to fail (which can possibly be due to database/table corruption).



No, that's not a problem, that's just a warning to alert you to leaking 
connections in your code.

--
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+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


Re: [h2] H2 Database - Connection Closes Abruptly

2016-06-24 Thread Ranjit K


My question to you more specifically is “how to do we prevent H2 DB or 
tables from getting corrupt?”

 

We think that since the connection to database is getting closed abruptly, 
it might be causing the following SELECT query to fail (which can possibly 
be due to database/table corruption).

On Friday, 24 June 2016 01:34:56 UTC+5:30, Ranjit K wrote:
>
> What are the reasons H2 database can get corrupted? Is it possible that 
> the 1st exception is the reason behind 2nd exception?
>
> On Thursday, 23 June 2016 21:52:10 UTC+5:30, Noel Grandin wrote:
>>
>> The first exception is occurring because somewhere your code is 
>> forgetting to close a java.sql.Connection
>>
>> The second exception is occurring because your DB has become corrupted.
>> ​
>>
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


Re: [h2] H2 Database - Connection Closes Abruptly

2016-06-23 Thread Ranjit K
What are the reasons H2 database can get corrupted? Is it possible that the 
1st exception is the reason behind 2nd exception?

On Thursday, 23 June 2016 21:52:10 UTC+5:30, Noel Grandin wrote:
>
> The first exception is occurring because somewhere your code is forgetting 
> to close a java.sql.Connection
>
> The second exception is occurring because your DB has become corrupted.
> ​
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


Re: [h2] H2 Database - Connection Closes Abruptly

2016-06-23 Thread Noel Grandin
The first exception is occurring because somewhere your code is forgetting
to close a java.sql.Connection

The second exception is occurring because your DB has become corrupted.
​

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


[h2] H2 Database - Connection Closes Abruptly

2016-06-23 Thread Ranjit K


I am a Java developer working with H2 database. I have encountered a 
situation in our Production Environment where the connection to H2 database 
closed abruptly. 

 

>From the trace.db file I learnt the following:

 

*org.h2.message.DbException: The connection was not closed by the 
application and is garbage collected [90018-174]*

*at org.h2.message.DbException.get(DbException.java:172)*

*Caused by: org.h2.jdbc.JdbcSQLException: The connection was not closed by 
the application and is garbage collected [90018-174]*

*at 
org.h2.message.DbException.getJdbcSQLException(DbException.java:332)*

*... 40 more*

 

*06-19 23:59:58 database: close*

*java.lang.ClassCastException: org.h2.index.PageDataLeaf cannot be cast to 
org.h2.store.PageStreamTrunk*

 

*06-20 00:00:19 jdbc[1404]: exception*

*org.h2.jdbc.JdbcSQLException: File corrupted while reading record: 
"[41656] stream data key:8741 pos:11 remaining:0". Possible solution: use 
the recovery tool; SQL statement:*

*select tran0_.TRAN_NO as TRAN1_229_, tran0_.ENTRY_DATE as ENTRY2_229_, 
tran0_.BUSINESS_DAY as BUSINESS3_229_, tran0_.POS_NO as POS4_229_, 
tran0_.RECEIPT_NO as RECEIPT5_229_, tran0_.RETURNED as RETURNED229_, 
tran0_.SERIES_FLAG as SERIES7_229_, tran0_.STAFF_NO as STAFF8_229_, 
tran0_.TRAN_DATA as TRAN9_229_, tran0_.TRAN_DATE as TRAN10_229_, 
tran0_.TRAN_DAY as TRAN11_229_, tran0_.TRAN_ID as TRAN12_229_, 
tran0_.TRAN_SEND_FLAG as TRAN13_229_, tran0_.TRAN_TIME as TRAN14_229_, 
tran0_.TRAN_VERSION as TRAN15_229_ from T_TRAN tran0_ where 
tran0_.TRAN_SEND_FLAG=0 [90030-174]*

 

Could you please throw some light on what could possibly cause a *database: 
close* event.

 

H2 version: *h2-1.3.174.jar*

JRE version: *jdk1.6.0_25*

 

If you need more details, please let us know.

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.