Java Doc for GenericLanguageConnectionContext.java in  » Database-DBMS » db-derby-10.2 » org » apache » derby » impl » sql » conn » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database DBMS » db derby 10.2 » org.apache.derby.impl.sql.conn 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.derby.iapi.services.context.ContextImpl
      org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext

GenericLanguageConnectionContext
public class GenericLanguageConnectionContext extends ContextImpl implements LanguageConnectionContext(Code)
LanguageConnectionContext keeps the pool of prepared statements, activations, and cursors in use by the current connection.

The generic impl does not provide statement caching.
author:
   ames



Field Summary
protected  AccessFactoryaf
    
protected  Authorizerauthorizer
    
protected  intbindCount
    
protected  TransactionControllerchildTransaction
     If non-null indicates that a nested user transaction is in progress.
protected  LanguageConnectionFactoryconnFactory
    
protected  DataValueFactorydataFactory
    
protected  intisolationLevel
    
protected  LanguageFactorylangFactory
    
protected  longnextCursorId
    
protected  intnextSavepointId
    
protected  OptimizerFactoryof
    
protected  intoutermostTrigger
    
protected  intprepareIsolationLevel
    
protected  intqueryNestingDepth
     queryNestingDepth is a counter used to keep track of how many calls have been made to begin nested transactions.
protected  SchemaDescriptorsd
    
public  CacheManagerstatementCache
    
protected  TypeCompilerFactorytcf
    
protected  TransactionControllertran
     The transaction to use within this language connection context.
protected  StringuserName
    

Constructor Summary
public  GenericLanguageConnectionContext(ContextManager cm, TransactionController tranCtrl, LanguageFactory lf, LanguageConnectionFactory lcf, Database db, String userName, int instanceNumber, String drdaID, String dbname)
    

Method Summary
public  voidaddActivation(Activation a)
     Add the activation to those known about by this connection.
public  voidaddDeclaredGlobalTempTable(TableDescriptor td)
    
public  booleananyoneBlocked()
    
public  StringBufferappendErrorInfo()
    
public  voidappendOptimizerTraceOutput(String output)
    
public  voidautoincrementCreateCounter(String s, String t, String c, Long initialValue, long increment, int position)
    
public  voidautoincrementFlushCache(UUID tableUUID)
     Flush the cache of autoincrement values being kept by the lcc.
public  voidbeginNestedTransaction(boolean readOnly)
     Start a Nested User Transaction (NUT) with the store.
public  booleancheckIfAnyDeclaredGlobalTempTablesForThisConnection()
    
public  voidcleanupOnError(Throwable error)
     If worse than a transaction error, everything goes; we rely on other contexts to kill the context manager for this session.

If a transaction error, act like we saw a rollback.

If more severe or a java error, the outer cleanup will shutdown the connection, so we don't have to clean up.

REMIND: connection should throw out all contexts and start over when the connection is closed...

public  voidcommitNestedTransaction()
    
public  StringconvertIdentifierCase(String id)
     Convert an identifier to the proper case for this connection.
public  voidcopyHashtableToAIHT(Hashtable from)
     Copies an existing hashtable of autoincrement mappings into autoincrementHT, the cache of autoincrement values kept in the languageconnectioncontext.
final public  booleandataDictionaryInWriteMode()
    
public  intdecrementBindCount()
    
protected  voiddoCommit(boolean commitStore, boolean sync, int commitflag, boolean requestedByUser)
     This is where the work on internalCommit(), userCOmmit() and internalCommitNoSync() actually takes place.

When a commit happens, the language connection context will close all open activations/cursors and commit the Store transaction.

REVISIT: we talked about having a LanguageTransactionContext, but since store transaction management is currently in flux and our context might want to delegate to that context, for now all commit/rollback actions are handled directly by the language connection context. REVISIT: this may need additional alterations when RELEASE SAVEPOINT/ROLLBACK TO SAVEPOINT show up.

Since the access manager's own context takes care of its own resources on commit, and the transaction stays open, there is nothing that this context has to do with the transaction controller.

Also, tell the data dictionary that the transaction is finished, if necessary (that is, if the data dictionary was put into DDL mode in this transaction.
Parameters:
  commitStore - true if we should commit the Store transaction
Parameters:
  sync - true means do a synchronized commit,false means do an unsynchronized commit
Parameters:
  commitflag - if this is an unsynchronized commit, the flags topass to commitNoSync in the store'sTransactionController.

public  booleandropDeclaredGlobalTempTable(String tableName)
    
public  voidemptyCache()
     Empty as much of the cache as possible.
public  AccessFactorygetAccessFactory()
    
public  intgetActivationCount()
     Return the number of activations known for this connection.
public  StringgetAuthorizationId()
    
public  AuthorizergetAuthorizer()
    
public  booleangetAutoincrementUpdate()
    
public  intgetBindCount()
    
public  intgetCacheSize()
    
public  intgetCurrentIsolationLevel()
    
public  StringgetCurrentIsolationLevelStr()
    
public  StringgetCurrentSchemaName()
    
public  DataDictionarygetDataDictionary()
    
public  DataValueFactorygetDataValueFactory()
     Get the data value factory to use with this language connection context.
public  DatabasegetDatabase()
    
public  StringgetDbname()
    
public  StringgetDeclaredGlobalTemporaryTablesSchemaName()
     Get the declared global temporary tables schema name.
public  SchemaDescriptorgetDefaultSchema()
    
public  StringgetDrdaID()
    
public  ExecutionContextgetExecutionContext()
    
public  intgetIdentifierCasing()
     Get casing for delimited identifiers.
public  LonggetIdentityValue()
     Get the identity column value most recently generated.
public  intgetInstanceNumber()
    
public  LanguageConnectionFactorygetLanguageConnectionFactory()
     Get the language connection factory to use with this language connection context.
public  LanguageFactorygetLanguageFactory()
     Get the language factory to use with this language connection context.
public  ActivationgetLastActivation()
    
public  intgetLockEscalationThreshold()
     get the lock escalation threshold.
public  ObjectgetLockObject(int lockScope)
     Get the lock handle for the current transaction.
public  booleangetLogQueryPlan()
    
public  booleangetLogStatementText()
    
public  OptimizerFactorygetOptimizerFactory()
    
public  booleangetOptimizerTrace()
    
public  booleangetOptimizerTraceHtml()
    
public  StringgetOptimizerTraceOutput()
    
public  intgetPrepareIsolationLevel()
    
public  booleangetRunTimeStatisticsMode()
    
public  RunTimeStatisticsgetRunTimeStatisticsObject()
    
public  StatementContextgetStatementContext()
    
public  intgetStatementDepth()
     Reports how many statement levels deep we are.
public  booleangetStatisticsTiming()
    
public  StringgetSysIBMSchemaName()
     Get the name of the SYSIBM schema.
public  StringgetSystemDiagSchemaName()
     Get the name of the SYSCS_DIAG schema.
public  StringgetSystemSchemaName()
     Get the name of the system schema.
public  StringgetSystemUtilSchemaName()
     Get the name of the SYSCS_UTIL schema.
public  TableDescriptorgetTableDescriptorForDeclaredGlobalTempTable(String tableName)
    
public  TransactionControllergetTransactionCompile()
     Get the transaction controller to use at compile time with this language connection context.
public  TransactionControllergetTransactionExecute()
    
public  TriggerExecutionContextgetTriggerExecutionContext()
     Get the topmost tec.
public  TableDescriptorgetTriggerTable()
    
public  StringgetUniqueCursorName()
     Get a connection unique system generated name for a cursor.
public  intgetUniqueSavepointID()
     Get a connection unique system generated id for an unnamed savepoint.
public  StringgetUniqueSavepointName()
     Get a connection unique system generated name for an unnamed savepoint.
public  intincrementBindCount()
    
protected  SchemaDescriptorinitDefaultSchemaDescriptor()
    
public  voidinitialize(boolean sqlConnection)
    
public  voidinternalCommit(boolean commitStore)
     Do a commit as appropriate for an internally generated commit (e.g.
final public  voidinternalCommitNoSync(int commitflag)
     Commit the language transaction by doing a commitNoSync() on the store's TransactionController.

Do *NOT* tell the data dictionary that the transaction is finished.

public  voidinternalRollback()
     Do a rollback as appropriate for an internally generated rollback (e.g.
public  voidinternalRollbackToSavepoint(String savepointName, boolean refreshStyle, Object kindOfSavepoint)
     Let the context deal with a rollback to savepoint
Parameters:
  savepointName - Name of the savepoint that needs to be rolled back
Parameters:
  refreshStyle - boolean indicating whether or not the controller should closeopen conglomerates and scans.
public  booleanisIsolationLevelSetUsingSQLorJDBC()
    
public  booleanisLastHandler(int severity)
    
public  booleanisReadOnly()
    
public  booleanisTransactionPristine()
     Reports whether there is any outstanding work in the transaction.
public  voidlanguageSetSavePoint(String savepointName, Object kindOfSavepoint)
     Sets a savepoint.
public  LonglastAutoincrementValue(String schemaName, String tableName, String columnName)
     Implements ConnectionInfo.lastAutoincrementValue. lastAutoincrementValue searches for the last autoincrement value inserted into a column specified by the user.
public  CursorActivationlookupCursorActivation(String cursorName)
     See if a given cursor is available for use. if so return its activation.
public  PreparedStatementlookupStatement(GenericStatement statement)
     See if a given statement has already been compiled for this user, and if so use its prepared statement.
public  voidmarkTempTableAsModifiedInUnitOfWork(String tableName)
    
public  longnextAutoincrementValue(String schemaName, String tableName, String columnName)
     returns the next value to be inserted into an autoincrement col. This is used internally by the system to generate autoincrement values which are going to be inserted into a autoincrement column.
public  voidnotifyUnusedActivation()
    
public  voidpopCompilerContext(CompilerContext cc)
     Pop a CompilerContext off the context stack.
public  voidpopExecutionStmtValidator(ExecutionStmtValidator validator)
     Remove the validator.
public  voidpopStatementContext(StatementContext statementContext, Throwable error)
     Pop a StatementContext of the context stack.
public  voidpopTriggerExecutionContext(TriggerExecutionContext tec)
     Remove the tec.
public  voidpopTriggerTable(TableDescriptor td)
     Remove the trigger table descriptor.
public  PreparedStatementprepareInternalStatement(SchemaDescriptor compilationSchema, String sqlText, boolean isForReadOnly, boolean forMetaData)
    
public  PreparedStatementprepareInternalStatement(String sqlText)
    
final public  CompilerContextpushCompilerContext()
     Push a CompilerContext on the context stack with the current default schema as the default schema which we compile against.
public  CompilerContextpushCompilerContext(SchemaDescriptor sd)
     Push a CompilerContext on the context stack with the passed in default schema as the default schema we compile against.
public  voidpushExecutionStmtValidator(ExecutionStmtValidator validator)
     Push a new execution statement validator.
public  StatementContextpushStatementContext(boolean isAtomic, boolean isForReadOnly, String stmtText, ParameterValueSet pvs, boolean rollbackParentContext, long timeoutMillis)
     Push a StatementContext on the context stack.
Parameters:
  isAtomic - whether this statement is atomic or not
Parameters:
  isForReadOnly - whether this statement is for a read only resultset
Parameters:
  stmtText - the text of the statement.
public  voidpushTriggerExecutionContext(TriggerExecutionContext tec)
     Push a new trigger execution context.
public  voidpushTriggerTable(TableDescriptor td)
     Set the trigger table descriptor.
public  voidreleaseSavePoint(String savepointName, Object kindOfSavepoint)
    
public  voidremoveActivation(Activation a)
     Remove the activation to those known about by this connection.
public  voidremoveStatement(Statement statement)
     This method will remove a statement from the statement cache.
public  voidresetFromPool()
     Reset the connection before it is returned (indirectly) by a PooledConnection object.
public  voidresetIsolationLevelFlagUsedForSQLandJDBC()
    
protected  voidresetStatementDepth()
     Resets the statementDepth.
public  voidsetAutoincrementUpdate(boolean flag)
    
final public  voidsetDataDictionaryWriteMode()
    
public  voidsetDefaultSchema(SchemaDescriptor sd)
     Set the default schema -- used by SET SCHEMA.
public  voidsetDrdaID(String drdaID)
    
public  voidsetIdentityValue(long val)
     Set the field of most recently generated identity column value.
public  voidsetIsolationLevel(int isolationLevel)
    
public  voidsetLogStatementText(boolean logStatementText)
    
public  booleansetOptimizerTrace(boolean onOrOff)
    
public  booleansetOptimizerTraceHtml(boolean onOrOff)
    
public  voidsetOptimizerTraceOutput(String startingText)
    
public  voidsetPrepareIsolationLevel(int level)
    
public  voidsetReadOnly(boolean on)
    
public  voidsetRunTimeStatisticsMode(boolean onOrOff)
    
public  voidsetRunTimeStatisticsObject(RunTimeStatistics runTimeStatisticsObject)
    
public  voidsetStatisticsTiming(boolean onOrOff)
    
public  voidsetTransaction(TransactionController tran)
     Sets the transaction controller to use with this language connection context.
public  voiduserCommit()
     Do a commmit as is appropriate for a user requested commit (e.g.
public  voiduserRollback()
     Do a rollback as is appropriate for a user requested rollback (e.g.
public  booleanusesSqlAuthorization()
    
public  voidvalidateStmtExecution(ConstantAction constantAction)
     Validate a statement.
public  booleanverifyAllHeldResultSetsAreClosed()
     Verify that there are no activations with open held result sets.
public  booleanverifyNoOpenResultSets(PreparedStatement pStmt, Provider provider, int action)
     Verify that there are no activations with open result sets on the specified prepared statement.
final public  voidxaCommit(boolean onePhase)
     Same as userCommit except commit a distributed transaction.
public  voidxaRollback()
     Same as userRollback() except rolls back a distrubuted transaction.

Field Detail
af
protected AccessFactory af(Code)



authorizer
protected Authorizer authorizer(Code)



bindCount
protected int bindCount(Code)



childTransaction
protected TransactionController childTransaction(Code)
If non-null indicates that a nested user transaction is in progress.



connFactory
protected LanguageConnectionFactory connFactory(Code)



dataFactory
protected DataValueFactory dataFactory(Code)



isolationLevel
protected int isolationLevel(Code)



langFactory
protected LanguageFactory langFactory(Code)



nextCursorId
protected long nextCursorId(Code)



nextSavepointId
protected int nextSavepointId(Code)



of
protected OptimizerFactory of(Code)



outermostTrigger
protected int outermostTrigger(Code)



prepareIsolationLevel
protected int prepareIsolationLevel(Code)



queryNestingDepth
protected int queryNestingDepth(Code)
queryNestingDepth is a counter used to keep track of how many calls have been made to begin nested transactions. Only the first call actually starts a Nested User Transaction with the store. Subsequent calls simply increment this counter. commitNestedTransaction only decrements the counter and when it drops to 0 actually commits the nested user transaction.



sd
protected SchemaDescriptor sd(Code)



statementCache
public CacheManager statementCache(Code)



tcf
protected TypeCompilerFactory tcf(Code)



tran
protected TransactionController tran(Code)
The transaction to use within this language connection context. It may be more appropriate to have it in a separate context (LanguageTransactionContext?). REVISIT (nat): I shoehorned the transaction context that the language uses into this class. The main purpose is so that the various language code can find out what its transaction is.



userName
protected String userName(Code)




Constructor Detail
GenericLanguageConnectionContext
public GenericLanguageConnectionContext(ContextManager cm, TransactionController tranCtrl, LanguageFactory lf, LanguageConnectionFactory lcf, Database db, String userName, int instanceNumber, String drdaID, String dbname) throws StandardException(Code)




Method Detail
addActivation
public void addActivation(Activation a) throws StandardException(Code)
Add the activation to those known about by this connection.



addDeclaredGlobalTempTable
public void addDeclaredGlobalTempTable(TableDescriptor td) throws StandardException(Code)

See Also:   LanguageConnectionContext.addDeclaredGlobalTempTable



anyoneBlocked
public boolean anyoneBlocked()(Code)
Return true if any transaction is blocked, even if not by this one



appendErrorInfo
public StringBuffer appendErrorInfo()(Code)



appendOptimizerTraceOutput
public void appendOptimizerTraceOutput(String output)(Code)

See Also:   LanguageConnectionContext.appendOptimizerTraceOutput



autoincrementCreateCounter
public void autoincrementCreateCounter(String s, String t, String c, Long initialValue, long increment, int position)(Code)

See Also:   LanguageConnectionContext.autoincrementCreateCounter



autoincrementFlushCache
public void autoincrementFlushCache(UUID tableUUID) throws StandardException(Code)
Flush the cache of autoincrement values being kept by the lcc. This will result in the autoincrement values being written to the SYSCOLUMNS table as well as the mapping used by lastAutoincrementValue
exception:
  StandardException - thrown on error.
See Also:   LanguageConnectionContext.lastAutoincrementValue
See Also:   GenericLanguageConnectionContext.lastAutoincrementValue
See Also:   org.apache.derby.iapi.db.ConnectionInfo.lastAutoincrementValue



beginNestedTransaction
public void beginNestedTransaction(boolean readOnly) throws StandardException(Code)
Start a Nested User Transaction (NUT) with the store. If a NUT is already active simply increment a counter, queryNestingDepth, to keep track of how many times we have tried to start a NUT.



checkIfAnyDeclaredGlobalTempTablesForThisConnection
public boolean checkIfAnyDeclaredGlobalTempTablesForThisConnection()(Code)

See Also:   LanguageConnectionContext.checkIfAnyDeclaredGlobalTempTablesForThisConnection



cleanupOnError
public void cleanupOnError(Throwable error) throws StandardException(Code)
If worse than a transaction error, everything goes; we rely on other contexts to kill the context manager for this session.

If a transaction error, act like we saw a rollback.

If more severe or a java error, the outer cleanup will shutdown the connection, so we don't have to clean up.

REMIND: connection should throw out all contexts and start over when the connection is closed... perhaps by throwing out the context manager?

REVISIT: If statement error, should we do anything?

Since the access manager's own context takes care of its own resources on errors, there is nothing that this context has to do with the transaction controller.
exception:
  StandardException - thrown on error. REVISIT: don't wantcleanupOnError's to throw exceptions.




commitNestedTransaction
public void commitNestedTransaction() throws StandardException(Code)



convertIdentifierCase
public String convertIdentifierCase(String id) throws StandardException(Code)
Convert an identifier to the proper case for this connection. This method is here to support the Plugin.
Parameters:
  id - an identifier string the string converted to upper or lower case, as appropriate
exception:
  StandardException - thrown if something goes wrong



copyHashtableToAIHT
public void copyHashtableToAIHT(Hashtable from)(Code)
Copies an existing hashtable of autoincrement mappings into autoincrementHT, the cache of autoincrement values kept in the languageconnectioncontext.



dataDictionaryInWriteMode
final public boolean dataDictionaryInWriteMode()(Code)

See Also:   LanguageConnectionContext.dataDictionaryInWriteMode
See Also:   



decrementBindCount
public int decrementBindCount()(Code)

See Also:   LanguageConnectionContext.decrementBindCount
See Also:   



doCommit
protected void doCommit(boolean commitStore, boolean sync, int commitflag, boolean requestedByUser) throws StandardException(Code)
This is where the work on internalCommit(), userCOmmit() and internalCommitNoSync() actually takes place.

When a commit happens, the language connection context will close all open activations/cursors and commit the Store transaction.

REVISIT: we talked about having a LanguageTransactionContext, but since store transaction management is currently in flux and our context might want to delegate to that context, for now all commit/rollback actions are handled directly by the language connection context. REVISIT: this may need additional alterations when RELEASE SAVEPOINT/ROLLBACK TO SAVEPOINT show up.

Since the access manager's own context takes care of its own resources on commit, and the transaction stays open, there is nothing that this context has to do with the transaction controller.

Also, tell the data dictionary that the transaction is finished, if necessary (that is, if the data dictionary was put into DDL mode in this transaction.
Parameters:
  commitStore - true if we should commit the Store transaction
Parameters:
  sync - true means do a synchronized commit,false means do an unsynchronized commit
Parameters:
  commitflag - if this is an unsynchronized commit, the flags topass to commitNoSync in the store'sTransactionController. If this is a synchronizedcommit, this flag is overloaded for xacommit.
Parameters:
  requestedByUser - False iff the commit is for internal use andwe should ignore the check to prevent commitsin an atomic statement.
exception:
  StandardException - Thrown on error




dropDeclaredGlobalTempTable
public boolean dropDeclaredGlobalTempTable(String tableName)(Code)

See Also:   LanguageConnectionContext.dropDeclaredGlobalTempTable



emptyCache
public void emptyCache()(Code)
Empty as much of the cache as possible. It is not guaranteed that the cache is empty after this call, as statements may be kept by currently executing queries, activations that are about to be garbage collected.



getAccessFactory
public AccessFactory getAccessFactory()(Code)

See Also:   LanguageConnectionContext.getAccessFactory
See Also:   



getActivationCount
public int getActivationCount()(Code)
Return the number of activations known for this connection. Note that some of these activations may not be in use (when a prepared statement is finalized, its activations are marked as unused and later closed and removed on the next commit/rollback).



getAuthorizationId
public String getAuthorizationId()(Code)
Get the Authorization Id String the authorization id



getAuthorizer
public Authorizer getAuthorizer()(Code)

See Also:   LanguageConnectionContext.getAuthorizer



getAutoincrementUpdate
public boolean getAutoincrementUpdate()(Code)

See Also:   LanguageConnectionContext.getAutoincrementUpdate



getBindCount
public int getBindCount()(Code)

See Also:   LanguageConnectionContext.getBindCount
See Also:   



getCacheSize
public int getCacheSize()(Code)



getCurrentIsolationLevel
public int getCurrentIsolationLevel()(Code)

See Also:   LanguageConnectionContext.getCurrentIsolationLevel



getCurrentIsolationLevelStr
public String getCurrentIsolationLevelStr()(Code)

See Also:   LanguageConnectionContext.getCurrentIsolationLevel



getCurrentSchemaName
public String getCurrentSchemaName()(Code)
Get the current schema name current schema name



getDataDictionary
public DataDictionary getDataDictionary()(Code)



getDataValueFactory
public DataValueFactory getDataValueFactory()(Code)
Get the data value factory to use with this language connection context.



getDatabase
public Database getDatabase()(Code)

See Also:   LanguageConnectionContext.getDatabase



getDbname
public String getDbname()(Code)

See Also:   LanguageConnectionContext.getDbname



getDeclaredGlobalTemporaryTablesSchemaName
public String getDeclaredGlobalTemporaryTablesSchemaName() throws StandardException(Code)
Get the declared global temporary tables schema name. a String containing the declared global temporary tables schema name.
throws:
  StandardException -



getDefaultSchema
public SchemaDescriptor getDefaultSchema()(Code)
Get the default schema SchemaDescriptor the default schema



getDrdaID
public String getDrdaID()(Code)

See Also:   LanguageConnectionContext.getDrdaID



getExecutionContext
public ExecutionContext getExecutionContext()(Code)

See Also:   LanguageConnectionContext.getExecutionContext



getIdentifierCasing
public int getIdentifierCasing() throws StandardException(Code)
Get casing for delimited identifiers. This feature is here to support the Plugin. ANSI_CASING or ANTI_ANSI_CASING.
exception:
  StandardException - thrown if something goes wrong



getIdentityValue
public Long getIdentityValue()(Code)
Get the identity column value most recently generated. the generated identity column value



getInstanceNumber
public int getInstanceNumber()(Code)

See Also:   LanguageConnectionContext.getInstanceNumber



getLanguageConnectionFactory
public LanguageConnectionFactory getLanguageConnectionFactory()(Code)
Get the language connection factory to use with this language connection context.



getLanguageFactory
public LanguageFactory getLanguageFactory()(Code)
Get the language factory to use with this language connection context.



getLastActivation
public Activation getLastActivation()(Code)

See Also:   LanguageConnectionContext.getLastActivation



getLockEscalationThreshold
public int getLockEscalationThreshold()(Code)
get the lock escalation threshold.



getLockObject
public Object getLockObject(int lockScope) throws StandardException(Code)
Get the lock handle for the current transaction.
Parameters:
  lockScope - SINGLE_TRANSACTION_LOCK or MULTI_TRANSACTION_LOCK the current lock handle
exception:
  StandardException - thrown if something goes wrong



getLogQueryPlan
public boolean getLogQueryPlan()(Code)

See Also:   LanguageConnectionContext.getLogQueryPlan



getLogStatementText
public boolean getLogStatementText()(Code)

See Also:   LanguageConnectionContext.getLogStatementText



getOptimizerFactory
public OptimizerFactory getOptimizerFactory()(Code)



getOptimizerTrace
public boolean getOptimizerTrace()(Code)

See Also:   LanguageConnectionContext.getOptimizerTrace



getOptimizerTraceHtml
public boolean getOptimizerTraceHtml()(Code)

See Also:   LanguageConnectionContext.getOptimizerTraceHtml



getOptimizerTraceOutput
public String getOptimizerTraceOutput()(Code)

See Also:   LanguageConnectionContext.getOptimizerTraceOutput



getPrepareIsolationLevel
public int getPrepareIsolationLevel()(Code)

See Also:   LanguageConnectionContext.getPrepareIsolationLevel



getRunTimeStatisticsMode
public boolean getRunTimeStatisticsMode()(Code)

See Also:   LanguageConnectionContext.getRunTimeStatisticsMode
See Also:   



getRunTimeStatisticsObject
public RunTimeStatistics getRunTimeStatisticsObject()(Code)

See Also:   LanguageConnectionContext.getRunTimeStatisticsObject
See Also:   



getStatementContext
public StatementContext getStatementContext()(Code)

See Also:   LanguageConnectionContext.getStatementContext



getStatementDepth
public int getStatementDepth()(Code)
Reports how many statement levels deep we are. a statement level >= OUTERMOST_STATEMENT



getStatisticsTiming
public boolean getStatisticsTiming()(Code)

See Also:   LanguageConnectionContext.getStatisticsTiming
See Also:   



getSysIBMSchemaName
public String getSysIBMSchemaName() throws StandardException(Code)
Get the name of the SYSIBM schema. A String containing the name of the SYSIBM schema.
throws:
  StandardException -



getSystemDiagSchemaName
public String getSystemDiagSchemaName() throws StandardException(Code)
Get the name of the SYSCS_DIAG schema. A String containing the name of the SYSIBM schema.
throws:
  StandardException -



getSystemSchemaName
public String getSystemSchemaName() throws StandardException(Code)
Get the name of the system schema. A String containing the name of the system schema.
throws:
  StandardException -



getSystemUtilSchemaName
public String getSystemUtilSchemaName() throws StandardException(Code)
Get the name of the SYSCS_UTIL schema. A String containing the name of the SYSIBM schema.
throws:
  StandardException -



getTableDescriptorForDeclaredGlobalTempTable
public TableDescriptor getTableDescriptorForDeclaredGlobalTempTable(String tableName)(Code)

See Also:   LanguageConnectionContext.getTableDescriptorForDeclaredGlobalTempTable



getTransactionCompile
public TransactionController getTransactionCompile()(Code)
Get the transaction controller to use at compile time with this language connection context. If a NUT is active then return NUT else return parent transaction.



getTransactionExecute
public TransactionController getTransactionExecute()(Code)



getTriggerExecutionContext
public TriggerExecutionContext getTriggerExecutionContext()(Code)
Get the topmost tec. the tec



getTriggerTable
public TableDescriptor getTriggerTable()(Code)
Get the topmost trigger table descriptor the table descriptor, or null if wearen't in the middle of compiling a createtrigger.



getUniqueCursorName
public String getUniqueCursorName()(Code)
Get a connection unique system generated name for a cursor.



getUniqueSavepointID
public int getUniqueSavepointID()(Code)
Get a connection unique system generated id for an unnamed savepoint.



getUniqueSavepointName
public String getUniqueSavepointName()(Code)
Get a connection unique system generated name for an unnamed savepoint.



incrementBindCount
public int incrementBindCount()(Code)

See Also:   LanguageConnectionContext.incrementBindCount
See Also:   



initDefaultSchemaDescriptor
protected SchemaDescriptor initDefaultSchemaDescriptor() throws StandardException(Code)



initialize
public void initialize(boolean sqlConnection) throws StandardException(Code)



internalCommit
public void internalCommit(boolean commitStore) throws StandardException(Code)
Do a commit as appropriate for an internally generated commit (e.g. as needed by sync, or autocommit).
Parameters:
  commitStore - true if we should commit the Store transaction
exception:
  StandardException - thrown on failure



internalCommitNoSync
final public void internalCommitNoSync(int commitflag) throws StandardException(Code)
Commit the language transaction by doing a commitNoSync() on the store's TransactionController.

Do *NOT* tell the data dictionary that the transaction is finished. The reason is that this would allow other transactions to see comitted DDL that could be undone in the event of a system crash.
Parameters:
  commitflag - the flags to pass to commitNoSync in the store'sTransactionController
exception:
  StandardException - thrown on failure




internalRollback
public void internalRollback() throws StandardException(Code)
Do a rollback as appropriate for an internally generated rollback (e.g. as needed by sync, or autocommit). When a rollback happens, we close all open activations and invalidate their prepared statements. We then tell the cache to age out everything else, which effectively invalidates them. Thus, all prepared statements will be compiled anew on their 1st execution after a rollback.

The invalidated statements can revalidate themselves without a full recompile if they verify their dependencies' providers still exist unchanged. REVISIT when invalidation types are created.

REVISIT: this may need additional alterations when RELEASE SAVEPOINT/ROLLBACK TO SAVEPOINT show up.

Also, tell the data dictionary that the transaction is finished, if necessary (that is, if the data dictionary was put into DDL mode in this transaction.
exception:
  StandardException - thrown on failure




internalRollbackToSavepoint
public void internalRollbackToSavepoint(String savepointName, boolean refreshStyle, Object kindOfSavepoint) throws StandardException(Code)
Let the context deal with a rollback to savepoint
Parameters:
  savepointName - Name of the savepoint that needs to be rolled back
Parameters:
  refreshStyle - boolean indicating whether or not the controller should closeopen conglomerates and scans. Also used to determine if language should closeopen activations.
Parameters:
  kindOfSavepoint - A NULL value means it is an internal savepoint (ie not a user defined savepoint)Non NULL value means it is a user defined savepoint which can be a SQL savepoint or a JDBC savepointA String value for kindOfSavepoint would mean it is SQL savepointA JDBC Savepoint object value for kindOfSavepoint would mean it is JDBC savepoint
exception:
  StandardException - thrown if something goes wrong



isIsolationLevelSetUsingSQLorJDBC
public boolean isIsolationLevelSetUsingSQLorJDBC()(Code)

See Also:   LanguageConnectionContext.isIsolationLevelSetUsingSQLorJDBC



isLastHandler
public boolean isLastHandler(int severity)(Code)

See Also:   Context.isLastHandler



isReadOnly
public boolean isReadOnly()(Code)

See Also:   LanguageConnectionContext.isReadOnly



isTransactionPristine
public boolean isTransactionPristine()(Code)
Reports whether there is any outstanding work in the transaction. true if there is outstanding work in the transactionfalse otherwise



languageSetSavePoint
public void languageSetSavePoint(String savepointName, Object kindOfSavepoint) throws StandardException(Code)
Sets a savepoint. Causes the Store to set a savepoint.
Parameters:
  savepointName - name of savepoint
Parameters:
  kindOfSavepoint - A NULL value means it is an internal savepoint (ie not a user defined savepoint)Non NULL value means it is a user defined savepoint which can be a SQL savepoint or a JDBC savepointA String value for kindOfSavepoint would mean it is SQL savepointA JDBC Savepoint object value for kindOfSavepoint would mean it is JDBC savepoint
exception:
  StandardException - thrown if something goes wrong



lastAutoincrementValue
public Long lastAutoincrementValue(String schemaName, String tableName, String columnName)(Code)
Implements ConnectionInfo.lastAutoincrementValue. lastAutoincrementValue searches for the last autoincrement value inserted into a column specified by the user. The search for the "last" value supports nesting levels caused by triggers (Only triggers cause nesting, not server side JDBC). If lastAutoincrementValue is called from within a trigger, the search space for ai-values are those values that are inserted by this trigger as well as previous triggers; i.e if a SQL statement fires trigger T1, which in turn does something that fires trigger t2, and if lastAutoincrementValue is called from within t2, then autoincrement values genereated by t1 are visible to it. By the same logic, if it is called from within t1, then it does not see values inserted by t2.
See Also:   LanguageConnectionContext.lastAutoincrementValue
See Also:   org.apache.derby.iapi.db.ConnectionInfo.lastAutoincrementValue



lookupCursorActivation
public CursorActivation lookupCursorActivation(String cursorName)(Code)
See if a given cursor is available for use. if so return its activation. Returns null if not found. For use in execution. the activation for the given cursor, nullif none was found.



lookupStatement
public PreparedStatement lookupStatement(GenericStatement statement) throws StandardException(Code)
See if a given statement has already been compiled for this user, and if so use its prepared statement. Returns null if not found.
exception:
  StandardException - thrown if lookup goes wrong. the prepared statement for the given string, nullif none was found.



markTempTableAsModifiedInUnitOfWork
public void markTempTableAsModifiedInUnitOfWork(String tableName)(Code)

See Also:   LanguageConnectionContext.markTempTableAsModifiedInUnitOfWork



nextAutoincrementValue
public long nextAutoincrementValue(String schemaName, String tableName, String columnName) throws StandardException(Code)
returns the next value to be inserted into an autoincrement col. This is used internally by the system to generate autoincrement values which are going to be inserted into a autoincrement column. This is used when as autoincrement column is added to a table by an alter table statemenet and during bulk insert.
Parameters:
  schemaName -
Parameters:
  tableName -
Parameters:
  columnName - identify the column uniquely in the system.



notifyUnusedActivation
public void notifyUnusedActivation()(Code)
Make a note that some activations are marked unused



popCompilerContext
public void popCompilerContext(CompilerContext cc)(Code)
Pop a CompilerContext off the context stack.
Parameters:
  cc - The compiler context.



popExecutionStmtValidator
public void popExecutionStmtValidator(ExecutionStmtValidator validator) throws StandardException(Code)
Remove the validator. Does an object identity (validator == validator) comparison. Asserts that the validator is found.
Parameters:
  validator - the validator to remove
exception:
  StandardException - on error



popStatementContext
public void popStatementContext(StatementContext statementContext, Throwable error)(Code)
Pop a StatementContext of the context stack.
Parameters:
  statementContext - The statement context.
Parameters:
  error - The error, if any (Only relevant for DEBUG)



popTriggerExecutionContext
public void popTriggerExecutionContext(TriggerExecutionContext tec) throws StandardException(Code)
Remove the tec. Does an object identity (tec == tec) comparison. Asserts that the tec is found.
Parameters:
  tec - the tec to remove
exception:
  StandardException - on error



popTriggerTable
public void popTriggerTable(TableDescriptor td)(Code)
Remove the trigger table descriptor.
Parameters:
  td - the table to remove from the stack.



prepareInternalStatement
public PreparedStatement prepareInternalStatement(SchemaDescriptor compilationSchema, String sqlText, boolean isForReadOnly, boolean forMetaData) throws StandardException(Code)

See Also:   LanguageConnectionContext.prepareInternalStatement



prepareInternalStatement
public PreparedStatement prepareInternalStatement(String sqlText) throws StandardException(Code)

See Also:   LanguageConnectionContext.prepareInternalStatement



pushCompilerContext
final public CompilerContext pushCompilerContext()(Code)
Push a CompilerContext on the context stack with the current default schema as the default schema which we compile against. the compiler context
exception:
  StandardException - thrown on failure



pushCompilerContext
public CompilerContext pushCompilerContext(SchemaDescriptor sd)(Code)
Push a CompilerContext on the context stack with the passed in default schema as the default schema we compile against.
Parameters:
  sd - the default schema the compiler context



pushExecutionStmtValidator
public void pushExecutionStmtValidator(ExecutionStmtValidator validator)(Code)
Push a new execution statement validator. An execution statement validator is an object that validates the current statement to ensure that it is permitted given the current execution context. An example of a validator a trigger ExecutionStmtValidator that doesn't allow ddl on the trigger target table.

Multiple ExecutionStmtValidators may be active at any given time. This mirrors the way there can be multiple connection nestings at a single time. The validation is performed by calling each validator's validateStatement() method. This yields the union of all validations.
Parameters:
  validator - the validator to add




pushStatementContext
public StatementContext pushStatementContext(boolean isAtomic, boolean isForReadOnly, String stmtText, ParameterValueSet pvs, boolean rollbackParentContext, long timeoutMillis)(Code)
Push a StatementContext on the context stack.
Parameters:
  isAtomic - whether this statement is atomic or not
Parameters:
  isForReadOnly - whether this statement is for a read only resultset
Parameters:
  stmtText - the text of the statement. Needed for any languagestatement (currently, for any statement that can cause a triggerto fire). Please set this unless you are some funky jdbc setXXXmethod or something.
Parameters:
  pvs - parameter value set, if it has one
Parameters:
  rollbackParentContext - True if 1) the statement context isNOT a top-level context, AND 2) in the event of a statement-levelexception, the parent context needs to be rolled back, too.
Parameters:
  timeoutMillis - timeout value for this statement, in milliseconds.The value 0 means that no timeout is set. StatementContext The statement context.



pushTriggerExecutionContext
public void pushTriggerExecutionContext(TriggerExecutionContext tec) throws StandardException(Code)
Push a new trigger execution context.

Multiple TriggerExecutionContexts may be active at any given time.
Parameters:
  tec - the trigger execution context
exception:
  StandardException - on trigger recursion error




pushTriggerTable
public void pushTriggerTable(TableDescriptor td)(Code)
Set the trigger table descriptor. Used to compile statements that may special trigger pseudo tables.
Parameters:
  td - the table that the trigger is defined upon



releaseSavePoint
public void releaseSavePoint(String savepointName, Object kindOfSavepoint) throws StandardException(Code)
Let the context deal with a release of a savepoint
Parameters:
  savepointName - Name of the savepoint that needs to be released
Parameters:
  kindOfSavepoint - A NULL value means it is an internal savepoint (ie not a user defined savepoint)Non NULL value means it is a user defined savepoint which can be a SQL savepoint or a JDBC savepointA String value for kindOfSavepoint would mean it is SQL savepointA JDBC Savepoint object value for kindOfSavepoint would mean it is JDBC savepoint
exception:
  StandardException - thrown if something goes wrong



removeActivation
public void removeActivation(Activation a)(Code)
Remove the activation to those known about by this connection.



removeStatement
public void removeStatement(Statement statement) throws StandardException(Code)
This method will remove a statement from the statement cache. It will be called, for example, if there is an exception preparing the statement.
Parameters:
  statement - Statement to remove
exception:
  StandardException - thrown if lookup goes wrong.



resetFromPool
public void resetFromPool() throws StandardException(Code)
Reset the connection before it is returned (indirectly) by a PooledConnection object. See EmbeddedConnection.



resetIsolationLevelFlagUsedForSQLandJDBC
public void resetIsolationLevelFlagUsedForSQLandJDBC()(Code)

See Also:   LanguageConnectionContext.resetIsolationLevelFlagUsedForSQLandJDBC



resetStatementDepth
protected void resetStatementDepth()(Code)
Resets the statementDepth.



setAutoincrementUpdate
public void setAutoincrementUpdate(boolean flag)(Code)

See Also:   LanguageConnectionContext.setAutoincrementUpdate



setDataDictionaryWriteMode
final public void setDataDictionaryWriteMode()(Code)

See Also:   LanguageConnectionContext.setDataDictionaryWriteMode
See Also:   



setDefaultSchema
public void setDefaultSchema(SchemaDescriptor sd) throws StandardException(Code)
Set the default schema -- used by SET SCHEMA.
Parameters:
  sd - the new default schema.If null, then the default schema descriptor is used.
exception:
  StandardException - thrown on failure



setDrdaID
public void setDrdaID(String drdaID)(Code)

See Also:   LanguageConnectionContext.setDrdaID



setIdentityValue
public void setIdentityValue(long val)(Code)
Set the field of most recently generated identity column value.
Parameters:
  val - the generated identity column value



setIsolationLevel
public void setIsolationLevel(int isolationLevel) throws StandardException(Code)

See Also:   LanguageConnectionContext.setIsolationLevel



setLogStatementText
public void setLogStatementText(boolean logStatementText)(Code)

See Also:   LanguageConnectionContext.setLogStatementText



setOptimizerTrace
public boolean setOptimizerTrace(boolean onOrOff)(Code)

See Also:   LanguageConnectionContext.setOptimizerTrace



setOptimizerTraceHtml
public boolean setOptimizerTraceHtml(boolean onOrOff)(Code)

See Also:   LanguageConnectionContext.setOptimizerTraceHtml



setOptimizerTraceOutput
public void setOptimizerTraceOutput(String startingText)(Code)

See Also:   LanguageConnectionContext.setOptimizerTraceOutput



setPrepareIsolationLevel
public void setPrepareIsolationLevel(int level)(Code)

See Also:   LanguageConnectionContext.setPrepareIsolationLevel



setReadOnly
public void setReadOnly(boolean on) throws StandardException(Code)

See Also:   LanguageConnectionContext.setReadOnly
exception:
  StandardException - The operation is disallowed.



setRunTimeStatisticsMode
public void setRunTimeStatisticsMode(boolean onOrOff)(Code)

See Also:   LanguageConnectionContext.setRunTimeStatisticsMode
See Also:   



setRunTimeStatisticsObject
public void setRunTimeStatisticsObject(RunTimeStatistics runTimeStatisticsObject)(Code)

See Also:   LanguageConnectionContext.setRunTimeStatisticsObject
See Also:   



setStatisticsTiming
public void setStatisticsTiming(boolean onOrOff)(Code)

See Also:   LanguageConnectionContext.setStatisticsTiming
See Also:   



setTransaction
public void setTransaction(TransactionController tran)(Code)
Sets the transaction controller to use with this language connection context.
Parameters:
  tran - the transaction to use with this language connection context



userCommit
public void userCommit() throws StandardException(Code)
Do a commmit as is appropriate for a user requested commit (e.g. a java.sql.Connection.commit() or a language 'COMMIT' statement. Does some extra checking to make sure that users aren't doing anything bad.
exception:
  StandardException - thrown on failure



userRollback
public void userRollback() throws StandardException(Code)
Do a rollback as is appropriate for a user requested rollback (e.g. a java.sql.Connection.rollback() or a language 'ROLLBACk' statement. Does some extra checking to make sure that users aren't doing anything bad.
exception:
  StandardException - thrown on failure



usesSqlAuthorization
public boolean usesSqlAuthorization()(Code)

See Also:   LanguageConnectionContext.usesSqlAuthorization



validateStmtExecution
public void validateStmtExecution(ConstantAction constantAction) throws StandardException(Code)
Validate a statement. Does so by stepping through all the validators and executing them. If a validator throws and exception, then the checking is stopped and the exception is passed up.
Parameters:
  constantAction - the constantAction that is about to be executed (andshould be validated
exception:
  StandardException - on validation failure



verifyAllHeldResultSetsAreClosed
public boolean verifyAllHeldResultSetsAreClosed() throws StandardException(Code)
Verify that there are no activations with open held result sets. boolean Found no open (held) resultsets.
exception:
  StandardException - thrown on failure



verifyNoOpenResultSets
public boolean verifyNoOpenResultSets(PreparedStatement pStmt, Provider provider, int action) throws StandardException(Code)
Verify that there are no activations with open result sets on the specified prepared statement.
Parameters:
  pStmt - The prepared Statement
Parameters:
  provider - The object precipitating a possible invalidation
Parameters:
  action - The action causing the possible invalidation Nothing.
exception:
  StandardException - thrown on failure



xaCommit
final public void xaCommit(boolean onePhase) throws StandardException(Code)
Same as userCommit except commit a distributed transaction. This commit always commit store and sync the commit.
Parameters:
  onePhase - if true, allow it to commit without first going thru aprepared state.
exception:
  StandardException - thrown if something goes wrong



xaRollback
public void xaRollback() throws StandardException(Code)
Same as userRollback() except rolls back a distrubuted transaction.
exception:
  StandardException - thrown if something goes wrong



Methods inherited from org.apache.derby.iapi.services.context.ContextImpl
public StringBuffer appendErrorInfo()(Code)(Java Doc)
final public ContextManager getContextManager()(Code)(Java Doc)
final public String getIdName()(Code)(Java Doc)
public boolean isLastHandler(int severity)(Code)(Java Doc)
final public void popMe()(Code)(Java Doc)
final public void pushMe()(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.