Changeset 39:9c76014791c3


Ignore:
Timestamp:
03/05/12 20:26:53 (6 years ago)
Author:
Babis Nikolaou <charnik@…>
Branch:
default
Message:

Fixed issue with MonetDB during store.

Location:
generaldb/src/main/java/org/openrdf/sail/generaldb/managers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • generaldb/src/main/java/org/openrdf/sail/generaldb/managers/TransTableManager.java

    r25 r39  
    239239                return "0"; 
    240240        } 
    241  
     241         
    242242        protected TransactionTable getTable(Number pred) 
    243243        throws SQLException 
     
    246246                        TransactionTable table = tables.get(pred); 
    247247                        if (table == null) { 
     248                                triples.flushManagers();// charnik's addition (see flushManagers() method for details) 
    248249                                TripleTable predicate = triples.getPredicateTable(pred); 
    249250                                Number key = pred; 
  • generaldb/src/main/java/org/openrdf/sail/generaldb/managers/TripleTableManager.java

    r25 r39  
    473473                return hashes; 
    474474        } 
     475         
     476        /** 
     477         * @author charnik 
     478         * This method should be used only for flushing prepared statements  
     479         * related to hash values. Introduced to avoid exceptions in MonetDB 
     480         * when a new predicate has to be inserted and the underlying relational 
     481         * table does not exist. In such a case, the prepared statement for the 
     482         * creation of the table was making MonetDB to release all prepared statements 
     483         * that have already been created but not executed. 
     484         *  
     485         * FIXME: Should it throw those exceptions?  
     486         */ 
     487        public void flushManagers() { 
     488                try { 
     489                        hashes.flush(); 
     490                        uris.flush(); 
     491                        literals.flush(); 
     492                        bnodes.flush(); 
     493                         
     494                } catch (SQLException e) { 
     495                        // TODO Auto-generated catch block 
     496                        e.printStackTrace(); 
     497                } catch (InterruptedException e) { 
     498                        // TODO Auto-generated catch block 
     499                        e.printStackTrace(); 
     500                } 
     501                 
     502        } 
    475503} 
Note: See TracChangeset for help on using the changeset viewer.