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

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

本文整理了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

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

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

  1. @Override
  2. public Long getNextBatchIdUsingLockTables( DatabaseMeta dbm, Database ldb, String schemaName, String tableName,
  3. String fieldName ) throws KettleDatabaseException {
  4. Long rtn = null;
  5. // Make sure we lock that table to avoid concurrency issues
  6. ldb.lockTables( new String[] { dbm.getQuotedSchemaTableCombination( schemaName, tableName ), } );
  7. try {
  8. rtn = ldb.getNextValue( null, schemaName, tableName, fieldName );
  9. } finally {
  10. ldb.unlockTables( new String[] { tableName, } );
  11. }
  12. return rtn;
  13. }

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

  1. public Long getNextBatchIdUsingLockTables( DatabaseMeta dbm, Database ldb, String schemaName, String tableName,
  2. String fieldName ) throws KettleDatabaseException {
  3. // The old way of doing things...
  4. Long rtn = null;
  5. // Make sure we lock that table to avoid concurrency issues
  6. String schemaAndTable = dbm.getQuotedSchemaTableCombination( schemaName, tableName );
  7. ldb.lockTables( new String[] { schemaAndTable, } );
  8. try {
  9. // Now insert value -1 to create a real write lock blocking the other
  10. // requests.. FCFS
  11. String sql = "INSERT INTO " + schemaAndTable + " (" + dbm.quoteField( fieldName ) + ") values (-1)";
  12. ldb.execStatement( sql );
  13. // Now this next lookup will stall on the other connections
  14. //
  15. rtn = ldb.getNextValue( null, schemaName, tableName, fieldName );
  16. } finally {
  17. // Remove the -1 record again...
  18. String sql = "DELETE FROM " + schemaAndTable + " WHERE " + dbm.quoteField( fieldName ) + "= -1";
  19. ldb.execStatement( sql );
  20. ldb.unlockTables( new String[] { schemaAndTable, } );
  21. }
  22. return rtn;
  23. }

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

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

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

  1. data.db.getNextValue( getTrans().getCounters(), data.realSchemaName, data.realTableName, meta
  2. .getKeyField() );
  3. break;
  4. data.db.getNextValue( getTrans().getCounters(), data.realSchemaName, data.realTableName, meta
  5. .getKeyField() );

相关文章