protected void createSequence ( PersistenceBroker broker , FieldDescriptor field , String sequenceName , long maxKey ) throws Exception { Statement stmt = null ; try { stmt = broker . serviceStatementManager ( ) . getGenericStatement ( field . getClassDescriptor ( ) , Query . NOT_SCROLLABLE ) ; stmt . execute ( sp_createSequenceQuery ( sequenceName , maxKey ) ) ; } catch ( Exception e ) { log . error ( e ) ; throw new SequenceManagerException ( "Could not create new row in " + SEQ_TABLE_NAME + " table - TABLENAME=" + sequenceName + " field=" + field . getColumnName ( ) , e ) ; } finally { try { if ( stmt != null ) stmt . close ( ) ; } catch ( SQLException sqle ) { if ( log . isDebugEnabled ( ) ) log . debug ( "Threw SQLException while in createSequence and closing stmt" , sqle ) ; // ignore it } } }
Creates new row in table