OracleConnection with CMT

          Greetings,
          I'm using Oracle Data types in my EJB Session Bean program and for that reason
          have to use OracleConnection. The Oralce JDBC code has to be runnig within a
          transaction (I use Container Managed Transaction). When I obtain a connecction
          from the pool it has a data type weblogic.jdbc.jts.Connection. Is there a way
          to obtain an OracleConnection from it.
          The weblogic.jdbc.jts.Connection class has a method getVendorConnection() that
          returns null.
          Please help!
          P.S. We use WebLogic 7.1 and Oracle9i
          

already answered in the jdbc newsgroup.
          Dmitry Amelchenko wrote:
          > Greetings,
          >
          > I'm using Oracle Data types in my EJB Session Bean program and for that reason
          > have to use OracleConnection. The Oralce JDBC code has to be runnig within a
          > transaction (I use Container Managed Transaction). When I obtain a connecction
          > from the pool it has a data type weblogic.jdbc.jts.Connection. Is there a way
          > to obtain an OracleConnection from it.
          > The weblogic.jdbc.jts.Connection class has a method getVendorConnection() that
          > returns null.
          >
          > Please help!
          >
          > P.S. We use WebLogic 7.1 and Oracle9i
          

Similar Messages

  • Rollback not working with CMT or BMT ?

    Is the container (OC4J) not rolling back transactions ? Are you using CMT or BMT ?
    I had this problem with a stateless session bean using CMT and / or BMT. The problem was related to my datasource configuration. With OC4J you can have two types of datasources, emulated and non-emulated. Emulated datasources do not support JTA. Your EJBs must use a non-emulated 'transactional' datasource, e.g.
    <data-source
    class="com.evermind.sql.OrionCMTDataSource"
    name="EDM DataSource"
    location="jdbc/TestDS"
    connection-driver="oracle.jdbc.driver.OracleDriver"
    username="scott"
    password="tiger"
    url="jdbc:oracle:oci8:@myDB"
    />
    Hope this tip saves other developers some time and headaches...

    Helen -- Can you send me the particualars on the problem you noted? Emulated data sources should work. I would like to understand this in more detail and if this is a bug make sure it gets logged. Can you give me your version, a description of the problem, and a test case if you have it.
    Thanks -- Jeff Schafer ([email protected])
    See TAR 2381015.996 - it has all the details and a test case which was reproduced by Oracle Support

  • SONIC MQ - Message Driven Bean with CMT

    Hi guys,
    I am having hard time with MDB having container managed transaction with TX attribute required. I am using RAD 6.0.1 and the JMS provider is Sonic MQ.I have defined XAConnectionFactory on Sonic side. The MDB runs without any error, but when I shut down the app server the message appears back in the queue. When I use transaction attribute as NOT SUPPORTED everything runs as normal.
    Am I missing something on the configuration here?
    I am seeing the XA implementation classes in the sonic jar file, but do I need their resource adaptor from sonic?
    Thanks
    Matt

    The current version of the white-paper that Raffi
              refers to covers through 7.0. For 8.1 see also
              http://edocs.bea.com/wls/docs81/ConsoleHelp/jms_config.html#accessing_foreign_providers
              and
              http://edocs.bea.com/wls/docs81/jms/j2ee_components.html
              these features can often make integration easier.
              Tom
              Raffi wrote:
              > Doug,
              >
              > You can find very detailed information on this topic at the link below. All
              > you need to do is specify the destination-jndi-name, initial-context-factory,
              > provider-url, and connection-factory-jndi-name in weblogic-ejb-jar.xml for the
              > non-BEA JMS provider for that specific MDB.
              >
              > ftp://edownload:[email protected]/pub/downloads/jmsproviders.pdf
              >
              > Hope that helps!
              >
              > Raffi
              >
              > Doug Chew <[email protected]> wrote:
              >
              >>Can someone give me an example on how to setup a message driven bean
              >>with a foreign JMS provider using the foreign JMS provider's implementation
              >>of a connection factory. i.e. binding the foreign JMS provider's connection
              >>factory to the JNDI tree.
              >>
              >>Thanks
              >
              >
              

  • Message Driven Beans with "Required" CMT and duplicate delivery of messages

    Hi,
    Let's pretend that an MDB is configured with CMT and the "Required" transaction attribute. Let's suppose that it has received a message and is busy processing it in a transaction that might take some time to complete.
    Is a JEE container required to ensure that while a message is being handled by an MDB in a transaction that's neither completed nor rolled back, no dupes of the same message should be delivered to another instance of the same MDB?

    user572625 wrote:
    Hi,
    Let's pretend that an MDB is configured with CMT and the "Required" transaction attribute. Let's suppose that it has received a message and is busy processing it in a transaction that might take some time to complete.
    Is a JEE container required to ensure that while a message is being handled by an MDB in a transaction that's neither completed nor rolled back, no dupes of the same message should be delivered to another instance of the same MDB?First, define "dupe".
    Note that the main reason to use JEE technology over simpler frameworks is robustness, so if I understand your slightly vague question correctly, you can make the safe assumption that the answer is yes.

  • How to Create and Remove CMP Entity with Toplink in same transaction??

    Hi, i have a problem to create and delete cmp intances with toplink.
    I create a entity bean and remove the same entity bean in the same transaction.
    ie. my method have this code:
    bean a = homeBean.create(pk);
    a.remove();
    bean a = homeBean.create(pk);
    this code throws a javax.ejb.DuplicateKeyException
    Toplink not remove CMP, execute the two calls of create first.
    What configure toplink to support this case ??
    Is this possible ??
    I Can't controling the transaction manualy i'm using CMP entity beans with CMT.
    tanks.
    Message was edited by:
    Carlos Lacerda

    BM,
    If you want to import the utils package into your code, then the location of the utils package has to be in your CLASSPATH. JDeveloper uses libraries to define a project's CLASSPATH.
    I'm not sure exactly what's going on here, but you might want to read the information about packages and class libraries in the online documentation. It's under:
    User Guides
    -> Working with JDeveloper
    -> Packages and Class Libraries
    Blaise

  • Proxy user authentication with BC4J

    On my webapp i have a connections pool and a MyApplicationModule.
    I can obtain a OracleConnection instace by overriding the method prepareSession()
    into the application module.
    I need to associate the OracleConnection with the ApplicationModule object to execute my queries with the application module and the proxy user.
    The application module is created by this code:
    appMod = (MyApplicationModule)Configuration.createRootApplicationModule("xx.xxx.MyApplicationModule", "MyApplicationModuleLocalTest1");
    The prepareSession ovverride is done by this code:
    protected void prepareSession(Session session) {
    Statement st = null;
    try {
    st = getDBTransaction().createPreparedStatement("rollback",0);
    OracleConnection oConn = (OracleConnection)st.getConnection();
    Properties props = new Properties();
    props.put("PROXY_USER_NAME", "USERTEST");
    oConn.openProxySession
    (OracleConnection.PROXYTYPE_USER_NAME,props);
    catch (SQLException s) {
    //ignore
    finally {
    if (st != null) {
    try {
    st.close();
    catch (SQLException s) { }
    super.prepareSession(session);
    Tanks and sorry for my poor english.

    I found the possibility that proxy authentication of both accounts can be enforced:
    SQL> alter user appuser grant connect through personaluser AUTHENTICATION REQUIRED;
    I guess that this is the motivation for implementing the 2-session proxy connection method in SQL Developer.
    Regards,
    Martin

  • Update form another EJB with DAO persistence

    We have two modules with EJB Session, stateless, with CMT requeried in all methods, the first module has the persistence tier wiht DAOs pattern and the other module uses TopLink. We are using JSF as framework in the presentation layer, when we are going to update the database from web form a backing bean JSFcalls the first EJB (DAOs persistence) and this EJB invokes the other EJB (Toplink persistence). and throws the next exception
    05/10/31 17:12:12 java.lang.NullPointerException
    05/10/31 17:12:12      at oracle.toplink.internal.indirection.UnitOfWorkValueHolder.getValueFromServerObject(UnitOfWorkValueHolder.java:105)
    05/10/31 17:12:12      at oracle.toplink.internal.indirection.UnitOfWorkValueHolder.instantiate(UnitOfWorkValueHolder.java:144)
    05/10/31 17:12:12      at oracle.toplink.internal.indirection.DatabaseValueHolder.getValue(DatabaseValueHolder.java:64)
    05/10/31 17:12:12      at oracle.toplink.internal.indirection.BasicIndirectionPolicy.cloneAttribute(BasicIndirectionPolicy.java:88)
    05/10/31 17:12:12      at oracle.toplink.mappings.ForeignReferenceMapping.buildClone(ForeignReferenceMapping.java)
    05/10/31 17:12:12      at oracle.toplink.internal.descriptors.ObjectBuilder.populateAttributesForClone(ObjectBuilder.java:1492)
    05/10/31 17:12:12      at oracle.toplink.publicinterface.UnitOfWork.cloneAndRegisterNewObject(UnitOfWork.java:601)
    05/10/31 17:12:12      at oracle.toplink.publicinterface.UnitOfWork.internalRegisterObject(UnitOfWork.java:2294)
    05/10/31 17:12:12      at oracle.toplink.internal.sessions.MergeManager.registerObjectForMergeCloneIntoWorkingCopy(MergeManager.java:688)
    05/10/31 17:12:12      at oracle.toplink.internal.sessions.MergeManager.mergeChangesOfCloneIntoWorkingCopy(MergeManager.java:397)
    05/10/31 17:12:12      at oracle.toplink.internal.sessions.MergeManager.mergeChanges(MergeManager.java:181)
    05/10/31 17:12:12      at oracle.toplink.publicinterface.UnitOfWork.mergeClone(UnitOfWork.java:2634)
    05/10/31 17:12:12      at oracle.toplink.publicinterface.UnitOfWork.deepMergeClone(UnitOfWork.java:1231)
    05/10/31 17:12:12      at siscoi.declaracionescambio.business.DeclaracionesCambioMngr.grabarDeclaracionCambio(DeclaracionesCambioMngr.java:222)
    when the objects are new the TopLink framework works good, but when the object already exist in the DB, does not make the update an thorw the null pointer exception why?.
    We implements a Client Class to only test the EJB with Toplink persistence. In this class read a object from de database and i modify the object and calls the update method and the update works good.
    Container oc4j 10.1.2
    Toplink 9.0.4
    jdk 1.4.2.04
    please help me!!

    It looks like the issue is occurring because the object that you are merging is a new object, or TopLink thinks it is a new object and it is being registered as a new object. The new object has a non-instantiated value-holder that seems to have been serialized so can no longer be instantiated, but the relationship is required to persist the new object.
    My guess is that the object is not new, but existing, and the issue is most likely with your does-exist-check option. The original object may no longer be in the cache, so you most likely need to use check-database for your descriptor's does-exist option, instead of the default of check-cache.

  • How to import oracle.jdbc.OracleConnection

    I'm sure this is something I'm supposed to know but it has been about a year since I have worked with JDeveloper and I have forgotten a few things.
    I am looking at some code that includes import oracle.jdbc.OracleConnection with a wavy red line that gives the message "import oracle.jdbc.OracleConnection not found."
    Where should I start to look for how to repair this?
    Thanks,
    Gregory

    In your project properties, in the libraries and classpath section, add the library "Oracle JDBC".

  • Install ODAC 11.10620 exception on new oracleconnection

    I have installed odac 11 and i get an exception in this code line:
    conexion = New OracleConnection
    with previous version 10 i haven't this exception.
    Exception information :
    El código de usuario no controló System.TypeInitializationException
    Message="Se produjo una excepción en el inicializador de tipo de 'Oracle.DataAccess.Client.OracleConnection'."
    Source="Oracle.DataAccess"
    TypeName="Oracle.DataAccess.Client.OracleConnection"
    StackTrace:
    en Oracle.DataAccess.Client.OracleConnection..ctor()
    en GestionServicios.Global_asax.Global_asax_PreRequestHandlerExecute(Object sender, EventArgs e) en O:\Dotnet\Desarrollo1\ASPNET\PROYECTOS\GestionServicios\Global.asax.vb:línea 63
    en System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
    en System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
    What's happening?
    Thanks .

    Please post this to the Oracle Data Provider for .NET forum

  • CMT cause locks in the database

    We are using CMT. The tx_datasource uses the Sybase non-xa conneciton pool. And
    only one datasource is used in the container transactions. According to the documentation,
    the jts wrapper of the non-xa driver should be used internally for the CMT, hence,
    only one connection is used for each transaction involved. But we saw more than
    one connections are used in the transaction, and the connections lock each other
    in Sybase. Can anyone help: how to ensure one database connection for one transaction
    with CMT?
    Thanks,
    Haoguang

    I'm not sure if's connected, but it looks like you are trying to invoke a finder
    afer be.azvub.j2ee.schedule.bean.CBSchedulingServerBean.pasteAgendaTemplates
    method caused transaction rollback.
    Also, what are the TX attributes of the EJB? Do you use RequresNew?
    Other thing is that MaxCapacity="5" for the pool is way too low - it should be equal
    at least number of exec threads...
    Regards,
    Slava Imeshev
    "Haoguang" <[email protected]> wrote in message news:[email protected]...
    >
    Hi, Slava,
    Indeed I forgot to say which version of wls. I have done the test on both wls7.0sp2
    and the wls8.1sp1, got the same result. Here under is the part of the config.xml
    and the log of wls7.0sp2.
    Thanks,
    Haoguang
    Connection pool:
    <JDBCConnectionPool CapacityIncrement="2"
    DriverName="com.sybase.jdbc2.jdbc.SybDriver"
    KeepXAConnTillTxComplete="true" MaxCapacity="5" Name="sybase"
    Password="{3DES}806G7/IUF2V3CYIDxhqoxg=="
    PreparedStatementCacheSize="10"
    Properties="FAKE_METADATA=true;user=haoguang"
    SupportsLocalTransaction="true" Targets="myserver"
    TestConnectionsOnRelease="true" TestConnectionsOnReserve="true"
    TestTableName="resource_db..feestdagen" URL="jdbc:sybase:Tds:dp_dsp_st_1:3050"/>
    TX_DataSource:
    <JDBCTxDataSource EnableTwoPhaseCommit="true" JNDIName="tx_sybase"
    Name="tx_sybase" PoolName="sybase" Targets="myserver"/>
    JTA log
    ####<Oct 29, 2003 9:53:25 AM CET> <Debug> <JTA> <inf237> <myserver> <ExecuteThread:
    '10' for queue: 'default'> <kernel identity> <49:df0ad1997f28edb9> <110027> <49:df0ad1997f28edb9:
    enlist weblogic.jdbc.jts.Connection, beforeState=new>
    ####<Oct 29, 2003 9:53:25 AM CET> <Debug> <JTA> <inf237> <myserver> <ExecuteThread:
    '10' for queue: 'default'> <kernel identity> <49:df0ad1997f28edb9> <110027> <49:df0ad1997f28edb9:
    XA.start(rm=weblogic.jdbc.jts.Connection, xar=weblogic.jdbc.jts.Connection@499877,
    flags=TMNOFLAGS)>
    ####<Oct 29, 2003 9:53:25 AM CET> <Debug> <JTA> <inf237> <myserver> <ExecuteThread:
    '10' for queue: 'default'> <kernel identity> <> <110027> <ResourceDescriptor[weblogic.jdbc.jts.Connection]:
    startResourceUse, Number of active requests:1, last alive time:0 ms ago.>
    ####<Oct 29, 2003 9:53:25 AM CET> <Debug> <JTA> <inf237> <myserver> <ExecuteThread:
    '10' for queue: 'default'> <kernel identity> <49:df0ad1997f28edb9> <110027> <49:df0ad1997f28edb9:
    XA.start DONE (rm=weblogic.jdbc.jts.Connection, xar=weblogic.jdbc.jts.Connection@499877>
    ####<Oct 29, 2003 9:53:25 AM CET> <Debug> <JTA> <inf237> <myserver> <ExecuteThread:
    '10' for queue: 'default'> <kernel identity> <49:df0ad1997f28edb9> <110027><ResourceDescriptor[weblogic.jdbc.jts.Connection]:
    endResourceUse, Number of active requests:0>
    ####<Oct 29, 2003 9:53:25 AM CET> <Debug> <JTA> <inf237> <myserver> <ExecuteThread:
    '10' for queue: 'default'> <kernel identity> <49:df0ad1997f28edb9> <110027> <Resource[weblogic.jdbc.jts.Connection]
    new-->started>
    ####<Oct 29, 2003 9:53:25 AM CET> <Debug> <JTA> <inf237> <myserver> <ExecuteThread:
    '10' for queue: 'default'> <kernel identity> <49:df0ad1997f28edb9> <110027> <49:df0ad1997f28edb9:
    enlist weblogic.jdbc.jts.Connection, afterState=started>
    ####<Oct 29, 2003 9:53:25 AM CET> <Debug> <JTA> <inf237> <myserver> <ExecuteThread:
    '10' for queue: 'default'> <kernel identity> <49:df0ad1997f28edb9> <110027> <49:df0ad1997f28edb9:
    [EJBbe.azvub.j2ee.schedule.bean.CBSchedulingServerBean.pasteAgendaTemplates(java.lang.String,java.lang.String,int,java.util.
    Collection,java.util.Collection)]:
    setProperty: weblogic.jdbc=t3://144.248.0.237:7001>
    ####<Oct 29, 2003 9:53:25 AM CET> <Debug> <JTA> <inf237> <myserver> <ExecuteThread:
    '10' for queue: 'default'> <kernel identity> <> <110027> <49:df0ad1997f28edb9:
    delist weblogic.jdbc.jts.Connection, TMSUSPEND, beforeState=started, startThread=Thread[ExecuteThread:
    '10' for queue: 'default',5,Thread Group for Queue: 'default']>
    ####<Oct 29, 2003 9:53:25 AM CET> <Debug> <JTA> <inf237> <myserver> <ExecuteThread:
    '10' for queue: 'default'> <kernel identity> <> <110027> <49:df0ad1997f28edb9:
    XA.end(rm=weblogic.jdbc.jts.Connection, xar=weblogic.jdbc.jts.Connection@499877,
    flags=TMSUCCESS)>
    ####<Oct 29, 2003 9:53:25 AM CET> <Debug> <JTA> <inf237> <myserver> <ExecuteThread:
    '10' for queue: 'default'> <kernel identity> <> <110027> <ResourceDescriptor[weblogic.jdbc.jts.Connection]:
    startResourceUse, Number of active requests:1, last alive time:0 ms ago.>
    ####<Oct 29, 2003 9:53:25 AM CET> <Debug> <JTA> <inf237> <myserver> <ExecuteThread:
    '10' for queue: 'default'> <kernel identity> <> <110027> <49:df0ad1997f28edb9:
    XA.end DONE (rm=weblogic.jdbc.jts.Connection, xar=weblogic.jdbc.jts.Connection@499877>
    ####<Oct 29, 2003 9:53:25 AM CET> <Debug> <JTA> <inf237> <myserver> <ExecuteThread:
    '10' for queue: 'default'> <kernel identity> <> <110027> <ResourceDescriptor[weblogic.jdbc.jts.Connection]:
    endResourceUse, Number of active requests:0>
    ####<Oct 29, 2003 9:53:25 AM CET> <Debug> <JTA> <inf237> <myserver> <ExecuteThread:
    '10' for queue: 'default'> <kernel identity> <> <110027> <Resource[weblogic.jdbc.jts.Connection]
    started-->ended>
    ####<Oct 29, 2003 9:53:25 AM CET> <Debug> <JTA> <inf237> <myserver> <ExecuteThread:
    '10' for queue: 'default'> <kernel identity> <> <110027> <49:df0ad1997f28edb9:
    delist weblogic.jdbc.jts.Connection, afterStateended>
    ####<Oct 29, 2003 9:53:59 AM CET> <Debug> <JTA> <inf237> <myserver> <Thread-0>
    <kernel identity> <> <110027> <wakeUp runing: 49:df0ad1997f28edb9>
    ####<Oct 29, 2003 9:53:59 AM CET> <Debug> <JTA> <inf237> <myserver> <Thread-0>
    <kernel identity> <> <110027> <Still within transaction abandon grace period.
    Will start abandoning transactions after 531 seconds. 49:df0ad1997f28edb9>
    ####<Oct 29, 2003 9:53:59 AM CET> <Debug> <JTA> <inf237> <myserver> <Thread-0>
    <kernel identity> <> <110027> <49:df0ad1997f28edb9 wakeUpAfterSeconds(30)>
    ####<Oct 29, 2003 9:53:59 AM CET> <Debug> <JTA> <inf237> <myserver> <Thread-0>
    <kernel identity> <> <110027> <49:df0ad1997f28edb9 wakeUpAfterSeconds(30)>
    ####<Oct 29, 2003 9:53:59 AM CET> <Debug> <JTA> <inf237> <myserver> <Thread-0>
    <kernel identity> <> <110027> <49:df0ad1997f28edb9 wakeUpAfterSeconds(10)>
    ####<Oct 29, 2003 9:54:09 AM CET> <Debug> <JTA> <inf237> <myserver> <Thread-0>
    <kernel identity> <> <110027> <wakeUp runing: 49:df0ad1997f28edb9>
    ####<Oct 29, 2003 9:54:09 AM CET> <Debug> <JTA> <inf237> <myserver> <Thread-0>
    <kernel identity> <> <110027> <Still within transaction abandon grace period.
    Will start abandoning transactions after 521 seconds. 49:df0ad1997f28edb9>
    ####<Oct 29, 2003 9:54:09 AM CET> <Debug> <JTA> <inf237> <myserver> <Thread-0>
    <kernel identity> <> <110027> <49:df0ad1997f28edb9 wakeUpAfterSeconds(30)>
    ####<Oct 29, 2003 9:54:09 AM CET> <Debug> <JTA> <inf237> <myserver> <ExecuteThread:
    '12' for queue: 'default'> <kernel identity> <> <110027> <49:df0ad1997f28edb9:
    [EJBbe.azvub.j2ee.schedule.bean.CBSchedulingServerBean.pasteAgendaTemplates(java.lang.String,java.lang.String,int,java.util.
    Collection,java.util.Collection)]:
    ServerTransactionImpl.globalRollback()>
    ####<Oct 29, 2003 9:54:09 AM CET> <Debug> <JTA> <inf237> <myserver> <ExecuteThread:
    '12' for queue: 'default'> <kernel identity> <> <110027> <49:df0ad1997f28edb9:
    [EJBbe.azvub.j2ee.schedule.bean.CBSchedulingServerBean.pasteAgendaTemplates(java.lang.String,java.lang.String,int,java.util.
    Collection,java.util.Collection)]:
    TX[49:df0ad1997f28edb9] active-->rolling back>
    ####<Oct 29, 2003 9:54:09 AM CET> <Debug> <JTA> <inf237> <myserver> <ExecuteThread:
    '12' for queue: 'default'> <kernel identity> <> <110027> <49:df0ad1997f28edb9:
    [EJBbe.azvub.j2ee.schedule.bean.CBSchedulingServerBean.pasteAgendaTemplates(java.lang.String,java.lang.String,int,java.util.
    Collection,java.util.Collection)]:
    assignLocalRes. localsc=myserver+144.248.0.237:7001+mydomain+t3+, res=weblogic.jdbc.jts.Connection>
    ####<Oct 29, 2003 9:54:09 AM CET> <Debug> <JTA> <inf237> <myserver> <ExecuteThread:
    '12' for queue: 'default'> <kernel identity> <> <110027> <49:df0ad1997f28edb9:
    delist weblogic.jdbc.jts.Connection, TMFAIL, beforeState=ended, startThread=null>
    ####<Oct 29, 2003 9:54:09 AM CET> <Debug> <JTA> <inf237> <myserver> <ExecuteThread:
    '12' for queue: 'default'> <kernel identity> <> <110027> <ServerSCInfo.startRollback:
    49:df0ad1997f28edb9>
    ####<Oct 29, 2003 9:54:09 AM CET> <Debug> <JTA> <inf237> <myserver> <ExecuteThread:
    '12' for queue: 'default'> <kernel identity> <> <110027><ServerResourceInfo[weblogic.jdbc.jts.Connection].rollback(tx):
    49:df0ad1997f28edb9>
    ####<Oct 29, 2003 9:54:09 AM CET> <Debug> <JTA> <inf237> <myserver> <ExecuteThread:
    '12' for queue: 'default'> <kernel identity> <> <110027> <49:df0ad1997f28edb9:
    ServerResourceInfo[weblogic.jdbc.jts.Connection].rollback(tx, xid)>
    ####<Oct 29, 2003 9:54:09 AM CET> <Debug> <JTA> <inf237> <myserver> <ExecuteThread:
    '12' for queue: 'default'> <kernel identity> <> <110027> <49:df0ad1997f28edb9:
    XAResource[weblogic.jdbc.jts.Connection].rollback()>
    ####<Oct 29, 2003 9:54:09 AM CET> <Debug> <JTA> <inf237> <myserver> <ExecuteThread:
    '12' for queue: 'default'> <kernel identity> <> <110027> <ResourceDescriptor[weblogic.jdbc.jts.Connection]:
    startResourceUse, Number of active requests:1, last alive time:0 ms ago.>
    ####<Oct 29, 2003 9:54:09 AM CET> <Debug> <JTA> <inf237> <myserver> <ExecuteThread:
    '12' for queue: 'default'> <kernel identity> <> <110027> <49:df0ad1997f28edb9:
    XAResource[weblogic.jdbc.jts.Connection].rollback: SUCCESS>
    ####<Oct 29, 2003 9:54:09 AM CET> <Debug> <JTA> <inf237> <myserver> <ExecuteThread:
    '12' for queue: 'default'> <kernel identity> <> <110027> <ResourceDescriptor[weblogic.jdbc.jts.Connection]:
    endResourceUse, Number of active requests:0>
    ####<Oct 29, 2003 9:54:09 AM CET> <Debug> <JTA> <inf237> <myserver> <ExecuteThread:
    '12' for queue: 'default'> <kernel identity> <> <110027> <49:df0ad1997f28edb9:
    [EJBbe.azvub.j2ee.schedule.bean.CBSchedulingServerBean.pasteAgendaTemplates(java.lang.String,java.lang.String,int,java.util.
    Collection,java.util.Collection)]:
    setResourceOrSCCompletionState: C_ROLLEDBACK>
    ####<Oct 29, 2003 9:54:09 AM CET> <Debug> <JTA> <inf237> <myserver> <ExecuteThread:
    '12' for queue: 'default'> <kernel identity> <> <110027> <ServerResourceInfo[weblogic.jdbc.jts.Connection].rollback
    done>
    ####<Oct 29, 2003 9:54:09 AM CET> <Debug> <JTA> <inf237> <myserver> <ExecuteThread:
    '12' for queue: 'default'> <kernel identity> <> <110027> <Resource[weblogic.jdbc.jts.Connection]
    ended-->rolledback>
    ####<Oct 29, 2003 9:54:09 AM CET> <Info> <EJB> <inf237> <myserver> <ExecuteThread:
    '10' for queue: 'default'> <kernel identity> <> <010049> <EJB Exception in method:
    ejbFindByResourceParentAndResourceChildAndWeekday: javax.transaction.InvalidTransactionException:
    Attempt to resume an inactive transaction: 49:df0ad1997f28edb9>
    javax.transaction.InvalidTransactionException: Attempt to resume an inactive transaction:
    49:df0ad1997f28edb9
    at weblogic.transaction.internal.TransactionManagerImpl.resume(TransactionManagerImpl.java:357)
    at weblogic.transaction.internal.ServerTransactionManagerImpl.resume(ServerTransactionManagerImpl.java:304)
    at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.resumeTransaction(RDBMSPersistenceManager.java:768)
    atbe.azvub.j2ee.schedule.CPAgendaTemplateBean_hizf65__WebLogic_CMP_RDBMS.ejbFindByResourceParentAndResourceChildAndWeekday
    (CPAgendaTemplateBean_hizf65__WebLogic_CMP_RDBMS.java:1331)
    at java.lang.reflect.Method.invoke(Native Method)
    at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.collectionFinder(RDBMSPersistenceManager.java:330)
    at weblogic.ejb20.manager.BaseEntityManager.collectionFinder(BaseEntityManager.java:983)
    at weblogic.ejb20.manager.BaseEntityManager.collectionFinder(BaseEntityManager.java:955)
    at weblogic.ejb20.internal.EntityEJBLocalHome.finder(EntityEJBLocalHome.java:476)
    atbe.azvub.j2ee.schedule.CPAgendaTemplateBean_hizf65_LocalHomeImpl.findByResourceParentAndResourceChildAndWeekday(CPAgenda
    TemplateBean_hizf65_LocalHomeImpl.java:132)
    at be.azvub.j2ee.schedule.bean.CBSchedulingServerBean.initAgendaTemplate(CBSchedulingServerBean.java:669)
    at be.azvub.j2ee.schedule.bean.CBSchedulingServerBean.pasteAgendaTemplate(CBSchedulingServerBean.java:856)
    atbe.azvub.j2ee.schedule.bean.CBSchedulingServerBean_srjcdy_EOImpl.pasteAgendaTemplate(CBSchedulingServerBean_srjcdy_EOImp
    l.java:1932)
    at be.azvub.j2ee.schedule.bean.CBSchedulingServerBean.pasteAgendaTemplates(CBSchedulingServerBean.java:917)
    atbe.azvub.j2ee.schedule.bean.CBSchedulingServerBean_srjcdy_EOImpl.pasteAgendaTemplates(CBSchedulingServerBean_srjcdy_EOIm
    pl.java:1878)
    at be.azvub.j2ee.schedule.bean.CBSchedulingServerBean_srjcdy_EOImpl_WLSkel.invoke(Unknown
    Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:362)
    at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:114)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:313)
    at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:821)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:308)
    at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)

  • Local transaction in EJB CMT

    I've an EJB Staless Session Bean with CMT transaction; is it possible start, inside a global transaction, a local transaction? I need this because I've to send always a message in a queue, even when a RunTimeException occured in my ejb, so I can't run my sender class (a simple appender for log4j) in a global transaction.
    My environment is IBM WebSphere and IBM MQ Series.
    If is not possible, any suggestions or idea to accomplish my need?
    Thanks in advance.
    Rob

    yes, you can do this. basically, what you need to do is create a separate method with a REQUIRES_NEW transaction annotation. the trick, however, is that you can't just call this method normally. what you need to do is get a handle to the public interface of the local ejb and invoke this second method through that handle. i believe you can use SessionContext.getBusinessObject to get this handle (although, this didn't work on the version of jboss i used at my last job, we had to use local jndi lookups).

  • How to create transaction in web tier

    Hi everyone;
    I have a problem with cmt session bean methods.I'm using user transaction interface at servlet.How can i joining cmt methods in existing transaction which is created by web tier.
    I tried this code for my aim but it didn't work properly it gives an error.
    The errors is=IllegalStateException.
    Context context = new InitialContext();
    UserTransaction userTransaction =
    (UserTransaction) context.lookup("java:comp/UserTransaction");
    userTransaction.begin();
    // Perform transacted tasks.
    userTransaction.commit();My session beans are cmt and transaction scoped persistence context and stateless.Is it possible to use user transaction interface with cmt methods.
    Please give me an advice how can i overhelm this problem,i'm looking forward to hearing your suggestions.
    Faruk Naml&#305;

    java.lang.IllegalStateException
    at com.sun.jts.jta.TransactionManagerImpl.rollback(TransactionManagerImpl.java:346)
    at com.sun.enterprise.distributedtx.J2EETransactionManagerImpl.rollback(J2EETransactionManagerImpl.java:1150)
    at com.sun.enterprise.distributedtx.J2EETransactionManagerOpt.rollback(J2EETransactionManagerOpt.java:433)
    at com.sun.enterprise.distributedtx.UserTransactionImpl.rollback(UserTransactionImpl.java:225)
    at com.columbus.teienPortal.insertion.EnterNewDocAction.execute(EnterNewDocAction.java:65)
    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
    at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:427)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:315)
    at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:287)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:218)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
    at org.apache.catalina.core.StandardPipeline.doChainInvoke(StandardPipeline.java:599)
    at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:92)
    at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:98)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:222)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:166)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096)
    at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:288)
    at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:647)
    at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:579)
    at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:831)
    at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
    at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
    at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
    at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
    at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
    |#]
    [#|2010-03-03T10:31:45.331+0200|WARNING|sun-appserver2.1|javax.enterprise.system.stream.err|_ThreadID=23;_ThreadName=httpSSLWorkerThread-8080-3;_RequestID=0c350e31-426a-4fb4-b066-461a2268a18b;|
    javax.transaction.RollbackException: Transaction marked for rollback.
    at com.sun.enterprise.distributedtx.J2EETransaction.commit(J2EETransaction.java:449)
    at com.sun.enterprise.distributedtx.J2EETransactionManagerOpt.commit(J2EETransactionManagerOpt.java:371)
    at com.sun.enterprise.distributedtx.UserTransactionImpl.commit(UserTransactionImpl.java:197)
    at com.columbus.teienPortal.insertion.EnterNewDocAction.execute(EnterNewDocAction.java:58)
    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
    at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:427)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:315)
    at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:287)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:218)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
    at org.apache.catalina.core.StandardPipeline.doChainInvoke(StandardPipeline.java:599)
    at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:92)
    at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:98)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:222)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:166)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096)
    at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:288)
    at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:647)
    at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:579)
    at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:831)
    at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
    at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
    at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
    at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
    at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
    |#]
    i want to execute more than one cmt methods in web tier in one transaction.
    if i insert data correctly to all,commit operation will be successfull.
    But,when the transaction need roolback,it throw above exceptions.

  • Can I use UserTransaction within a CMP Session bean?

    Basically the problem is as follow:
    I have the following method in a Statefull session bean:
    public Whatever do()
    processSomething();
    notify();
    the notify() basically notifying the client that then query for the something that was processed in the processSomething() method.
    THE PROBLEM is that the changes have not been committed yet as the do() method is not finished yet and the container has not committed the changes.
    THE QUESTION is - can I use UserTransaction inside
    processSomething to commit the changes and leave the bean as CMP? I want to leave it as CMP as there are more methods on the bean and I don't want to have to manage the transactions for them.
    Anyone has any other ideas?
    Thanks in advanced.

    Hi again,
    The EJB specs say that a stateful Session Bean with CMT is NOT allowed to use the UserTransaction; see page 361 of the EJB2.0 specification. So combining them will not (or should not) work.
    I suggest CMT+SessionSynchronization combined with using a flag to indicate whether notify should be called or not. Otherwise, you could try splitting up the bean into two beans: one with CMT and another one without. The one without CMT could use the UserTransaction and notify.
    Also, you might want to check http://www.onjava.com/pub/a/onjava/2001/10/02/ejb.html
    Hope that helps a bit,
    Guy
    http://www.atomikos.com

  • Container-managed / bean-managed transaction demarcation

    I am trying to make sure I understand container-managed and bean-managed transaction demarcation and in particular where you have one bean calling another bean. What happens where one of the beans has container-managed transaction demarcation and the other bean-managed transaction demarcation. In fact the initial question to ask is, is this allowed?
    Lets use an application scenario to illustrate the issue. The application has a payment transaction. Payments can be received in one of two ways:
    1. As a payment at a branch where the individual payment is processed on a client application and resulting in the processing of a single payment transaction.
    2. As a batch of payments received from a bank containing, potentially, thousands of payment transactions.
    The proposed implementation for this uses two session beans. The first is a Payment session bean that implements the business logic as appropriate calling entity beans to persist the change. The second is a BatchPayment session bean. This processes the batch of payment transactions received from the bank. The BatchPayment reads through the batch of payments from a bank calling the Payment session bean for each payment transaction.
    Lets look at the transactional properties of both session beans. In order to support the client application the Payment session bean can implicitly enforce transactional integrity and is therefore set to container-managed transaction demarcation. However the BatchPayment session bean will want to explicitly specify transaction demarcation for performance reasons. The transactional "commit" process is relatively expensive. When processing a large batch of transactions rather than performing a commit after every transaction is processed we want to perform the commit after a number of transactions have been processed. For example, we may decide that after every 100 transactions have been processed we commit. The processing will have a shorter elapsed time as we have not had to perform 99 commit processes. So the BatchPayment session bean will want to explicitly specify its transaction demarcation and will therefore be defined with bean-managed transaction demarcation.
    How would this be implemented? A possible solution is:
    Payment session bean implemented with container-managed transaction demarcation with transaction scope set to Required.
    BatchPayment session bean implemented with bean-managed transaction demarcation with transaction scope set to Required.
    When the client application is run it calls the Payment bean and the container-managed transaction demarcation ensures the transactional integrity of that transaction.
    When a BatchPayment process is run it explicitly determines the transaction demarcation. Lets say that after every 100 Payment transactions (through 100 calls to the Payment session bean) have been processed the BatchPayment bean issues a commit. In this scenario however we have mixed container-managed and bean-managed transaction demarcation. Hence my original question. Can container-managed and bean-managed transaction demarcation be mixed? If not how is it possible to implement the requirements as described above?
    Thanks for any thoughts.
    Paul

    BatchPayment session bean implemented with bean-managed transaction demarcation with transaction scope set to Required.Didn't quite understand this sentence.... if it's BMT it has no declarative transaction attributes such as "Required"....
    Anyway, first of all I'll have to ask, Why at all would you want to commit in the middle of the business method? to get as much through as possible before a potential crash? :-)
    Can container-managed and bean-managed transaction demarcation be mixed?Yes, of course. Just remember that the "direction" you are refering to ->
    a BMT SB that propagates it's transaction to a method in a CMT SB that is demarcated with "Required" is the simplest case. If it were "reversed", or for that matter any BMT that might be called within an active transaction context must perform logic to manipulate the transaction state. For instance(and most common case), checking to see if a transaction is active and if so not to do anything(just use the one that is already active).
    If not how is it possible to implement the requirements as described above?You could also implement this scenario with CMTs all the way through. your BatchPayment SB could consist of two methods, one (say, execute(Collection paymentsToExecute) ) with "Supports", and another(say executeBatchUnit(Collection paymentsToExecute, int beginIndex, int endIndex) ) with "RequiresNew".
    then have the first just call the other with indexes denoting each time a group of payments.
    Still, it does seem more suitable using BMT for these kind of things.....
    Hope this helped....

  • Messages don't dequeue

    I manually queued row LCR's using the procedure described in chapter 16 in streams documentation pages 16-3 to 16-7. My messages are effectively queued but they are in WAITING state and i don't know why they are not dequeued automatically by the apply process.
    Any ideas ?
    Claudine

    Even I seem to have a similar problem.
    I am trying a sample OTN sample for OJMS/AQ.
    My MDB (which is a SIMPLE CMT MDB, with AUTO_ACKNOWLEDGE) is receving notifications. No issues here.
    But, All messages are REDELIVERED to my MDB instance (until the RETRY COUNT expires) .
    And the DATABASE TABLE, AQ$RPTESTQTAB, shows the MSG_STATE as 'READY', even fter the onMessage() returns.
    Why are MESSAGES not getting DEQUEUED from the QUEUE?
    This is the SIMPLEST of all EXAMPLES, with CMT MDB, and the CODE FOR CREATION , STARTING the QUEUE was from OTN.
    Please help urgently , as I need to justify my company's investment in JMS.

Maybe you are looking for

  • Oracle 8.1.16 on RedHat 7.0

    Hello, i've managed to install Oracle 8.1.16 on RedHat 7.0 after numerous installation and going thru all the work around provided by those who have posted their message here.Thanks u guys. Anyway, I still having problem starting the db. Running svrm

  • New text does not obey style

    I have an ID document with styles in place. I just added a new 3-col text box and text to it, applied my "Body" style and the text actually has a different font applied to it!  No + sign next to the body name. Any thoughts on where this text is takin

  • Purchse order Query

    SELECT T0.[DocNum], T1.[DocNum], T2.[BaseRef] FROM ORDR T0 , OPOR T1 INNER JOIN POR1 T2 ON T1.DocEntry = T2.DocEntry WHERE T2.BaseRef=T0.DocNum i have problem in this query it is showing that sale order who purchase order is posted but my client want

  • BI dashboard integration with ADF can't show on chrome

    Hi all, we integrated BI dashboard in our adf application. but it is not showing at all in chrome browser. only analyses can show. With Regards, WP

  • Import partial songs

    Hi, Is it possible to import only the first 1 minute of every track in a CD using iTunes? When I look under Preferences>General>Import Settings, there is no such option available. Are there other software that can do this? I've found one (CDex) which