com.ibm.wsspi.ejbpersistence

Class WSEJBToRAAdapter

  • java.lang.Object
    • com.ibm.wsspi.ejbpersistence.WSEJBToRAAdapter
  • All Implemented Interfaces:
    com.ibm.websphere.ejbpersistence.EJBToRAAdapter


    public abstract class WSEJBToRAAdapter
    extends java.lang.Object
    implements com.ibm.websphere.ejbpersistence.EJBToRAAdapter

    This is the default implementation for the EJBToRAAdapter interface. Third party RA suppliers must implement EJBToRAAdapter interface or extend this class.

    Since:
    WAS 5.0
    Version:
    1.31
    See Also:
    EJBToRAAdapter
    • Field Summary

      • Fields inherited from interface com.ibm.websphere.ejbpersistence.EJBToRAAdapter

        LOCKTYPE_NOTAPPLICABLE, LOCKTYPE_SELECT, LOCKTYPE_SELECT_FOR_UPDATE, LOCKTYPE_SELECT_FOR_UPDATE_WITH_RR, LOCKTYPE_SELECT_FOR_UPDATE_WITH_RS
    • Constructor Summary

      Constructors 
      Modifier Constructor and Description
      protected WSEJBToRAAdapter()
      default Constructor
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      boolean checkBackendId(javax.resource.cci.ConnectionFactory connectionFactory, java.lang.String backendId) 
      javax.resource.cci.Interaction createInteraction(javax.resource.cci.Connection conn)
      Deprecated.  
      javax.resource.cci.Interaction createInteraction(javax.resource.cci.Connection conn, com.ibm.websphere.appprofile.accessintent.AccessIntent intent, java.util.HashMap properties) 
      javax.resource.cci.Record executeCreate(javax.resource.cci.Interaction interaction, javax.resource.cci.InteractionSpec ispec, javax.resource.cci.IndexedRecord inputRecord) 
      javax.resource.cci.Record executeCreate(javax.resource.cci.Interaction interaction, javax.resource.cci.InteractionSpec ispec, javax.resource.cci.IndexedRecord[] inputRecord) 
      javax.resource.cci.Record executeFinder(javax.resource.cci.Interaction interaction, javax.resource.cci.InteractionSpec ispec, javax.resource.cci.IndexedRecord inputRecord) 
      javax.resource.cci.Record executeOther(javax.resource.cci.Interaction interaction, javax.resource.cci.InteractionSpec ispec, javax.resource.cci.IndexedRecord inputRecord) 
      javax.resource.cci.Record executeOther(javax.resource.cci.Interaction interaction, javax.resource.cci.InteractionSpec ispec, javax.resource.cci.IndexedRecord[] inputRecord) 
      boolean[] executeReadReadChecking(javax.resource.cci.Interaction interaction, javax.resource.cci.InteractionSpec ispec, javax.resource.cci.IndexedRecord[] inputRecord)
      Using the given Interaction object, call the "executeBatchRead(InteractionSpec ispec, Record inrec)" method with the given InteractionSpec and input Record; no Record should be returned from this call, instead a boolean array is returned.
      javax.resource.cci.Record executeRemove(javax.resource.cci.Interaction interaction, javax.resource.cci.InteractionSpec ispec, javax.resource.cci.IndexedRecord[] inputRecord, javax.resource.cci.IndexedRecord[] predicates) 
      javax.resource.cci.Record executeRemove(javax.resource.cci.Interaction interaction, javax.resource.cci.InteractionSpec ispec, javax.resource.cci.IndexedRecord inputRecord, javax.resource.cci.IndexedRecord predicates) 
      javax.resource.cci.Record executeUpdate(javax.resource.cci.Interaction interaction, javax.resource.cci.InteractionSpec ispec, javax.resource.cci.IndexedRecord[] inputRecord, javax.resource.cci.IndexedRecord[] predicates, boolean[][] dirtyBits, java.lang.String cursorName) 
      javax.resource.cci.Record executeUpdate(javax.resource.cci.Interaction interaction, javax.resource.cci.InteractionSpec ispec, javax.resource.cci.IndexedRecord inputRecord, javax.resource.cci.IndexedRecord predicates, boolean[] dirtyBits, java.lang.String cursorName) 
      abstract javax.resource.cci.Connection getConnection(javax.resource.cci.ConnectionFactory connectionFactory, com.ibm.websphere.appprofile.accessintent.AccessIntent accessIntent) 
      int getLockType(javax.resource.cci.ConnectionFactory connFactory, com.ibm.websphere.appprofile.accessintent.AccessIntent accessIntent) 
      java.lang.Object getNativeConnection(javax.resource.cci.Connection cciConnection) 
      javax.resource.cci.RecordFactory getRecordFactory(javax.resource.cci.ConnectionFactory connectionFactory) 
      protected com.ibm.ejs.ras.TraceComponent getTracer()
      This method gets the trace component.
      boolean isBatchSupported(javax.resource.cci.ConnectionFactory connectionFactory, com.ibm.websphere.appprofile.accessintent.AccessIntent accessIntent) 
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface com.ibm.websphere.ejbpersistence.EJBToRAAdapter

        getLockType
    • Constructor Detail

      • WSEJBToRAAdapter

        protected WSEJBToRAAdapter()
        default Constructor
    • Method Detail

      • checkBackendId

        public boolean checkBackendId(javax.resource.cci.ConnectionFactory connectionFactory,
                             java.lang.String backendId)
                               throws javax.resource.ResourceException
        Specified by:
        checkBackendId in interface com.ibm.websphere.ejbpersistence.EJBToRAAdapter
        Parameters:
        connectionFactory - the connection factory
        backendId - the bankend ID
        Returns:
        true if the connection factory matches the backend id; false otherwise.
        Throws:
        javax.resource.ResourceException
        Since:
        WAS 6.0
        See Also:
        EJBToRAAdapter.checkBackendId(javax.resource.cci.ConnectionFactory, String)
      • createInteraction

        public javax.resource.cci.Interaction createInteraction(javax.resource.cci.Connection conn)
                                                         throws javax.resource.ResourceException
        Deprecated. 
        Specified by:
        createInteraction in interface com.ibm.websphere.ejbpersistence.EJBToRAAdapter
        Parameters:
        conn - javax.resource.cci.Connection see J2EE Connector spec, CCI
        intent - the AccessIntent in effect for this operation. The values in intent shall be used as necessary when executing the returned interaction. The values include choice of pessimistic versus optimistic access, intent to read versus update the data, and others. See the javadoc for AccessIntent for additional details.
        Returns:
        javax.resource.cci.Interaction see J2EE Connector spec, CCI
        Throws:
        javax.resource.ResourceException
        See Also:

        Note: WSRelationalRAAdapter overrides this method to set the AccessIntent in the Interaction [d193047.1]

      • createInteraction

        public javax.resource.cci.Interaction createInteraction(javax.resource.cci.Connection conn,
                                                       com.ibm.websphere.appprofile.accessintent.AccessIntent intent,
                                                       java.util.HashMap properties)
                                                         throws javax.resource.ResourceException
        Specified by:
        createInteraction in interface com.ibm.websphere.ejbpersistence.EJBToRAAdapter
        Parameters:
        conn - javax.resource.cci.Connection see J2EE Connector spec, CCI
        intent - the AccessIntent in effect for this operation. The values in intent shall be used as necessary when executing the returned interaction. The values include choice of pessimistic versus optimistic access, intent to read versus update the data, and others. See the javadoc for AccessIntent for additional details.
        Returns:
        javax.resource.cci.Interaction see J2EE Connector spec, CCI
        Throws:
        javax.resource.ResourceException
        See Also:

        Note: WSRelationalRAAdapter and WSProceduralRAAdapter overrides this method to set the AccessIntent in the Interaction [d193047.1]

      • executeCreate

        public javax.resource.cci.Record executeCreate(javax.resource.cci.Interaction interaction,
                                              javax.resource.cci.InteractionSpec ispec,
                                              javax.resource.cci.IndexedRecord inputRecord)
                                                throws javax.ejb.CreateException,
                                                       javax.resource.ResourceException
        Specified by:
        executeCreate in interface com.ibm.websphere.ejbpersistence.EJBToRAAdapter
        Parameters:
        interaction - javax.resource.cci.Interaction the interaction to call "execute(...)" on
        ispec - javax.resource.cci.InteractionSpec see J2EE Connector spec, CCI
        inputRecord - javax.resource.cci.IndexedRecord see J2EE Connector spec, CCI
        Returns:
        javax.resource.cci.Record see J2EE Connector spec, CCI
        Throws:
        javax.ejb.CreateException
        javax.resource.ResourceException
        See Also:
        EJBToRAAdapter.executeCreate(Interaction, InteractionSpec, IndexedRecord)
      • executeFinder

        public javax.resource.cci.Record executeFinder(javax.resource.cci.Interaction interaction,
                                              javax.resource.cci.InteractionSpec ispec,
                                              javax.resource.cci.IndexedRecord inputRecord)
                                                throws javax.ejb.FinderException,
                                                       javax.resource.ResourceException
        Specified by:
        executeFinder in interface com.ibm.websphere.ejbpersistence.EJBToRAAdapter
        Parameters:
        interaction - javax.resource.cci.Interaction the interaction to call "execute(...)" on
        ispec - javax.resource.cci.InteractionSpec see J2EE Connector spec, CCI
        inputRecord - javax.resource.cci.IndexedRecord see J2EE Connector spec, CCI
        Returns:
        javax.resource.cci.Record see J2EE Connector spec, CCI
        Throws:
        javax.resource.ResourceException - The exception description.
        javax.ejb.FinderException
        javax.resource.ResourceException
        See Also:
        EJBToRAAdapter.executeFinder(Interaction, InteractionSpec, IndexedRecord)
      • executeRemove

        public javax.resource.cci.Record executeRemove(javax.resource.cci.Interaction interaction,
                                              javax.resource.cci.InteractionSpec ispec,
                                              javax.resource.cci.IndexedRecord inputRecord,
                                              javax.resource.cci.IndexedRecord predicates)
                                                throws javax.ejb.RemoveException,
                                                       javax.resource.ResourceException
        Specified by:
        executeRemove in interface com.ibm.websphere.ejbpersistence.EJBToRAAdapter
        Parameters:
        interaction - javax.resource.cci.Interaction the interaction this method should call "execute(...)" on
        ispec - javax.resource.cci.InteractionSpec see J2EE Connector spec, CCI
        inputRecord - javax.resource.cci.Record input Record, see J2EE Connector spec, CCI
        predicates -
        Returns:
        javax.resource.cci.Record see J2EE Connector spec, CCI
        Throws:
        javax.resource.ResourceException - The exception description.
        javax.ejb.RemoveException
        javax.resource.ResourceException
        See Also:
        EJBToRAAdapter.executeRemove(Interaction, InteractionSpec, IndexedRecord, IndexedRecord)
      • executeUpdate

        public javax.resource.cci.Record executeUpdate(javax.resource.cci.Interaction interaction,
                                              javax.resource.cci.InteractionSpec ispec,
                                              javax.resource.cci.IndexedRecord inputRecord,
                                              javax.resource.cci.IndexedRecord predicates,
                                              boolean[] dirtyBits,
                                              java.lang.String cursorName)
                                                throws javax.ejb.EJBException,
                                                       javax.resource.ResourceException
        Specified by:
        executeUpdate in interface com.ibm.websphere.ejbpersistence.EJBToRAAdapter
        Parameters:
        interaction - javax.resource.cci.Interaction the interaction this method should call "execute(...)" on
        ispec - javax.resource.cci.InteractionSpec see J2EE Connector spec, CCI
        inputRecord - javax.resource.cci.Record input Record, see J2EE Connector spec, CCI
        predicates -
        dirtyBits -
        cursorName - java.lang.String an optional cursor name, obtained by PM runtime via a call to java.sql.ResultSet.getCursorName(), using the ResultSet which contains the bean/row being updated. This parameter is used to perform "positional update", a more efficient data updating mechanism supported by certain Resource Managers (mostly, relational databases). If a Resource Adapter does not support positioned update then this parameter can be ignored.
        Returns:
        javax.resource.cci.Record see J2EE Connector spec, CCI
        Throws:
        javax.resource.ResourceException - The exception description.
        javax.ejb.EJBException
        javax.resource.ResourceException
        See Also:
        EJBToRAAdapter.executeUpdate(Interaction, InteractionSpec, IndexedRecord, IndexedRecord, boolean[], String)
      • executeOther

        public javax.resource.cci.Record executeOther(javax.resource.cci.Interaction interaction,
                                             javax.resource.cci.InteractionSpec ispec,
                                             javax.resource.cci.IndexedRecord inputRecord)
                                               throws javax.resource.ResourceException
        Specified by:
        executeOther in interface com.ibm.websphere.ejbpersistence.EJBToRAAdapter
        Parameters:
        interaction - javax.resource.cci.Interaction the interaction this method should call "execute(...)" on
        ispec - javax.resource.cci.InteractionSpec see J2EE Connector spec, CCI
        inputRecord - javax.resource.cci.IndexedRecord see J2EE Connector spec, CCI This method is used for executing interactions other than the currently defeined ones (create, finder, etc). This will immediately be used for updating the Many-Many Auxilary tables. The value returned from this execution must be null
        Returns:
        javax.resource.cci.Record see J2EE Connector spec, CCI
        Throws:
        javax.resource.ResourceException
        See Also:
        EJBToRAAdapter.executeOther(Interaction, InteractionSpec, IndexedRecord)
      • getConnection

        public abstract javax.resource.cci.Connection getConnection(javax.resource.cci.ConnectionFactory connectionFactory,
                                                  com.ibm.websphere.appprofile.accessintent.AccessIntent accessIntent)
                                                             throws javax.resource.ResourceException
        Specified by:
        getConnection in interface com.ibm.websphere.ejbpersistence.EJBToRAAdapter
        Parameters:
        connectionFactory - javax.resource.cci.ConnectionFactory see J2EE Connector spec, CCI
        accessIntent - com.ibm.ws.ejbpersistence.AccessIntent data class to hold access-intent-related info of potential use by any Resource Adapter. This method uses this parameter to locate a possible cached connection suitable for use with this AccessIntent. If there is no such cached connection, PM obtains one and caches it for future use.
        Returns:
        javax.resource.cci.Connection see J2EE Connector spec, CCI
        Throws:
        javax.resource.ResourceException
        See Also:
        EJBToRAAdapter.getConnection(ConnectionFactory, AccessIntent)
      • getNativeConnection

        public java.lang.Object getNativeConnection(javax.resource.cci.Connection cciConnection)
        Specified by:
        getNativeConnection in interface com.ibm.websphere.ejbpersistence.EJBToRAAdapter
        Parameters:
        a - CCI Connection (preferably a RdbConnectionImpl)
        Returns:
        a NativeConnection or null
        See Also:
        EJBToRAAdapter.getNativeConnection(javax.resource.cci.Connection)
      • getLockType

        public int getLockType(javax.resource.cci.ConnectionFactory connFactory,
                      com.ibm.websphere.appprofile.accessintent.AccessIntent accessIntent)
        Specified by:
        getLockType in interface com.ibm.websphere.ejbpersistence.EJBToRAAdapter
        Parameters:
        connectionFactory - javax.resource.cci.ConnectionFactory see J2EE Connector spec, CCI
        accessIntent - com.ibm.ws.ejbpersistence.AccessIntent data class to hold access-intent-related info of potential use by any Resource Adapter. This method uses this parameter to locate a possible cached connection suitable for use with this AccessIntent. If there is no such cached connection, PM obtains one and caches it for future use.
        Returns:
        the lock type - the EJBToRAAdapter.LOCKTYPE_SELECT is returned from this method
        See Also:
        EJBToRAAdapter.getLockType(ConnectionFactory, AccessIntent)
      • getRecordFactory

        public javax.resource.cci.RecordFactory getRecordFactory(javax.resource.cci.ConnectionFactory connectionFactory)
                                                          throws javax.resource.ResourceException
        Specified by:
        getRecordFactory in interface com.ibm.websphere.ejbpersistence.EJBToRAAdapter
        Parameters:
        connectionFactory - javax.resource.cci.ConnectionFactory see J2EE Connector spec, CCI
        Returns:
        a RecordFactory
        Throws:
        javax.resource.ResourceException
        See Also:
        EJBToRAAdapter.getRecordFactory(ConnectionFactory)
      • executeCreate

        public javax.resource.cci.Record executeCreate(javax.resource.cci.Interaction interaction,
                                              javax.resource.cci.InteractionSpec ispec,
                                              javax.resource.cci.IndexedRecord[] inputRecord)
                                                throws javax.ejb.CreateException,
                                                       javax.resource.ResourceException
        Specified by:
        executeCreate in interface com.ibm.websphere.ejbpersistence.EJBToRAAdapter
        Parameters:
        interaction - javax.resource.cci.Interaction: an array of the the interaction to call "execute(...)"
        ispec - javax.resource.cci.InteractionSpec an array of the interactionSpecs, see J2EE Connector spec, CCI
        inputRecord - javax.resource.cci.IndexedRecord an array of the indexedRecord, see J2EE Connector spec, CCI
        Returns:
        javax.resource.cci.Record see J2EE Connector spec, CCI
        Throws:
        javax.ejb.CreateException
        javax.resource.ResourceException
        See Also:
        EJBToRAAdapter.executeCreate(Interaction, InteractionSpec, IndexedRecord[])
      • executeRemove

        public javax.resource.cci.Record executeRemove(javax.resource.cci.Interaction interaction,
                                              javax.resource.cci.InteractionSpec ispec,
                                              javax.resource.cci.IndexedRecord[] inputRecord,
                                              javax.resource.cci.IndexedRecord[] predicates)
                                                throws javax.ejb.RemoveException,
                                                       javax.resource.ResourceException
        Specified by:
        executeRemove in interface com.ibm.websphere.ejbpersistence.EJBToRAAdapter
        Parameters:
        interaction - javax.resource.cci.Interaction: the interaction to call "execute(...)"
        ispec - javax.resource.cci.InteractionSpec the interactionSpecs, see J2EE Connector spec, CCI
        inputRecord - javax.resource.cci.IndexedRecord an array of the indexedRecord, see J2EE Connector spec, CCI
        predicates - javax.resource.cci.IndexedRecord[]: predicates an array of the indexedRecord, see J2EE Connector spec, CCI
        Returns:
        javax.resource.cci.Record see J2EE Connector spec, CCI
        Throws:
        javax.resource.ResourceException
        javax.ejb.RemoveException
        See Also:
        EJBToRAAdapter.executeRemove(Interaction, InteractionSpec, IndexedRecord[], IndexedRecord[])
      • executeUpdate

        public javax.resource.cci.Record executeUpdate(javax.resource.cci.Interaction interaction,
                                              javax.resource.cci.InteractionSpec ispec,
                                              javax.resource.cci.IndexedRecord[] inputRecord,
                                              javax.resource.cci.IndexedRecord[] predicates,
                                              boolean[][] dirtyBits,
                                              java.lang.String cursorName)
                                                throws javax.ejb.EJBException,
                                                       javax.resource.ResourceException
        Specified by:
        executeUpdate in interface com.ibm.websphere.ejbpersistence.EJBToRAAdapter
        Parameters:
        interaction - javax.resource.cci.Interaction: the interaction to call "execute(...)"
        ispec - javax.resource.cci.InteractionSpec the interactionSpecs, see J2EE Connector spec, CCI
        inputRecord - javax.resource.cci.IndexedRecord an array of the indexedRecord, see J2EE Connector spec, CCI
        predicates - javax.resource.cci.IndexedRecord[]: predicates an array of the indexedRecord, see J2EE Connector spec, CCI
        dirtyBits - boolean[]: not used corrently, but will be used for partial updated
        cursorName -
        Returns:
        null all the time, since we know its not a finder
        Throws:
        javax.ejb.EJBException
        javax.resource.ResourceException
        See Also:
        EJBToRAAdapter.executeUpdate(Interaction, InteractionSpec, IndexedRecord[], IndexedRecord[], boolean[][], String)
      • executeOther

        public javax.resource.cci.Record executeOther(javax.resource.cci.Interaction interaction,
                                             javax.resource.cci.InteractionSpec ispec,
                                             javax.resource.cci.IndexedRecord[] inputRecord)
                                               throws javax.resource.ResourceException
        Specified by:
        executeOther in interface com.ibm.websphere.ejbpersistence.EJBToRAAdapter
        Parameters:
        interaction - javax.resource.cci.Interaction: the interaction to call "execute(...)"
        ispec - javax.resource.cci.InteractionSpec the interactionSpecs, see J2EE Connector spec, CCI
        inputRecord - javax.resource.cci.IndexedRecord an array of the indexedRecord, see J2EE Connector spec, CCI
        Returns:
        javax.resource.cci.Record
        Throws:
        javax.resource.ResourceException
        See Also:
        EJBToRAAdapter.executeOther(Interaction, InteractionSpec, IndexedRecord[])
      • isBatchSupported

        public boolean isBatchSupported(javax.resource.cci.ConnectionFactory connectionFactory,
                               com.ibm.websphere.appprofile.accessintent.AccessIntent accessIntent)
        Specified by:
        isBatchSupported in interface com.ibm.websphere.ejbpersistence.EJBToRAAdapter
        Parameters:
        connectionFactory -
        accessIntent -
        Returns:
        boolean to indicate whether batch update is supported or not
        See Also:
        EJBToRAAdapter.isBatchSupported(ConnectionFactory, AccessIntent)
      • getTracer

        protected com.ibm.ejs.ras.TraceComponent getTracer()

        This method gets the trace component. This method is used for get the trace component of the subclasses. Some methods are inherited by the subclasses. When these inherited methods are called via the subclass, we need to get the trace component of the subclass so the class names of the subclasses is displayed in the trace.

        Returns:
        a trace component
      • executeReadReadChecking

        public boolean[] executeReadReadChecking(javax.resource.cci.Interaction interaction,
                                        javax.resource.cci.InteractionSpec ispec,
                                        javax.resource.cci.IndexedRecord[] inputRecord)
                                          throws javax.ejb.EJBException,
                                                 javax.resource.ResourceException
        Using the given Interaction object, call the "executeBatchRead(InteractionSpec ispec, Record inrec)" method with the given InteractionSpec and input Record; no Record should be returned from this call, instead a boolean array is returned. records are processed differently for the purpose of verifying if the rows exist in the table. Note that this method is used when submitting a batch of query requests (doing batch find). If the backend supports batch query, then requests are sent as a batch, if not, then they are sent one by one. a system property defined in the WSResourceAdapterBase has the definition of this system property.
        Specified by:
        executeReadReadChecking in interface com.ibm.websphere.ejbpersistence.EJBToRAAdapter
        Parameters:
        interaction - javax.resource.cci.Interaction: an array of the the interaction to call "execute(...)"
        ispec - javax.resource.cci.InteractionSpec an array of the interactionSpecs, see J2EE Connector spec, CCI
        inputRecord - javax.resource.cci.IndexedRecord an array of the indexedRecord, see J2EE Connector spec, CCI
        Returns:
        boolean[]: in the array, true represents a found row, and false represents a not found row
        Throws:
        javax.resource.ResourceException
        javax.ejb.EJBException
IBM WebSphere Application ServerTM
Release 9.0