org.pentaho.di.core.database.Database.getNextValue()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(118)

本文整理了Java中org.pentaho.di.core.database.Database.getNextValue()方法的一些代码示例,展示了Database.getNextValue()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Database.getNextValue()方法的具体详情如下:
包路径:org.pentaho.di.core.database.Database
类名称:Database
方法名:getNextValue

Database.getNextValue介绍

暂无

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

public synchronized Long getNextValue( Hashtable<String, Counter> counters, String tableName, String val_key )
 throws KettleDatabaseException {
 return getNextValue( counters, null, tableName, val_key );
}

代码示例来源:origin: pentaho/pentaho-kettle

@Override
public Long getNextBatchIdUsingLockTables( DatabaseMeta dbm, Database ldb, String schemaName, String tableName,
 String fieldName ) throws KettleDatabaseException {
 Long rtn = null;
 // Make sure we lock that table to avoid concurrency issues
 ldb.lockTables( new String[] { dbm.getQuotedSchemaTableCombination( schemaName, tableName ), } );
 try {
  rtn = ldb.getNextValue( null, schemaName, tableName, fieldName );
 } finally {
  ldb.unlockTables( new String[] { tableName, } );
 }
 return rtn;
}

代码示例来源:origin: pentaho/pentaho-kettle

public Long getNextBatchIdUsingLockTables( DatabaseMeta dbm, Database ldb, String schemaName, String tableName,
 String fieldName ) throws KettleDatabaseException {
 // The old way of doing things...
 Long rtn = null;
 // Make sure we lock that table to avoid concurrency issues
 String schemaAndTable = dbm.getQuotedSchemaTableCombination( schemaName, tableName );
 ldb.lockTables( new String[] { schemaAndTable, } );
 try {
  // Now insert value -1 to create a real write lock blocking the other
  // requests.. FCFS
  String sql = "INSERT INTO " + schemaAndTable + " (" + dbm.quoteField( fieldName ) + ") values (-1)";
  ldb.execStatement( sql );
  // Now this next lookup will stall on the other connections
  //
  rtn = ldb.getNextValue( null, schemaName, tableName, fieldName );
 } finally {
  // Remove the -1 record again...
  String sql = "DELETE FROM " + schemaAndTable + " WHERE " + dbm.quoteField( fieldName ) + "= -1";
  ldb.execStatement( sql );
  ldb.unlockTables( new String[] { schemaAndTable, } );
 }
 return rtn;
}

代码示例来源:origin: pentaho/pentaho-kettle

data.db.getNextValue( getTransMeta().getCounters(), data.realSchemaName, data.realTableName, meta
  .getTechnicalKeyField() );
break;

代码示例来源:origin: pentaho/pentaho-kettle

data.db.getNextValue( getTrans().getCounters(), data.realSchemaName, data.realTableName, meta
  .getKeyField() );
break;
 data.db.getNextValue( getTrans().getCounters(), data.realSchemaName, data.realTableName, meta
  .getKeyField() );

相关文章

微信公众号

最新文章

更多