It takes very long time to make an initial connection to the database after our application gets improperly shutdown (e.g. power disconnected). We use H2 in embedded mode, and the database size is about 40 MB. When we print the stack trace, it's usually something like this:
[1] java/io/RandomAccessFile.read([BII)I (pc 4), pc = 4 [2] java/io/RandomAccessFile.readFully([BII)V (pc 35), pc = 35 [3] org/h2/store/FileStore.readFully([BII)V (FileStore:280), pc = 97 [4] org/h2/store/DiskFile.getRecord(Lorg/h2/engine/Session;ILorg/h2/ store/RecordReader;I)Lorg/h2/store/Record; (DiskFile:577), pc = 91 [5] org/h2/store/Storage.getRecord(Lorg/h2/engine/Session;I)Lorg/h2/ store/Record; (Storage:94), pc = 17 [6] org/h2/index/ScanIndex.getNextRow(Lorg/h2/engine/Session;Lorg/h2/ result/Row;)Lorg/h2/result/Row; (ScanIndex:258), pc = 82 [7] org/h2/index/ScanCursor.next()Z (ScanCursor:71), pc = 170 [8] org/h2/table/TableData.addIndex(Lorg/h2/engine/Session;Ljava/lang/ String;I[Lorg/h2/table/IndexColumn;Lorg/h2/index/IndexType;ILjava/lang/ String;)Lorg/h2/index/Index; (TableData:189), pc = 240 [9] org/h2/command/ddl/CreateIndex.update()I (CreateIndex:90), pc = 250 [10] org/h2/engine/MetaRecord.execute(Lorg/h2/engine/Database;Lorg/h2/ engine/Session;Lorg/h2/api/DatabaseEventListener;)V (MetaRecord:85), pc = 33 [11] org/h2/engine/Database.open(II)V (Database:600), pc = 1071 [12] org/h2/engine/Database.<init>(Ljava/lang/String;Lorg/h2/engine/ ConnectionInfo;Ljava/lang/String;)V (Database:213), pc = 589 [13] org/h2/engine/Engine.openSession(Lorg/h2/engine/ ConnectionInfo;ZLjava/lang/String;)Lorg/h2/engine/Session; (Engine: 56), pc = 75 [14] org/h2/engine/Engine.openSession(Lorg/h2/engine/ ConnectionInfo;)Lorg/h2/engine/Session; (Engine:125), pc = 33 [15] org/h2/engine/Engine.getSession(Lorg/h2/engine/ ConnectionInfo;)Lorg/h2/engine/Session; (Engine:108), pc = 5 [16] org/h2/engine/Session.createSession(Lorg/h2/engine/ ConnectionInfo;)Lorg/h2/engine/SessionInterface; (Session:242), pc = 7 Is there anything that we can do to speed up the inital connect? Will it help if we perform frequent checkpoints? Any help is most appreciated. Thank you, - G --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "H2 Database" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/h2-database?hl=en -~----------~----~----~----~------~----~------~--~---
