google-code-export / h2database

Automatically exported from code.google.com/p/h2database
0 stars 1 forks source link

NPE in Database.open(int, int) with h2.lobInDatabase=true when trying to connect to unclean shut down DB #234

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Using h2-1.2.143 and h2.lobInDatabase = true.

If the database was not shut down correctly, an NPE may happen in 
Database.open(int, int) in line 537 ( getPageStore();) and thus the database 
may not be accessed anymore. Reason seems to be that systemUser is null (set a 
few lines later). Stack:

Database.getLobConnection() line: 2241  
LobStorage.init() line: 79  
LobStorage.getInputStream(long) line: 308   
ValueLobDb.getInputStream() line: 271   
ValueLobDb.getBytesNoCopy() line: 220   
ValueLobDb.compareSecure(Value, CompareMode) line: 246  
ValueLobDb(Value).compareTypeSave(Value, CompareMode) line: 810 
RegularTable(Table).compareTypeSave(Value, Value) line: 972 
PageDataIndex(BaseIndex).compareValues(Value, Value, int) line: 297 
PageDataIndex(BaseIndex).compareRows(SearchRow, SearchRow) line: 245    
MultiVersionIndex.removeIfExists(Session, Row) line: 152    
MultiVersionIndex.add(Session, Row) line: 50    
RegularTable.addRow(Session, Row) line: 116 
PageStore.redo(int, int, Row, boolean) line: 1485   
PageLog.recover(int) line: 316  
PageStore.recover() line: 1333  
PageStore.openExisting() line: 341  
PageStore.open() line: 275  
Database.getPageStore() line: 2029  
Database.open(int, int) line: 537   

Original issue reported on code.google.com by markus.f...@gmail.com on 5 Oct 2010 at 1:34

GoogleCodeExporter commented 9 years ago
Thanks for the bug report. I don't have a reproducible test case yet, but I 
understand the problem and I think I know how to fix it.

Original comment by thomas.t...@gmail.com on 5 Oct 2010 at 8:13

GoogleCodeExporter commented 9 years ago
Fixed in version 1.2.144

Original comment by thomas.t...@gmail.com on 15 Oct 2010 at 6:29