本文整理汇总了Java中org.pentaho.di.core.database.Database.setCommit方法的典型用法代码示例。如果您正苦于以下问题:Java Database.setCommit方法的具体用法?Java Database.setCommit怎么用?Java Database.setCommit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.pentaho.di.core.database.Database
的用法示例。
在下文中一共展示了Database.setCommit方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: endProcessing
import org.pentaho.di.core.database.Database; //导入方法依赖的package包/类
private boolean endProcessing() throws KettleJobException
{
LogStatus status;
if (!isActive()) {
if (isStopped()) {
status = LogStatus.STOP;
} else {
status = LogStatus.END;
}
} else {
status = LogStatus.RUNNING;
}
try
{
if (errors.get()==0 && result!=null && !result.getResult()) {
errors.incrementAndGet();
}
logDate = new Date();
/*
* Sums errors, read, written, etc.
*/
JobLogTable jobLogTable = jobMeta.getJobLogTable();
if (jobLogTable.isDefined()) {
String tableName = jobMeta.getJobLogTable().getActualTableName();
DatabaseMeta logcon = jobMeta.getJobLogTable().getDatabaseMeta();
Database ldb = new Database(this, logcon);
ldb.shareVariablesWith(this);
try
{
ldb.connect();
ldb.setCommit(logCommitSize);
ldb.writeLogRecord(jobMeta.getJobLogTable(), status, this, null);
}
catch(KettleDatabaseException dbe)
{
addErrors(1);
throw new KettleJobException("Unable to end processing by writing log record to table "+tableName, dbe);
}
finally
{
if (!ldb.isAutoCommit()) ldb.commit(true);
ldb.disconnect();
}
}
return true;
}
catch(Exception e)
{
throw new KettleJobException(e); // In case something else goes wrong.
}
}