Revision: 13791
          http://gate.svn.sourceforge.net/gate/?rev=13791&view=rev
Author:   valyt
Date:     2011-05-05 07:15:14 +0000 (Thu, 05 May 2011)

Log Message:
-----------
Open the H2 DB in read-only mode when searching (to make index archiving safer).

Modified Paths:
--------------
    mimir/trunk/plugins/db-h2/src/gate/mimir/db/DBSemanticAnnotationHelper.java

Modified: 
mimir/trunk/plugins/db-h2/src/gate/mimir/db/DBSemanticAnnotationHelper.java
===================================================================
--- mimir/trunk/plugins/db-h2/src/gate/mimir/db/DBSemanticAnnotationHelper.java 
2011-05-03 14:58:58 UTC (rev 13790)
+++ mimir/trunk/plugins/db-h2/src/gate/mimir/db/DBSemanticAnnotationHelper.java 
2011-05-05 07:15:14 UTC (rev 13791)
@@ -251,9 +251,11 @@
               DB_CACHE_SIZE_OPTIONS_KEY);
       // default to 100 MiB, if not provided
       if(cacheSizeStr == null) cacheSizeStr = Integer.toString(100 *1024);
+      // open the database in read-only mode
       dbConnection = DriverManager.getConnection(
               "jdbc:h2:file:" + dbDir.getAbsolutePath() + 
-              "/" + tableBaseName + ";CACHE_SIZE=" + cacheSizeStr, "sa", "");
+              "/" + tableBaseName + ";CACHE_SIZE=" + cacheSizeStr + 
+              ";ACCESS_MODE_DATA=r", "sa", "");
       dbConnection.setReadOnly(true);
     } catch(SQLException e) {
       throw new RuntimeException("Error while initialising the database", e);


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to