I forgot to write my connection url: 
jdbc:h2:C:\recovery\db;IFEXISTS=FALSE;IGNORECASE=TRUE;AUTO_RECONNECT=TRUE;MV_STORE=FALSE;MVCC=TRUE;LOCK_TIMEOUT=10000;TRACE_LEVEL_FILE=3

Thanks

Il giorno mercoledì 18 marzo 2015 18:07:59 UTC+1, Daniele Renda ha scritto:
>
> Hi,
> I experienced a data loss that is very strange: I loss some data (about a 
> thousand) in the table COMUNICAZIONE of the db linked here 
> <http://goo.gl/Wa7D6O>. The db is used from my desktop application that 
> uses Spring JPA + Hibernate + Tomcat pool.
>
> The strange thing is that related tables as COMUNICAZIONE_TELEFONATA and 
> COMUNICAZIONE_EVENTO still refer to missing rows in the table COMUNICAZIONE.
>
> As you can see I've a  foreign key that links these table so I can't 
> understand how is possible that data are lost!
>
> The very very strange thing is also that opening a db with a sqlclient, I 
> still able to change/save rows in COMUNICAZIONE_TELEFONATA doing a commit 
> with an invalid COMUNICAZIONE_ID.
>
> For example try this:
>
>
>    1. DELETE COMUNICAZIONE_TELEFONATA WHERE LISTATELEFONATE_ID=2
>    2. Now change the row in COMUNICAZIONE_TELEFONATA where 
>    COMUNICAZIONE_ID=1 AND set LISTATELEFONATE_ID=2 (UPDATE 
>    COMUNICAZIONE_TELEFONATA SET LISTATELEFONATE_ID=1 WHERE 
> COMUNICAZIONE_ID=1;)
>
> If you do the change manually (I'm using dbever 
> <http://dbeaver.jkiss.org/>) I can do it --> *BREAK IN FOREIGN KEY*; 
> instead if I do it with the query I've an exception. I logged both cases:
>
>
> First case in which I can break foreign key
>
> /*SQL #:1*/SELECT COUNT(*) FROM PUBLIC.COMUNICAZIONE_TELEFONATA;
> 03-18 17:50:47 jdbc[3]: 
> /**/ResultSet rs22 = prep20.getResultSet();
> 03-18 17:50:47 jdbc[3]: 
> /**/rs22.next();
> 03-18 17:50:47 jdbc[3]: 
> /**/rs22.getObject(1);
> 03-18 17:50:47 jdbc[3]: 
> /**/rs22.close();
> 03-18 17:50:47 jdbc[3]: 
> /**/prep20.close();
> 03-18 17:50:54 jdbc[3]: 
> /**/PreparedStatement prep21 = conn2.prepareStatement("UPDATE 
> PUBLIC.COMUNICAZIONE_TELEFONATA SET LISTATELEFONATE_ID=? WHERE 
> LISTATELEFONATE_ID=?", 1003, 1007);
> 03-18 17:50:54 jdbc[3]: 
> /**/prep21.setLong(1, 2L);
> 03-18 17:50:54 jdbc[3]: 
> /**/prep21.setLong(1, 2L);
> 03-18 17:50:54 jdbc[3]: 
> /**/prep21.setLong(2, 1L);
> 03-18 17:50:54 jdbc[3]: 
> /**/prep21.setLong(2, 1L);
> 03-18 17:50:54 jdbc[3]: 
> /**/prep21.execute();
> 03-18 17:50:54 lock: 3 shared read lock requesting for 
> COMUNICAZIONE_TELEFONATA
> 03-18 17:50:54 lock: 3 shared read lock ok COMUNICAZIONE_TELEFONATA
> 03-18 17:50:54 index: FK_ERPYS2COX2RABQ2AMUIXY09GU_INDEX_F remove ( /* 
> key:96 */ 1, 1)
> 03-18 17:50:54 pageStore: log undo 1185
> 03-18 17:50:54 pageStore: updateRecord page[1185] b-tree leaf table:312 
> entries:62
> 03-18 17:50:54 index: UK_SA780TK1V7LH4N75SD3H087XV_INDEX_F remove ( /* 
> key:96 */ 1, 1)
> 03-18 17:50:54 pageStore: log undo 1125
> 03-18 17:50:54 pageStore: updateRecord page[1125] b-tree leaf table:196 
> entries:62
> 03-18 17:50:54 index: COMUNICAZIONE_TELEFONATA_DATA remove ( /* key:96 */ 
> 1, 1)
> 03-18 17:50:54 pageStore: log undo 1058
> 03-18 17:50:54 pageStore: updateRecord page[1058] data leaf table:53 
> COMUNICAZIONE_TELEFONATA entries:62 parent:0 keys:[3, 4, 5, 6, 10, 11, 12, 
> 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31
> , 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44
> ...

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to