Ejemplo n.º 1
0
 /**
  * Enable/disable jdo Database pooling. This option only affects JDO if transactionManager is set
  * and a transaction is associated with the thread that call {@link #getDatabase}. If jdo Database
  * pooling is enabled, JDO will first search in the pool to see if there is already a Database for
  * the current transaction. If found, it returns the database; if not, it create a new one,
  * associates it will the transaction and return the newly created Database.
  *
  * <p>This method should be called before the invocation of {@link #getDatabase}.
  *
  * <p><b>Experimental</b> maybe removed in the future releases
  *
  * @param pool true to enable database pooling
  */
 public void setDatabasePooling(boolean pool) {
   if (!pool) {
     if (_txDbPool == null) return;
     else if (_txDbPool.isEmpty()) {
       _txDbPool = null;
       return;
     } else throw new IllegalStateException("JDO Pooling started. It can not be set to false");
   } else {
     if (_txDbPool == null) _txDbPool = new TxDatabaseMap();
     return;
   }
 }