Package com.softwaremining.sql
Class ESQLBaseService
java.lang.Object
com.softwaremining.logic.BaseService
com.softwaremining.sql.ESQLBaseService
- All Implemented Interfaces:
IBaseService,Service,SQLHandlerInterface,IDisplayable,Runnable
- Direct Known Subclasses:
CicsBaseService,ILEBaseService,KeyGenerator
Embedded-SQL BaseService - supporting business logic part of programs with Embedded-SQL
-
Field Summary
FieldsFields inherited from class com.softwaremining.logic.BaseService
calledParameters, log, PARA_NAME_POSTFIX, profiled_baseService_runtimes, totalRuntime_processControlException, totalRuntime_reflectionFields inherited from interface com.softwaremining.ui.IDisplayable
_FKEY_INPUT, _INVALIDATE, FKEY_1, FKEY_10, FKEY_11, FKEY_12, FKEY_2, FKEY_3, FKEY_4, FKEY_5, FKEY_6, FKEY_7, FKEY_8, FKEY_9Fields inherited from interface com.softwaremining.sql.SQLHandlerInterface
HANDLER_CONTINUE, HANDLER_GO_TO, HANDLER_METHOD_CALL, HANDLER_NOT_INTIALIZED, HANDLER_PERFORM, HANDLER_STOP, HANDLER_THROW, SQL_SCHEMA_PROP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidRollback changes made by all instances of ESQLProcessorprotected voidcloseESQLProcessors(boolean releaseConnection) for internal use onlyvoidcommit()voidCommit all the active ESQLProcessorsprotected voiddestroy()Close connection all instances of ESQLProcessor Automatically called after exiting a program (normal exit, Go-Back).protected voidAutomatically called after fatal errorvoidAutomatically called after CANCELing (ServicesFactory.cancel) running a program - it removes all wrapperListsvoiddoFinalize(boolean forceRelease, boolean releaseConnection) Automatically called after CANCELing (ServicesFactory.cancel) running a program - it removes all wrapperListsvoidin ESQL projects commits are manually made e.g EXEC SQL COMMIT END-EXEC Hence turn the auto-commit off during initializationvoidpopulateFromLastSQLMessage(ISMBean sqlca, ISMDataType messageArea, long length) Translation of CICS DSNTIARvoidpopulateFromLastSQLMessage(ISMDataType _dfheiblk, ISMDataType _dfhcommarea, ISMDataType sqlca, ISMDataType messageArea, long length) Translation of CICS DSNTIARvoidprocessSQLException(SQLException e, int handler, String forward) protected intprocessSQLException(SQLException e, ISMBean sqlca, int rowCount, boolean afterEndOfResultSet) used for internal SQL Handlingvoidquit()Commit changes made by all instances of ESQLProcessorvoidWhen the using connection strategy Config.CONNECTION_STRATEGY_SHARE_ESQL_SESSION_CONN the system will release Connections only when Garbage Collector releases the owning ESQLBaseService class.static voidresetSQLCA(ISMBean sqlca) voidrollback()Rollback ALL the active ESQLProcessors Only works when AUTO-COMMIT is switched off in db.properties.voidsetErrorHandler(int errorHandler) voidsetErrorHandler(int errorHandler, String errorHandlerForward) voidsetErrorHandlerForward(String errorHandlerForward) voidsetNotFoundHandler(int notFoundHandler) voidsetNotFoundHandler(int notFoundHandler, String notFoundHandlerForward) used for translation of SQL EXEC SQL WHENEVER NOT FOUND GO TO ...voidsetNotFoundHandlerForward(String notFoundHandlerForward) voidsetSessionSchemaName(String schemaName) Allows to dynamically change the SCHEMA_NAME (as defined in db.properties).voidsetWarningHandler(int warningHandler) voidsetWarningHandler(int warningHandler, String warningHandlerForward) Methods inherited from class com.softwaremining.logic.BaseService
_goto, accept, addCallParameter, addCallParameter, addCallParameter, addCallParameter, addCallParameter, addCallParameter, addCallParameter, addCallParameter, addRuntimeParameter, addRuntimeParameter, assignCallerProgram, assignCyclicBarrier, assignInstanceNumber, assignLastKeyPressed, assignLaunchedInstances, assignPCBFile, assignTargetXMLScreen, assignUsesAnnotationBasedMethodOrdering, awaitBarrier, callJavaMethod, callJavaMethod, chain, clearCallingParameters, commitAndReleaseConnection, countCallParameters, currentDate, disableGUIScreens, doFinalize, enableReuse, execute, execute, execute, execute, execute, execute, execute, execute, executeWithPointerData, executeWithPointerData, getActiveBeanInstance, getCallerProgram, getDataWrappers, getField, getLastDisplayColumn, getLastDisplayRow, getMethodNumber, getNextPoint, getParagraph, getReportProcessorList, getReturnCode, getScreenClassName, getScreenClient, getServletRunTimeParameterFrom, getSessionId, getWrapperList, getXMLScreenDefReader, goBack, hasReflectionBasedFlowLogic, invoke, invokeRange, isCallerWaiting, isCicsAutoSyncPointEnabled, isFirstInstance, isGUIScreensEnabled, isTargetXMLScreen, main, makeUpClassScreenSourceName, objectsAreOfTheSameClass, optimizeUsingTransfuseByReference, popNextRuntimeParameter, processCicsAbendException, receiveExecuteParameter, receiveExecuteParameter, receiveExecuteParameter, receiveExecuteParameter, receiveExecuteParameter, registerDataWrapper, registerDataWrappers, registerExecuteParameters, reInitializeAllDAOs, reInitializeBaseService, reRegisterExecuteParameters, retrieveCalledParameters, retrieveCyclicBarrier, retrieveField, retrieveInstanceNumber, retrieveLastKeyPressed, retrieveLaunchedInstances, retrieveTotalNumberOfInstancesLaunched, run, setCallerWaiting, setCommandLineParameters, setExceptionalExitReturnCode, setHttpRequestParameterMap, setLastDisplayColumn, setLastDisplayRow, setReturnCode, setReturnCode, setReturnCode, setScreenClient, setSessionId, setUsesAnnotationBasedMethodOrdering, startUp, stop, stop, tearDown, transfuse, transfuseByReference
-
Field Details
-
staticLogger
-
totalRuntime
public static long totalRuntimefor internal use only ... profiling information
-
-
Constructor Details
-
ESQLBaseService
-
ESQLBaseService
public ESQLBaseService()
-
-
Method Details
-
setErrorHandler
public void setErrorHandler(int errorHandler) -
setErrorHandlerForward
-
setNotFoundHandler
public void setNotFoundHandler(int notFoundHandler) -
setNotFoundHandlerForward
-
setWarningHandler
public void setWarningHandler(int warningHandler) -
setErrorHandler
-
setWarningHandler
-
setNotFoundHandler
used for translation of SQL EXEC SQL WHENEVER NOT FOUND GO TO ...- Parameters:
notFoundHandler- - type : HANDLER_GO_TO , HANDLER_STOP , HANDLER_GO_TO = 2, HANDLER_THROW = 3notFoundHandlerForward- - method name. The framework applies a GO TO call startegy to the method. If the program is using standard java method calling strategy - the method is called and control is passed back .
-
processSQLException
protected int processSQLException(SQLException e, ISMBean sqlca, int rowCount, boolean afterEndOfResultSet) throws CBLException used for internal SQL Handling- Parameters:
e-sqlca-notFound-- Throws:
CBLException
-
processSQLException
- Throws:
CBLException
-
initializeBaseService
public void initializeBaseService()in ESQL projects commits are manually made e.g EXEC SQL COMMIT END-EXEC Hence turn the auto-commit off during initialization- Overrides:
initializeBaseServicein classBaseService
-
abort
Rollback changes made by all instances of ESQLProcessor- Overrides:
abortin classBaseService
-
quit
public void quit()Commit changes made by all instances of ESQLProcessor- Overrides:
quitin classBaseService
-
commit
public void commit() -
commitThrowingException
Commit all the active ESQLProcessors- Throws:
SQLException
-
rollback
public void rollback()Rollback ALL the active ESQLProcessors Only works when AUTO-COMMIT is switched off in db.properties. If autocommit is on, then usesqlprocessor.prepare("ROLLBACK"); sqlprocessor.executeUpdate();, -
destroy
protected void destroy()Close connection all instances of ESQLProcessor Automatically called after exiting a program (normal exit, Go-Back). and prepare for GC- Overrides:
destroyin classBaseService
-
destroyOnFatalError
protected void destroyOnFatalError()Description copied from class:BaseServiceAutomatically called after fatal error- Overrides:
destroyOnFatalErrorin classBaseService
-
releaseESQLConnections
public void releaseESQLConnections()When the using connection strategy Config.CONNECTION_STRATEGY_SHARE_ESQL_SESSION_CONN the system will release Connections only when Garbage Collector releases the owning ESQLBaseService class. This method will force the connection to be closed -
doFinalize
public void doFinalize()Automatically called after CANCELing (ServicesFactory.cancel) running a program - it removes all wrapperLists- Overrides:
doFinalizein classBaseService
-
doFinalize
public void doFinalize(boolean forceRelease, boolean releaseConnection) Automatically called after CANCELing (ServicesFactory.cancel) running a program - it removes all wrapperLists- Overrides:
doFinalizein classBaseService
-
closeESQLProcessors
protected void closeESQLProcessors(boolean releaseConnection) for internal use only -
getESQLProcessors
-
setSessionSchemaName
Allows to dynamically change the SCHEMA_NAME (as defined in db.properties). The new SCHEMA_NAME only applies to the SQL access in current session.- Parameters:
schemaName-
-
resetSQLCA
-
populateFromLastSQLMessage
public void populateFromLastSQLMessage(ISMDataType _dfheiblk, ISMDataType _dfhcommarea, ISMDataType sqlca, ISMDataType messageArea, long length) Translation of CICS DSNTIAR- Specified by:
populateFromLastSQLMessagein interfaceIBaseService- Overrides:
populateFromLastSQLMessagein classBaseService- Parameters:
_dfheiblk- *UNUSED*_dfhcommarea- *UNUSED*sqlca-messageArea-length-
-
populateFromLastSQLMessage
Translation of CICS DSNTIAR- Specified by:
populateFromLastSQLMessagein interfaceIBaseService- Overrides:
populateFromLastSQLMessagein classBaseService
-