public class MaxSequenceProvider extends java.lang.Object implements FixedLoggers
Modifier and Type | Class and Description |
---|---|
class |
MaxSequenceProvider.EmptyLogger
This logger is used when the provider isn't running as part of MXServer
|
APPLOGGER, CRONTASKLOGGER, CRONTASKMGRLOGGER, CRONTASKMGRSQLLOGGER, DBCONNECTIONLOGGER, DDLOGGER, DMLOGGER, EVENTLOGGER, EXCEPTIONLOGGER, MAILLOGGER, MAXIMOLOGGER, MTLOGGER, NULLMBOPOINTER, SECURITY, SENDFAILEDLOGGER, SERVICELOGGER, SQLLOGGER
appenderPrefix, LOGGERNAME_APP, LOGGERNAME_CRONTASK, LOGGERNAME_CRONTASKMGR, LOGGERNAME_DBCONNECTION, LOGGERNAME_DD, LOGGERNAME_DM, LOGGERNAME_DMPREVIEW, LOGGERNAME_EVENT, LOGGERNAME_EXCEPTION, LOGGERNAME_MAIL, LOGGERNAME_MAXIMO, LOGGERNAME_MT, LOGGERNAME_NULLMBOPOINTER, LOGGERNAME_SECURITY, LOGGERNAME_SENDFAILED, LOGGERNAME_SERVICE, LOGGERNAME_SQL, LOGGERNAME_SQL_CRONTASKMGR, LOGGERNAME_TXN, loggerPrefix
Constructor and Description |
---|
MaxSequenceProvider() |
MaxSequenceProvider(MXLogger methodLogger,
MXLogger sqlLogger) |
Modifier and Type | Method and Description |
---|---|
boolean |
exists(java.sql.Connection con,
java.lang.String query)
Helper method returns true if the query returns a row.
|
java.lang.Long |
getUniqueID(java.sql.Connection con,
java.lang.String seqName)
Return the next value for the sequence.
|
long |
getUniqueID(java.sql.Connection conn,
java.lang.String tbname,
java.lang.String name)
Returns a uniqueID for a given table and column defined in maxsequence table.
|
void |
init(java.sql.Connection con)
Calls
init with second parameter True, to load all sequences. |
void |
init(java.sql.Connection conn,
boolean loadAll)
Initializes the sequences.
|
java.lang.Long |
reserveMultiple(java.sql.Connection con,
java.lang.String seqName,
int numToReserve) |
static void |
resetProviders() |
void |
resetSequence(java.sql.Connection connection,
java.lang.String sequence)
It has been found that this sequence has invalid values for it in MaxSequence.
|
public static void resetProviders()
public void init(java.sql.Connection con) throws java.lang.Exception
init
with second parameter True, to load all sequences.con
- java.lang.Exception
public void init(java.sql.Connection conn, boolean loadAll) throws java.sql.SQLException
con
- ConnectionloadAll
- True will load all sequences. False, and this method does nothing.java.sql.SQLException
public boolean exists(java.sql.Connection con, java.lang.String query) throws java.sql.SQLException
java.sql.SQLException
public java.lang.Long getUniqueID(java.sql.Connection con, java.lang.String seqName) throws java.sql.SQLException
java.sql.SQLException
public long getUniqueID(java.sql.Connection conn, java.lang.String tbname, java.lang.String name) throws java.lang.Exception
con
- Database connectiontbname
- Table namename
- Column name in the associated table (tbname) for which the unique number is generated.java.lang.Exception
Maximum possible value returned.
public void resetSequence(java.sql.Connection connection, java.lang.String sequence) throws java.sql.SQLException
connection
- Connection to the databasesequence
- The sequence to resetjava.lang.Exception
java.sql.SQLException
public java.lang.Long reserveMultiple(java.sql.Connection con, java.lang.String seqName, int numToReserve) throws java.sql.SQLException
java.sql.SQLException