本文整理了Java中org.pentaho.di.core.database.Database.commit()
方法的一些代码示例,展示了Database.commit()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Database.commit()
方法的具体详情如下:
包路径:org.pentaho.di.core.database.Database
类名称:Database
方法名:commit
[英]Perform a commit the connection if this is supported by the database
[中]如果数据库支持,请执行提交连接
代码示例来源:origin: pentaho/pentaho-kettle
private void disconnectDb( Database db ) throws KettleDatabaseException {
if ( db == null ) {
return;
}
if ( !db.isAutoCommit() ) {
db.commit( true );
}
db.disconnect();
}
代码示例来源:origin: pentaho/pentaho-kettle
/**
* A MySQL InnoDB hack really... Doesn't like a lock in case there's been a read in another session. It considers it
* an open transaction.
*
* @throws KettleDatabaseException
*/
public void closeReadTransaction() throws KettleDatabaseException {
if ( databaseMeta.isMySQLVariant() && !database.isAutoCommit() ) {
database.commit();
}
}
代码示例来源:origin: pentaho/pentaho-kettle
commit();
} else {
commit();
代码示例来源:origin: pentaho/pentaho-kettle
commit();
ps.clearBatch();
} else {
commit();
代码示例来源:origin: pentaho/pentaho-kettle
debug = "insertRow executeBatch commit";
ps.executeBatch();
commit();
ps.clearBatch();
} else {
debug = "insertRow normal commit";
commit();
代码示例来源:origin: pentaho/pentaho-kettle
public synchronized void commit() throws KettleException {
try {
closeJobAttributeInsertPreparedStatement();
closeStepAttributeInsertPreparedStatement();
closeTransAttributeInsertPreparedStatement();
if ( !database.isAutoCommit() ) {
database.commit();
}
// Also, clear the counters, reducing the risk of collisions!
//
Counters.getInstance().clear();
} catch ( KettleException dbe ) {
throw new KettleException( "Unable to commit repository connection", dbe );
}
}
代码示例来源:origin: pentaho/pentaho-kettle
public void dispose( StepMetaInterface smi, StepDataInterface sdi ) {
meta = (CombinationLookupMeta) smi;
data = (CombinationLookupData) sdi;
if ( data.db != null ) {
try {
if ( !data.db.isAutoCommit() ) {
if ( getErrors() == 0 ) {
data.db.commit();
} else {
data.db.rollback();
}
}
} catch ( KettleDatabaseException e ) {
logError( BaseMessages.getString( PKG, "CombinationLookup.Log.UnexpectedError" ) + " : " + e.toString() );
} finally {
data.db.disconnect();
}
}
super.dispose( smi, sdi );
}
代码示例来源:origin: pentaho/pentaho-kettle
@Override
public void dispose( StepMetaInterface smi, StepDataInterface sdi ) {
meta = (DimensionLookupMeta) smi;
data = (DimensionLookupData) sdi;
if ( data.db != null ) {
try {
if ( !data.db.isAutoCommit() ) {
if ( getErrors() == 0 ) {
data.db.commit();
} else {
data.db.rollback();
}
}
} catch ( KettleDatabaseException e ) {
logError( BaseMessages.getString( PKG, "DimensionLookup.Log.ErrorOccurredInProcessing" ) + e.getMessage() );
} finally {
data.db.disconnect();
}
}
super.dispose( smi, sdi );
}
}
代码示例来源:origin: pentaho/pentaho-kettle
public void commit( boolean force ) throws KettleDatabaseException {
try {
// Don't do the commit, wait until the end of the transformation.
// When the last database copy (opened counter) is about to be closed, we
// do a commit
// There is one catch, we need to catch the rollback
// The transformation will stop everything and then we'll do the rollback.
// The flag is in "performRollback", private only
//
if ( !Utils.isEmpty( connectionGroup ) && !force ) {
return;
}
if ( getDatabaseMetaData().supportsTransactions() ) {
if ( log.isDebug() ) {
log.logDebug( "Commit on database connection [" + toString() + "]" );
}
connection.commit();
nrExecutedCommits++;
} else {
if ( log.isDetailed() ) {
log.logDetailed( "No commit possible on database connection [" + toString() + "]" );
}
}
} catch ( Exception e ) {
if ( databaseMeta.supportsEmptyTransactions() ) {
throw new KettleDatabaseException( "Error comitting connection", e );
}
}
}
代码示例来源:origin: pentaho/pentaho-kettle
commit();
} catch ( KettleDatabaseException ex ) {
代码示例来源:origin: pentaho/pentaho-kettle
public void dispose( StepMetaInterface smi, StepDataInterface sdi ) {
meta = (DBProcMeta) smi;
data = (DBProcData) sdi;
if ( data.db != null ) {
// CHE: Properly close the callable statement
try {
data.db.closeProcedureStatement();
} catch ( KettleDatabaseException e ) {
logError( BaseMessages.getString( PKG, "DBProc.Log.CloseProcedureError" ) + e.getMessage() );
}
try {
if ( !meta.isAutoCommit() ) {
data.db.commit();
}
} catch ( KettleDatabaseException e ) {
logError( BaseMessages.getString( PKG, "DBProc.Log.CommitError" ) + e.getMessage() );
} finally {
data.db.disconnect();
}
}
super.dispose( smi, sdi );
}
代码示例来源:origin: pentaho/pentaho-kettle
public void dispose( StepMetaInterface smi, StepDataInterface sdi ) {
meta = (DeleteMeta) smi;
data = (DeleteData) sdi;
if ( data.db != null ) {
try {
if ( !data.db.isAutoCommit() ) {
if ( getErrors() == 0 ) {
data.db.commit();
} else {
data.db.rollback();
}
}
data.db.closeUpdate();
} catch ( KettleDatabaseException e ) {
logError( BaseMessages.getString( PKG, "Delete.Log.UnableToCommitUpdateConnection" )
+ data.db + "] :" + e.toString() );
setErrors( 1 );
} finally {
data.db.disconnect();
}
}
super.dispose( smi, sdi );
}
代码示例来源:origin: pentaho/pentaho-kettle
public void dispose( StepMetaInterface smi, StepDataInterface sdi ) {
meta = (InsertUpdateMeta) smi;
data = (InsertUpdateData) sdi;
if ( data.db != null ) {
try {
if ( !data.db.isAutoCommit() ) {
if ( getErrors() == 0 ) {
data.db.commit();
} else {
data.db.rollback();
}
}
data.db.closeUpdate();
data.db.closeInsert();
} catch ( KettleDatabaseException e ) {
logError( BaseMessages.getString( PKG, "InsertUpdate.Log.UnableToCommitConnection" ) + e.toString() );
setErrors( 1 );
} finally {
data.db.disconnect();
}
}
super.dispose( smi, sdi );
}
代码示例来源:origin: pentaho/pentaho-kettle
@Override
public void dispose( StepMetaInterface smi, StepDataInterface sdi ) {
meta = (ExecSQLRowMeta) smi;
data = (ExecSQLRowData) sdi;
if ( log.isBasic() ) {
logBasic( BaseMessages.getString( PKG, "ExecSQLRow.Log.FinishingReadingQuery" ) );
}
if ( data.db != null ) {
try {
if ( !data.db.isAutoCommit() ) {
if ( getErrors() == 0 ) {
data.db.commit();
} else {
data.db.rollback();
}
}
} catch ( KettleDatabaseException e ) {
logError( BaseMessages.getString( PKG, "Update.Log.UnableToCommitUpdateConnection" )
+ data.db + "] :" + e.toString() );
setErrors( 1 );
} finally {
data.db.disconnect();
}
}
super.dispose( smi, sdi );
}
代码示例来源:origin: pentaho/pentaho-kettle
/**
* Execute fastload.
*
* @throws KettleException
* ...
*/
public void execute() throws KettleException {
if ( this.meta.getTruncateTable().getValue() ) {
Database db = new Database( this, this.meta.getDbMeta() );
db.connect();
db.truncateTable( this.meta.getTargetTable().getValue() );
db.commit();
db.disconnect();
}
startFastLoad();
if ( this.meta.getUseControlFile().getValue() ) {
this.invokeLoadingControlFile();
} else {
this.invokeLoadingCommand();
}
}
代码示例来源:origin: pentaho/pentaho-kettle
} finally {
if ( !db.isAutoCommit() ) {
db.commit( true );
代码示例来源:origin: pentaho/pentaho-kettle
repository.connectionDelegate.getDatabase().commit();
代码示例来源:origin: pentaho/pentaho-kettle
database.commit( true );
log.logBasic( BaseMessages.getString( PKG, "Trans.Exception.TransactionsCommittedOnConnection", database
.toString() ) );
代码示例来源:origin: pentaho/pentaho-kettle
data.db.commit();
代码示例来源:origin: pentaho/pentaho-kettle
if ( !data.db.isAutoCommit() ) {
if ( meta.getCommitSize() == 1 ) {
data.db.commit();
} else if ( getLinesWritten() % meta.getCommitSize() == 0 ) {
data.db.commit();
内容来源于网络,如有侵权,请联系作者删除!