public final void commit() throws IllegalStateException, RepositoryException
   {
      checkIfOpened();
      try
      {
         closeStatements();

         if (!readOnly)
         {
            try
            {
               for (ValueIOChannel vo : valueChanges)
               {
                  vo.twoPhaseCommit();
               }
            }
            catch (IOException e)
            {
               throw new RepositoryException(e);
            }
            finally
            {
               valueChanges.clear();
            }
            if (getDbConnectionTotalUsed() == 1)
            {
               // We don't commit as long as it is used
               dbConnection.commit();
            }
         }
      }
      catch (SQLException e)
      {
         throw new RepositoryException(e);
      }
      finally
      {
         try
         {
            if (release() == 0)
            {
               // We don't close the connection as long as it is used
               dbConnection.close();
            }
         }
         catch (SQLException e)
         {
            if (LOG.isWarnEnabled())
            {
               LOG.warn("Could not close the connection", e);
            }
         }
      }
   }
public final void commit ( ) throws IllegalStateException , RepositoryException { checkIfOpened ( ) ; try { closeStatements ( ) ; if ( ! readOnly ) { try { for ( ValueIOChannel vo : valueChanges ) { vo . twoPhaseCommit ( ) ; } } catch ( IOException e ) { throw new RepositoryException ( e ) ; } finally { valueChanges . clear ( ) ; } if ( getDbConnectionTotalUsed ( ) == 1 ) { dbConnection . commit ( ) ; } } } catch ( SQLException e ) { throw new RepositoryException ( e ) ; } finally { try { if ( release ( ) == 0 ) { dbConnection . close ( ) ; } } catch ( SQLException e ) { if ( LOG . isWarnEnabled ( ) ) { LOG . warn ( "Could not close the connection" , e ) ; } } } }
{@inheritDoc}