SQL Connection - EJB Transaction Integration

I am currently running Kodo 2.3.2 and JBoss 3.0 and I'm having the following
problem:
The SQLConnection returned from the PersistenceManager isn't always
transactionally consistent when run within EJBs (BMT or CMT).
For example, I have BeanA (BMT) that starts a transaction then retrieves a
PM->SQL connection then performs an update using direct SQL (non-JDO). Then
BeanA calls BeanB (CMT) that retrieves a PM and performs a JDO update. Once
BeanB completes, BeanA rolls back the entire transaction. The problem is
that the (non-JDO) SQL connection update isn't rolled back.
I only see this behavior the very first time I run the scenario. If I run
the scenario 2 -> N times it will be transactionally consistent.
Does anyone have any ideas what is going wrong the first time I run this
scenario?
I have multiple scenarios with BMT/CMT beans using JDO and non-JDO updates
where the first iteration of the update cause the non-JDO updates to not
roll back.
Thanks in advance.

Are you using optimistic transactions? If you're using optimistic
transactions with JDO, then an actual database transaction isn't started
until you call commit(). At that time Kodo starts a transaction, flushes
all the changes that have been made, and ends the transaction all at once.
That's why optimistic transactions are so nice -- they don't consume any DB
resources during the length of the transaction.
Of course, that also means that any connection you retrieve won't be
transactionally consistent, cause there's no transaction!

Similar Messages

  • Get and close connections many times in an EJB transaction drains pool

    I have run into an odd bug in OC4J, and I'm hoping someone out there has the solution for it.
    If I am inside an EJB transaction and call datasource.getConnection() and connection.close() more than (10 * max-connections) times, I can no longer get a connection from the datasource. Instead, I get this message:
    java.sql.SQLException: Timed out waiting for an available connection after 60 seconds (connection pool reached max-connections which was set to 100)
    at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].sql.OrionPooledDataSource.waitForConnection(OrionPooledDataSource.java:1012)
    Note the message says that max-connections is set to 100, when it is in fact set to 10. The figure is always 10 times the max-connections value.
    These connections are not being held, each is released before the next is fetched.
    The OC4J output looks like:
    [java] null: Releasing connection com.evermind.sql.DriverManagerXAConnection@d042d7 to pool (Pool size: 1)
    [java] null: Releasing connection com.evermind.sql.DriverManagerXAConnection@702936 to pool (Pool size: 2)
    [java] null: Releasing connection com.evermind.sql.DriverManagerXAConnection@1c0db6a to pool (Pool size: 3)
    [java] null: Releasing connection com.evermind.sql.DriverManagerXAConnection@616f6c to pool (Pool size: 98)
    [java] null: Releasing connection com.evermind.sql.DriverManagerXAConnection@19d83c7 to pool (Pool size: 99)
    [java] com.evermind.sql.DriverManagerConnectionPoolDataSource@1d4e49a: Releasing connection com.evermind.sql.DriverManagerPooledConnection@16ad2fd to pool (Pool size: 1)
    [java] null: Releasing connection com.evermind.sql.DriverManagerXAConnection@c1ec95 to pool (Pool size: 100)
    [java] com.evermind.sql.OrionPooledDataSource@46bb9f: Cache timeout, closing connection (Pool size: 0)
    [java] com.evermind.sql.OrionCMTDataSource@1c80063: Cache timeout, closing connection (Pool size: 99)
    [java] com.evermind.sql.OrionCMTDataSource@1c80063: Cache timeout, closing connection (Pool size: 98)
    [java] com.evermind.sql.OrionCMTDataSource@1c80063: Cache timeout, closing connection (Pool size: 2)
    [java] com.evermind.sql.OrionCMTDataSource@1c80063: Cache timeout, closing connection (Pool size: 1)
    [java] com.evermind.sql.OrionCMTDataSource@1c80063: Cache timeout, closing connection (Pool size: 0)
    Since often the number of times a connection is required in my application is data driven, I really need a general solution for this problem. Can anyone make a suggestion?

    We are facing the problem as given below.please advice.
    We have developed an application wherein we are calling DB functions using Type-4 connections. We have deployed it on Oracle AS OC4J 10.1.2.0.2. When the function executes we get the below error in the log file.
    When this error msg comes the application is unable to fetch the desired results.
    How do we solve this issue?
    com.evermind.sql.OrionCMTDataSource@478e3074: Cache timeout, closing connection (Pool size: 13)
    com.evermind.sql.OrionCMTDataSource@478e3074: Cache timeout, closing connection (Pool size: 12)
    com.evermind.sql.OrionCMTDataSource@478e3074: Cache timeout, closing connection (Pool size: 11)
    com.evermind.sql.OrionCMTDataSource@478e3074: Cache timeout, closing connection (Pool size: 10)
    com.evermind.sql.OrionCMTDataSource@478e3074: Cache timeout, closing connection (Pool size: 9)
    com.evermind.sql.OrionCMTDataSource@478e3074: Cache timeout, closing connection (Pool size: 8)
    com.evermind.sql.OrionCMTDataSource@478e3074: Cache timeout, closing connection (Pool size: 7)
    com.evermind.sql.OrionCMTDataSource@478e3074: Cache timeout, closing connection (Pool size: 6)
    com.evermind.sql.OrionCMTDataSource@478e3074: Cache timeout, closing connection (Pool size: 5)
    com.evermind.sql.OrionCMTDataSource@478e3074: Cache timeout, closing connection (Pool size: 4)
    com.evermind.sql.OrionCMTDataSource@478e3074: Cache timeout, closing connection (Pool size: 3)
    com.evermind.sql.OrionCMTDataSource@478e3074: Cache timeout, closing connection (Pool size: 2)
    com.evermind.sql.OrionCMTDataSource@478e3074: Cache timeout, closing connection (Pool size: 1)
    com.evermind.sql.OrionCMTDataSource@478e3074: Cache timeout, closing connection (Pool size: 0)
    com.evermind.sql.OrionCMTDataSource@1326b07a: Cache timeout, closing connection (Pool size: 2)
    com.evermind.sql.OrionCMTDataSource@1326b07a: Cache timeout, closing connection (Pool size: 1)
    com.evermind.sql.OrionCMTDataSource@1326b07a: Cache timeout, closing connection (Pool size: 0)
    null: Releasing connection oracle.jdbc.driver.T4CXAConnection@43bbf685 to pool (Pool size: 1)
    null: Releasing connection oracle.jdbc.driver.T4CXAConnection@43bbf685 to pool (Pool size: 2)
    null: Releasing connection oracle.jdbc.driver.T4CXAConnection@43bbf685 to pool (Pool size: 3)
    null: Releasing connection oracle.jdbc.driver.T4CXAConnection@43bbf685 to pool (Pool size: 4)
    null: Releasing connection oracle.jdbc.driver.T4CXAConnection@43bbf685 to pool (Pool size: 5)
    null: Releasing connection oracle.jdbc.driver.T4CXAConnection@43bbf685 to pool (Pool size: 6)
    null: Releasing connection oracle.jdbc.driver.T4CXAConnection@43bbf685 to pool (Pool size: 7)
    null: Releasing connection oracle.jdbc.driver.T4CXAConnection@43bbf685 to pool (Pool size: 8)
    null: Releasing connection oracle.jdbc.driver.T4CXAConnection@43bbf685 to pool (Pool size: 9)
    null: Releasing connection oracle.jdbc.driver.T4CXAConnection@43bbf685 to pool (Pool size: 10)
    null: Releasing connection oracle.jdbc.driver.T4CXAConnection@43bbf685 to pool (Pool size: 11)
    null: Releasing connection oracle.jdbc.driver.T4CXAConnection@43bbf685 to pool (Pool size: 12)
    null: Releasing connection oracle.jdbc.driver.T4CXAConnection@43bbf685 to pool (Pool size: 13)
    null: Releasing connection oracle.jdbc.driver.T4CXAConnection@43bbf685 to pool (Pool size: 14)

  • EJB transaction hanging over VPN connection

    EJB transaction hanging over VPN connection
    I am trying to diagnose a problem that only occurs when I am doing testing from home and connected via VPN to work.
    We are using WL 10.3. Our clusters are setup to communicate via multicast. We have a stateless session bean that uses many different resources (Sybase DB, other EJBs, Sonic JMS). I have a local EJB on my home network that I am testing and it connects with other EJBs and resources on my corporate network. While I don't think it is related to the problem, there is a cluster of the same EJB I am trying to test deployed to my corporate environment. i.e. I am testing ResetService EJB and there is a deployed domain cluster of several ResetService EJBs in the environment I am connecting to. My local server and admin domain are named differently than the one deployed and my local ejb shouldn't try to connect to the cluster in the environment.
    When I make a call into my local ejb everything seems to work as expected until it gets to the commit part of the transaction (after my ejb returns). At this point the executing thread hangs at the following location
    "[STUCK] ExecuteThread: '16' for queue: 'weblogic.kernel.Default (self-tuning)'" daemon prio=2 tid=0x2e8cb400 nid=0x22fc in Object.wait() [0x3031f000]
       java.lang.Thread.State: TIMED_WAITING (on object monitor)
            at java.lang.Object.wait(Native Method)
            - waiting on <0x091a4b18> (a weblogic.transaction.internal.ServerTransactionImpl)
            at weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(ServerTransactionImpl.java:2130)
            - locked <0x091a4b18> (a weblogic.transaction.internal.ServerTransactionImpl)
            at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:266)
            at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:233)
            at weblogic.ejb.container.internal.BaseRemoteObject.postInvoke1(BaseRemoteObject.java:621)
            at weblogic.ejb.container.internal.StatelessRemoteObject.postInvoke1(StatelessRemoteObject.java:60)
            at weblogic.ejb.container.internal.BaseRemoteObject.postInvokeTxRetry(BaseRemoteObject.java:441)
            at advantage.tradesupport.rates.resets.ejb.ResetTradeServiceBean_shnf9c_EOImpl.resetTradeByRate(ResetTradeServiceBean_shnf9c_EOImpl.java:1921)
            at advantage.tradesupport.rates.resets.ejb.ResetTradeServiceBean_shnf9c_EOImpl_WLSkel.invoke(Unknown Source)
            at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:589)
            at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
            at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:477)
            at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
            at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
            at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:473)
            at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
            at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
            at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)This thread is obviously waiting for a notification from some other thread but it is unclear what exactly it is waiting for. This only seems to happen when I am connected via VPN because when I try this same setup connected directly to my corporate network at work it works fine.
    I connected w/ debugger and tried to dig. Some interesting observations I see are.
    1) The ServerTransactionImpl object that is hanging has a 'preferredHost' of a different machine on my corporate network. It is an EJB that my service got some information from but it wasn't involved in any create, update, or delete aspects of the tran so in theory it shouldn't be part of it. Does anyone know what exactly this peferredHost attribute is signifying? I also see this same remote ejb server reference defined in a ServerCoordinatorDescriptor variable.
    2) I also sometimes see other XA resources (JMS) with this ServerTransactionImpl that point to references of resources that live on other machines on my corporate network (not my local ejb). This doesn't always seem to be the case though.
    VPN will definetly block multicast packets from the corporate env back to my machine. I don't think it works from my machine to the corporate env machines either.
    I also have two IPs when connected over VPN. One for my local home network and one given to me by my VPN client. I have setup my local WL server to listen on the VPN client provided IP which the corporate machines should be able to resolve and send TCP message over.
    This definetly seems to be transaction related because when I remove the tran support from my ejb things work as expected. The problem is I need to test within the transaction just like it runs in a deployed environment so this isn't really a fix.
    My theory: My local test WL EJB is waiting for a communication from some other server before it can commit the tran. This communication is blocked due to my VPN connection. I just don't know what exactly it is trying to communicate and how to resolve if that is in fact the problem. I thought about looking into unicast rather than multicast for cluster communication but in my mind that doesn't come into play here because I am not deploying a local cluster for my EJB and I thought multicast was just used for inter-cluster communication.
    I also saw some docs talking about resources need to be uniquely named when inter-domain communication is performed (http://docs.oracle.com/cd/E13222_01/wls/docs81/ConsoleHelp/jta.html#1120356).
    Anyone have any thoughts on what might be going on?
    Here is some log output from my local WL instance:
    Servers in this output--
    My test Server - AdminServer+10.125.105.14:7001+LJDomain+t3
    Server in env I read data from during ejb method call - TradeAccessTS_lkcma00061-1+171.149.24.240:17501+TradeSupportApplication2+t3
    Server in env I read data from during ejb method call - MesaService_lkcma00065-1+171.149.24.244:17501+MESAApplication1+t3
    Server in env I read data from during ejb method call - DataAccess_lkcma00055-0+171.149.24.234:17500+AdvantageApplication1+t3
    Server in env I read data from during ejb method call - DataAccess_lkcma00053-6+171.149.24.232:17506+AdvantageApplication1+t3
    ####<Mar 20, 2012 4:23:26 PM CDT> <Debug> <JTA2PC> <F68B599F56D71> <AdminServer> <[ACTIVE] ExecuteThread: '6' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <BEA1-0005C168CCCC337F43A8> <> <1332278606895> <BEA-000000> <BEA1-0005C168CCCC337F43A8: [EJB advantage.tradesupport.rates.resets.ejb.ResetTradeServiceBean.resetTradeByRate(java.lang.Long,java.util.Set,java.lang.String,java.lang.String,boolean,advantage.common.service.context.ServiceContext)]: ServerTransactionImpl.commit()>
    ####<Mar 20, 2012 4:23:26 PM CDT> <Debug> <JTA2PC> <F68B599F56D71> <AdminServer> <[ACTIVE] ExecuteThread: '6' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <BEA1-0005C168CCCC337F43A8> <> <1332278606895> <BEA-000000> <BEA1-0005C168CCCC337F43A8: [EJB advantage.tradesupport.rates.resets.ejb.ResetTradeServiceBean.resetTradeByRate(java.lang.Long,java.util.Set,java.lang.String,java.lang.String,boolean,advantage.common.service.context.ServiceContext)]: TX[BEA1-0005C168CCCC337F43A8] active-->pre_preparing>
    ####<Mar 20, 2012 4:23:26 PM CDT> <Debug> <JTA2PC> <F68B599F56D71> <AdminServer> <[ACTIVE] ExecuteThread: '6' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <BEA1-0005C168CCCC337F43A8> <> <1332278606896> <BEA-000000> <SC[LJDomain+AdminServer] active-->pre-preparing>
    ####<Mar 20, 2012 4:23:26 PM CDT> <Debug> <JTA2PC> <F68B599F56D71> <AdminServer> <[ACTIVE] ExecuteThread: '6' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <BEA1-0005C168CCCC337F43A8> <> <1332278606896> <BEA-000000> <BEA1-0005C168CCCC337F43A8: [EJB advantage.tradesupport.rates.resets.ejb.ResetTradeServiceBean.resetTradeByRate(java.lang.Long,java.util.Set,java.lang.String,java.lang.String,boolean,advantage.common.service.context.ServiceContext)]: before completion iteration #0>
    ####<Mar 20, 2012 4:23:26 PM CDT> <Debug> <JTA2PC> <F68B599F56D71> <AdminServer> <[ACTIVE] ExecuteThread: '6' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <BEA1-0005C168CCCC337F43A8> <> <1332278606896> <BEA-000000> <BEA1-0005C168CCCC337F43A8: [EJB advantage.tradesupport.rates.resets.ejb.ResetTradeServiceBean.resetTradeByRate(java.lang.Long,java.util.Set,java.lang.String,java.lang.String,boolean,advantage.common.service.context.ServiceContext)]: Synchronization[weblogic.ejb.container.internal.TxManager$TxListener@11b0cf9].beforeCompletion()>
    ####<Mar 20, 2012 4:23:26 PM CDT> <Debug> <JTA2PC> <F68B599F56D71> <AdminServer> <[ACTIVE] ExecuteThread: '6' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <BEA1-0005C168CCCC337F43A8> <> <1332278606897> <BEA-000000> <BEA1-0005C168CCCC337F43A8: [EJB advantage.tradesupport.rates.resets.ejb.ResetTradeServiceBean.resetTradeByRate(java.lang.Long,java.util.Set,java.lang.String,java.lang.String,boolean,advantage.common.service.context.ServiceContext)]: Synchronization[weblogic.ejb.container.internal.TxManager$TxListener@11b0cf9].beforeCompletion() END>
    ####<Mar 20, 2012 4:23:26 PM CDT> <Debug> <JTA2PC> <F68B599F56D71> <AdminServer> <[ACTIVE] ExecuteThread: '6' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <BEA1-0005C168CCCC337F43A8> <> <1332278606898> <BEA-000000> <SC[LJDomain+AdminServer] pre-preparing-->pre-prepared>
    ####<Mar 20, 2012 4:23:26 PM CDT> <Debug> <JTA2PC> <F68B599F56D71> <AdminServer> <[ACTIVE] ExecuteThread: '6' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <BEA1-0005C168CCCC337F43A8> <> <1332278606898> <BEA-000000> <SC[TradeSupportApplication2+TradeAccessTS_lkcma00061-1] active-->pre-preparing>
    ####<Mar 20, 2012 4:23:26 PM CDT> <Debug> <JTA2PC> <F68B599F56D71> <AdminServer> <[ACTIVE] ExecuteThread: '6' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <BEA1-0005C168CCCC337F43A8> <> <1332278606898> <BEA-000000> <BEA1-0005C168CCCC337F43A8: [EJB advantage.tradesupport.rates.resets.ejb.ResetTradeServiceBean.resetTradeByRate(java.lang.Long,java.util.Set,java.lang.String,java.lang.String,boolean,advantage.common.service.context.ServiceContext)]: delist weblogic.jdbc.wrapper.JTSXAResourceImpl, TMSUSPEND, beforeState=new, startThread=null>
    ####<Mar 20, 2012 4:23:26 PM CDT> <Debug> <JTA2PC> <F68B599F56D71> <AdminServer> <[ACTIVE] ExecuteThread: '6' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <BEA1-0005C168CCCC337F43A8> <> <1332278606898> <BEA-000000> <BEA1-0005C168CCCC337F43A8: [EJB advantage.tradesupport.rates.resets.ejb.ResetTradeServiceBean.resetTradeByRate(java.lang.Long,java.util.Set,java.lang.String,java.lang.String,boolean,advantage.common.service.context.ServiceContext)]: delist weblogic.jdbc.wrapper.JTSXAResourceImpl, afterStatenew>
    ####<Mar 20, 2012 4:23:26 PM CDT> <Debug> <JTA2PC> <F68B599F56D71> <AdminServer> <[ACTIVE] ExecuteThread: '6' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <BEA1-0005C168CCCC337F43A8> <> <1332278606899> <BEA-000000> <BEA1-0005C168CCCC337F43A8: [EJB advantage.tradesupport.rates.resets.ejb.ResetTradeServiceBean.resetTradeByRate(java.lang.Long,java.util.Set,java.lang.String,java.lang.String,boolean,advantage.common.service.context.ServiceContext)]: sc(TradeAccessTS_lkcma00061-1+171.149.24.240:17501+TradeSupportApplication2+t3+).startPrePrepareAndChain>
    ####<Mar 20, 2012 4:23:26 PM CDT> <Debug> <JTA2PC> <F68B599F56D71> <AdminServer> <[ACTIVE] ExecuteThread: '6' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <BEA1-0005C168CCCC337F43A8> <> <1332278606900> <BEA-000000> <SC[TradeSupportApplication2+TradeAccessTS_lkcma00061-1] pre-preparing-->pre-preparing>
    ####<Mar 20, 2012 4:23:26 PM CDT> <Debug> <JTA2PC> <F68B599F56D71> <AdminServer> <[ACTIVE] ExecuteThread: '6' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <BEA1-0005C168CCCC337F43A8> <> <1332278606902> <BEA-000000> <BEA1-0005C168CCCC337F43A8: [EJB advantage.tradesupport.rates.resets.ejb.ResetTradeServiceBean.resetTradeByRate(java.lang.Long,java.util.Set,java.lang.String,java.lang.String,boolean,advantage.common.service.context.ServiceContext)]: delist weblogic.jdbc.wrapper.JTSXAResourceImpl, TMSUSPEND, beforeState=new, startThread=null>
    ####<Mar 20, 2012 4:23:26 PM CDT> <Debug> <JTA2PC> <F68B599F56D71> <AdminServer> <[ACTIVE] ExecuteThread: '6' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <BEA1-0005C168CCCC337F43A8> <> <1332278606903> <BEA-000000> <BEA1-0005C168CCCC337F43A8: [EJB advantage.tradesupport.rates.resets.ejb.ResetTradeServiceBean.resetTradeByRate(java.lang.Long,java.util.Set,java.lang.String,java.lang.String,boolean,advantage.common.service.context.ServiceContext)]: delist weblogic.jdbc.wrapper.JTSXAResourceImpl, afterStatenew>
    ####<Mar 20, 2012 4:23:26 PM CDT> <Debug> <JTANaming> <F68B599F56D71> <AdminServer> <[ACTIVE] ExecuteThread: '6' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <BEA1-0005C168CCCC337F43A8> <> <1332278606903> <BEA-000000> <SecureAction.runAction Use Subject= <anonymous>for action:sc.startPrePrepareAndChain to t3://171.149.24.240:17501>
    ####<Mar 20, 2012 4:23:26 PM CDT> <Debug> <JTAPropagate> <F68B599F56D71> <AdminServer> <[ACTIVE] ExecuteThread: '6' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1332278606903> <BEA-000000> <PropagationContext: Peer=null, Version=4>
    ####<Mar 20, 2012 4:23:26 PM CDT> <Debug> <JTAPropagate> <F68B599F56D71> <AdminServer> <[ACTIVE] ExecuteThread: '6' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1332278606904> <BEA-000000> < +++ otherPeerInfo.getMajor() :: 10>
    ####<Mar 20, 2012 4:23:26 PM CDT> <Debug> <JTAPropagate> <F68B599F56D71> <AdminServer> <[ACTIVE] ExecuteThread: '6' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1332278606904> <BEA-000000> < +++ otherPeerInfo.getMinor() :: 3>
    ####<Mar 20, 2012 4:23:26 PM CDT> <Debug> <JTAPropagate> <F68B599F56D71> <AdminServer> <[ACTIVE] ExecuteThread: '6' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1332278606904> <BEA-000000> < +++ otherPeerInfo.getServicePack() :: 1>
    ####<Mar 20, 2012 4:23:26 PM CDT> <Debug> <JTAPropagate> <F68B599F56D71> <AdminServer> <[ACTIVE] ExecuteThread: '6' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1332278606905> <BEA-000000> < +++ otherPeerInfo.getRollingPatch() :: 0>
    ####<Mar 20, 2012 4:23:26 PM CDT> <Debug> <JTAPropagate> <F68B599F56D71> <AdminServer> <[ACTIVE] ExecuteThread: '6' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1332278606905> <BEA-000000> < +++ otherPeerInfo.hasTemporaryPatch() :: false>
    ####<Mar 20, 2012 4:23:26 PM CDT> <Debug> <JTA2PC> <F68B599F56D71> <AdminServer> <[ACTIVE] ExecuteThread: '6' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <BEA1-0005C168CCCC337F43A8> <> <1332278606905> <BEA-000000> <BEA1-0005C168CCCC337F43A8: [EJB advantage.tradesupport.rates.resets.ejb.ResetTradeServiceBean.resetTradeByRate(java.lang.Long,java.util.Set,java.lang.String,java.lang.String,boolean,advantage.common.service.context.ServiceContext)]: waitForPrePrepareAcks AdminServer+10.125.105.14:7001+LJDomain+t3+=>pre-prepared TradeAccessTS_lkcma00061-1+171.149.24.240:17501+TradeSupportApplication2+t3+=>pre-preparing MesaService_lkcma00065-1+171.149.24.244:17501+MESAApplication1+t3+=>active DataAccess_lkcma00055-0+171.149.24.234:17500+AdvantageApplication1+t3+=>active DataAccess_lkcma00053-6+171.149.24.232:17506+AdvantageApplication1+t3+=>active>
    $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
    Then eventually I get timeout errors like below in log
    ####<Mar 20, 2012 4:26:29 PM CDT> <Debug> <JTAPropagate> <F68B599F56D71> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1332278789379> <BEA-000000> < +++ otherPeerInfo.getMajor() :: 10>
    ####<Mar 20, 2012 4:26:29 PM CDT> <Debug> <JTAPropagate> <F68B599F56D71> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1332278789380> <BEA-000000> < +++ otherPeerInfo.getMinor() :: 3>
    ####<Mar 20, 2012 4:26:29 PM CDT> <Debug> <JTAPropagate> <F68B599F56D71> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1332278789380> <BEA-000000> < +++ otherPeerInfo.getServicePack() :: 1>
    ####<Mar 20, 2012 4:26:29 PM CDT> <Debug> <JTAPropagate> <F68B599F56D71> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1332278789381> <BEA-000000> < +++ otherPeerInfo.getRollingPatch() :: 0>
    ####<Mar 20, 2012 4:26:29 PM CDT> <Debug> <JTAPropagate> <F68B599F56D71> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1332278789382> <BEA-000000> < +++ otherPeerInfo.hasTemporaryPatch() :: false>
    ####<Mar 20, 2012 4:26:29 PM CDT> <Debug> <JTAPropagate> <F68B599F56D71> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1332278789382> <BEA-000000> < +++ Using new Method for reading rollback reason....>
    ####<Mar 20, 2012 4:26:29 PM CDT> <Debug> <JTANaming> <F68B599F56D71> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1332278789383> <BEA-000000> <RMI call coming from = TradeSupportApplication2>
    ####<Mar 20, 2012 4:26:29 PM CDT> <Debug> <JTANaming> <F68B599F56D71> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1332278789384> <BEA-000000> <SecureAction.stranger Subject used on received call: <anonymous> for action: startRollback AUTHENTICATION UNDETERMINABLE use SecurityInteropMode>
    ####<Mar 20, 2012 4:26:29 PM CDT> <Debug> <JTAPropagate> <F68B599F56D71> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1332278789385> <BEA-000000> <PropagationContext.getTransaction: tx=null>
    ####<Mar 20, 2012 4:26:29 PM CDT> <Debug> <JTAPropagate> <F68B599F56D71> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1332278789385> <BEA-000000> <PropagationContext.getTransaction: xid=BEA1-0005C168CCCC337F43A8, isCoordinator=true, infectCoordinatorFirstTime=false, txProps={weblogic.transaction.name=[EJB advantage.tradesupport.rates.resets.ejb.ResetTradeServiceBean.resetTradeByRate(java.lang.Long,java.util.Set,java.lang.String,java.lang.String,boolean,advantage.common.service.context.ServiceContext)], weblogic.jdbc=t3://171.149.24.240:17501}>
    ####<Mar 20, 2012 4:26:29 PM CDT> <Debug> <JTAPropagate> <F68B599F56D71> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1332278789391> <BEA-000000> < +++ looking up class : weblogic.transaction.internal.TimedOutException :: in classloader : java.net.URLClassLoader@15e92d7>
    ####<Mar 20, 2012 4:26:29 PM CDT> <Debug> <JTAPropagate> <F68B599F56D71> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1332278789397> <BEA-000000> < +++ looking up class : weblogic.transaction.TimedOutException :: in classloader : java.net.URLClassLoader@15e92d7>
    ####<Mar 20, 2012 4:26:29 PM CDT> <Debug> <JTAPropagate> <F68B599F56D71> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1332278789398> <BEA-000000> < +++ looking up class : java.lang.Exception :: in classloader : java.net.URLClassLoader@15e92d7>
    ####<Mar 20, 2012 4:26:29 PM CDT> <Debug> <JTAPropagate> <F68B599F56D71> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1332278789398> <BEA-000000> < +++ looking up class : java.lang.Throwable :: in classloader : java.net.URLClassLoader@15e92d7>
    ####<Mar 20, 2012 4:26:29 PM CDT> <Debug> <JTAPropagate> <F68B599F56D71> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1332278789402> <BEA-000000> < +++ looking up class : [Ljava.lang.StackTraceElement; ::  in classloader : java.net.URLClassLoader@15e92d7>
    ####<Mar 20, 2012 4:26:29 PM CDT> <Debug> <JTAPropagate> <F68B599F56D71> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1332278789403> <BEA-000000> < +++ looking up class : java.lang.StackTraceElement :: in classloader : java.net.URLClassLoader@15e92d7>
    ####<Mar 20, 2012 4:26:29 PM CDT> <Debug> <JTAPropagate> <F68B599F56D71> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1332278789404> <BEA-000000> < +++ converted bytes to rollback reason : weblogic.transaction.internal.TimedOutException: Timed out tx=BEA1-0005C168CCCC337F43A8 after 30000 seconds>
    ####<Mar 20, 2012 4:26:29 PM CDT> <Debug> <JTA2PC> <F68B599F56D71> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1332278789404> <BEA-000000> <Name=[EJB advantage.tradesupport.rates.resets.ejb.ResetTradeServiceBean.resetTradeByRate(java.lang.Long,java.util.Set,java.lang.String,java.lang.String,boolean,advantage.common.service.context.ServiceContext)],Xid=BEA1-0005C168CCCC337F43A8(21880283),Status=Marked rollback. [Reason=weblogic.transaction.internal.TimedOutException: Timed out tx=BEA1-0005C168CCCC337F43A8 after 30000 seconds],numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=502,seconds left=29497,activeThread=Thread[[ACTIVE] ExecuteThread: '6' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads],XAServerResourceInfo[weblogic.jdbc.wrapper.JTSXAResourceImpl]=(ServerResourceInfo[weblogic.jdbc.wrapper.JTSXAResourceImpl]=(state=new,assigned=none),xar=null,re-Registered = false),SCInfo[LJDomain+AdminServer]=(state=pre-prepared),SCInfo[TradeSupportApplication2+TradeAccessTS_lkcma00061-1]=(state=pre-preparing),SCInfo[MESAApplication1+MesaService_lkcma00065-1]=(state=active),SCInfo[AdvantageApplication1+DataAccess_lkcma00055-0]=(state=active),SCInfo[AdvantageApplication1+DataAccess_lkcma00053-6]=(state=active),properties=({weblogic.transaction.name=[EJB advantage.tradesupport.rates.resets.ejb.ResetTradeServiceBean.resetTradeByRate(java.lang.Long,java.util.Set,java.lang.String,java.lang.String,boolean,advantage.common.service.context.ServiceContext)], weblogic.jdbc=t3://171.149.24.240:17501}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=AdminServer+10.125.105.14:7001+LJDomain+t3+, XAResources={LJDomain.AdminServer.JMSXASessionPool.advantage.jms.queue.sonicConnectionFactory, LJDomain.AdminServer.JMSXASessionPool.advantage.jms.topic.sonicConnectionFactory, WLStore_LJDomain__WLS_AdminServer, WSATGatewayRM_AdminServer_LJDomain},NonXAResources={})],CoordinatorURL=AdminServer+10.125.105.14:7001+LJDomain+t3+) wakeUpAfterSeconds(60)>
    ####<Mar 20, 2012 4:26:29 PM CDT> <Debug> <JTA2PC> <F68B599F56D71> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1332278789406> <BEA-000000> <BEA1-0005C168CCCC337F43A8: [EJB advantage.tradesupport.rates.resets.ejb.ResetTradeServiceBean.resetTradeByRate(java.lang.Long,java.util.Set,java.lang.String,java.lang.String,boolean,advantage.common.service.context.ServiceContext)]: setProperty: weblogic.transaction.name=[EJB advantage.tradesupport.rates.resets.ejb.ResetTradeServiceBean.resetTradeByRate(java.lang.Long,java.util.Set,java.lang.String,java.lang.String,boolean,advantage.common.service.context.ServiceContext)]>

    Hello asirigaya,
    MSDTC configure does not belong to this forum, this forum topic is "Discuss client application development using Windows Forms controls and features."
    I didn't see MSDN has this kind of forum so I will help you move this case to "Where is the forum for"
    Regards,
    Barry Wang
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • JDBC, JMS and EJB transactions - possible problem?

    Hello,
              I am using Oracle 9, Weblogic 8.1 SP 4, MyEclipse and
              XDoclet.
              In my current project I have the following piece of code
              in one of my message driven beans (code cited as pseudocode
              without unnecessary details):
              * @ejb.bean name="MyMessageProcessor"
              * display-name="Display name for a MyMessageProcessor"
              * jndi-name="ejb/MyMessageProcessor"
              * description="Bean MyMessageProcessor"
              * destination-type="javax.jms.Queue"
              * transaction-type="Container"
              * acknowledge-mode="Auto-acknowledge"
              * subscription-durability="Durable"
              * generate="false"
              * @ejb.transaction type="Required"
              public class MyMessageProcessor implements MessageDrivenBean, MessageListener {
              public void onMessage(Message msg) {
                   try {
                        //obtaining connections to two different databases via JNDi
                        java.sql.Connection connOne =
                        ((DataSource)ctx.lookup("DataSourceOne")).getConnection();          
                        java.sql.Connection connTwo =
                             ((DataSource)ctx.lookup("DataSourceTwo")).getConnection();
                        // performing some UPDATEs and INSERTs on connOne and connTwo
                        // calling some other methods of this bean
                        //creating the reply JMS message and sending it to another JMS queue
                        Message msgTwo = this.createReplyMessage(msg)
                        this.queueSender.send(msgTwo);
                        //commiting everything
                        this.queueSession.commit();          
                   } catch (Exception ex) {
                   try {
                        if (this.queueSession!=null) this.queueSession.rollback();
                   } catch (JMSException JMSEx) {};     
                   this.context.setRollbackOnly();
              Some days ago (before the final remarks from my client) there used to be only one DataSource configurated on the basis of the
              connection pool with non-XA jdbc driver. Everything worked fine
              including the transactions (if anything wrong happend not only wasn't the replymessage sent, but also no changes were written
              to database and the incomming message was thrown back to the my bean's
              queue).
              When I deployed the second DataSource I was informed by an error message, that only one non-transactional resource may
              participate in a global transaction. When I changed both datasources
              to depend on underlying datasources with transatcional (XA) jdbc drivers, everything stopped working. Even if
              EJB transaction was theoretically successfully rolledbacked, the changed were written to the database
              and the JMS message wasn't resent to the JMS queue.
              So here are my questions:
                   1. How to configure connection pools to work in such situations? What JDBC drivers should I choose?
                   Are there any global server configurations, which may influence this situation?
                   2. Which jdbc drivers should I choose so that the container was able to rollback the database transactions
                   (of course, if necessary)?
                   3. Are there any JMS Queue settings, which would disable the container to send message back to the
                   queue in case of setRollbackOnly()? How should be the Queue configurated?
              As I am new to the topic and the deadline for the project seems to be too close I would be grateful
              for any help.
              This message was sent to EJB list and JDBC list.
              Sincerely yours,
              Marcin Zakidalski

    Hi,
              I found these information extremely useful and helpful.
              The seperate transaction for sending messages was, of course, unintentional. Thanks a lot.
              Anyway, I still have some problems. I have made some changes to the
              code cited in my previous mail. These changes included changing QueueSessions
              to non-transactional. I also set the "Honorate global transactions" to true.
              I am using XA JDBC driver. After setting "Enable local transactions" to false
              (I did it, because I assume that JDBC transactions should be part on the global
              EJB transaction) I got the following error:
              java.sql.SQLException: SQL operations are not allowed with no global transaction by default for XA drivers. If the XA
              driver supports performing SQL operations with no global transaction, explicitly allow it by setting
              "SupportsLocalTransaction" JDBC connection pool property to true. In this case, also remember to complete the local
              transaction before using the connection again for global transaction, else a XAER_OUTSIDE XAException may result. To
              complete a local transaction, you can either set auto commit to true or call Connection.commit() or Connection.rollback().
              I have also inspected the calls of methods of bean inside of onMessage() method just to check, whether
              the transactions are correctly initialized (using the weblogic.transaction.Transaction class).
              My questions are as follows:
              1. Any suggestions how to solve it? I have gone through the google answers on that problem and only
              thing I managed to realize that JDBC must start its own transaction. Is there any way to prohibit it
              from doing that? Can using setAutocommit(true/false) change the situation for better?
              2. How to encourage the JDBC driver to be a part of EJB transaction?
              3. As I have noticed each of ejb method has its own transactions (transactions have different
              Xid). Each method of the bean has "required" transaction attribute. Shouldn't it work in such
              way that if already started transaction exists it is used by the called method?
              4. The DataSources are obtained in my application via JNDI and in the destination environment I will have slight
              impact on the configuration of WebLogic. What is least problematic and most common WebLogic configuration which would
              enable JDBC driver to participate in the EJB transaction? Is it the WebLogic configuration problem or can it be
              solved programmically?
              Currently my module works quite fine when "enable local transactions" for DataSources is set to true, but this way
              I am loosing the ability to perform all actions in one transaction.
              Any suggestions / hints are more than welcomed. This message was posted to jdbc list and ejb list.
              Marcin

  • What is the recommended way to get a java.sql.Connection to the DB  for ADF

    How do I create a standalone database connection based on the datasource setup in ADF?
    I have seen code like this in a method of AppModuleImpl.java but that seems a bit of a hack.
    Connection conn = this.getDBTransaction().createStatement(0).getConnection();
    What I need is a java.sql.Connection to the database used in the application module so I can call PL/SQL code and or work with AQ queues.
    I would prefer a separate connection from the one used by the ADF model so it can have its own transaction control etc.
    But I would like to get the connection created authenticated based on regular datasource setup.

    http://www.oracle.com/webfolder/technetwork/jdeveloper/howto/11114/managedserver/wlsadfms.html#8c
    https://blogs.oracle.com/jdevotnharvest/entry/accessing_weblogic_jdbc_datasource_from

  • Oracle or MS SQL Server, EJB Models and Web Dynpro Application

    Hi
    I've a table in MS SQL database. I've created in Visual Admin, the datasource(jdbc/MyAlias) for the above. SQL Server has Employee Table with EmpId, FirstName, LastName and Description as its Columns.
    I want to display, modify , insert and delete entries from the Employee Table using web Dynpro. For this we have used JDBC method by which we create class file which will have JDBC connectivity and logic for getting data from backend. This class file then used for display, update and other operations. And the context is built at design time.
    This is not proper method, as this doesn't come under perview of MVC concept.
    I want to use EJB Models for this case. But I'm stuck with some problems.
    1. How do I implement EJB models in this scenario.
    2. How do EJB module (entity bean) connects to external database.
    3. What are the most logical steps to be used in this case.
    Any pointers for this will greatly appreciated with points?
    So far I was able to do create EJB module of Entity Bean type with all interfaces. But beyond this I'm not able to proceed. Do let me know the step wise procedure for this kind of scenario.
    Thanks
    Srikant

    Hi Srikant,
    I have worked on similar stuff, but the scenario was a little different. I worked on creating Web Services using EJBs, but the basic part was that, the web service was supposed to interact with the SQL Server database. So maybe I can help you...
    First thing which is needed is that you have created the JDBC Connector in your Visual Administrator correctly. If you wish to cross check, you can see my answer in the following thread:
    JDBC error
    In this thread itself I have given the code which is the solution to your problem (this is what i believe). I am pasting the code again:
    <b>InitialContext initialContext = new InitialContext();
    DataSource dataSource = (DataSource)initialContext.lookup("jdbc/MyAlias");
    java.sql.Connection connection = dataSource.getConnection();</b>
    You can use this code in the method of your EJB, and then you can easily use this connection object to access your database tables using SQL queries.
    And if by any chance you are looking for a step wise procedure for creating a web service from an EJB, then give me your email address, i will send you the doc.
    Bye
    Ankur
    Do reward points if it helps!!

  • SPROXY - No connection to the Integration Builder

    Hi,
    While generating a ABAP Proxy the communication between R/3 system and XI 3.0 repository did not work; transaction SPROXY displayed the following error message, 'No connection to the Integration Builder, only local data is visible'.
    Can someone please help me out.
    Regards,
    Jigisha

    Hi,
    I had the same problem and I have solved it.
    You have just to apply the following sap notes :
    1232805 - Saint: Queue calculation for an add-on with CRT´s fail.
    769120 - Support Package for APPINT 200_620
    The first one is to update tha SPAM/SAINT to v 30 and the second one allow you use the pi/xi objects on application system.
    There is another sap note 689847, but you just apply this if the sap notes above described did not work.
    Paulo Correa

  • ZTIGATHER SQL connectivity issues.

    I am setting up application/package mapping in SCCM. When running ztigather and my rule set Im not able to connect to my SQL DB. Im getting error:
    ZTI error opening SQL Connection: [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied. (-2147467259.
    I have set the sccm network access account as a sysadmin. has anyone done this recently if so can you tell me how the system running the TS contacts SQL and how you have that account set up?
    tconners
    Here is the connection string: Connecting to SQL Server using connect string: Provider=SQLOLEDB;OLE DB Services=0;Data Source=My-Server;Initial Catalog=MDT;Network Library=DBNMPNTW;Integrated Security=SSPI

    Good call that was my connectivity issue!
    Now Im seeing
    ERROR - Opening Record Set (Error Number = -2147217900) (Error Description: Could not find stored procedure 'RetrieveApplications'.).
    tconners
    Im checking it out now

  • "domain was null"; rmicontext=false; JTA UserTransaction;EJB Transaction

    Hi folks!
    I´m doing a test with EJB´s and JTA transactions.
    The goal of the test is to verify if the OC4J will recognize a JTA User Transaction opened by a client just before an EJB method invocation and use it inside the EJB method, instead of opening a new transaction.
    So, I have an EJB with conteiner managed transaction feature "Required".
    And I have a client of this EJB, that opens a JTA UserTransaction and performs some updates and calls the EJB.
    After the EJB call, I throwed a RuntimeException. The proposal of throwing this exception is to force the rollback of all the transaction ( the updates made by the client and the updates made by the ejb must not be commited ).
    My method seems like this ( actually it´s a little bit more structured, but for understading purporses, i put it all in one method only here ):
    <pre>
    public void testTransaction () {
    boolean commit = false;
    javax.transaction.UserTransaction ut = null;
    try {
    // getting the JTA Transaction
    javax.naming.Context initCtx = new javax.naming.InitialContext();
    ut = (javax.transaction.UserTransaction) initCtx.lookup("java:comp/UserTransaction");
    ut.begin();
    try{
    //issue the update
    Connection conn = null;
    try {
    Context ic = new InitialContext();
         DataSource ds = (DataSource) ic.lookup("jdbc/JTADS");
         conn = ds.getConnection();
         PreparedStatement stmt = conn.prepareStatement("UPDATE dont_drop_this_table set field2 =? where field1 = ?");
         stmt.setString(1, "First Record");
         stmt.setInt(2, 1);
         stmt.executeUpdate();
    } finally {
    if (conn != null) conn.close();
    //issue another update via EJB
    Hashtable env = new Hashtable();
    String initialContextFactory = "com.evermind.server.rmi.RMIInitialContextFactory";
    String securityPrincipal = "jazn.com/admin";//admin
    String securityCredentials = "welcome";//admin
    String providerUrl = "ormi://localhost:23791/jta";
    env.put(Context.INITIAL_CONTEXT_FACTORY, initialContextFactory);
    env.put(Context.SECURITY_PRINCIPAL, securityPrincipal);
    env.put(Context.SECURITY_CREDENTIALS, securityCredentials);
    env.put("dedicated.rmicontext", "false");
    env.put("dedicated.connection", "false");
    env.put(Context.PROVIDER_URL, providerUrl);
    Context ctx = new InitialContext(env);
    Object home = ctx.lookup(jndiName);
    Object o = PortableRemoteObject.narrow(home, Class.forName("mytest.MyEJBHome"))
    Class clazz = o.getClass();
    Method method = clazz.getMethod("create", null);
    MyEJBBean bean = (MyEJBBean) method.invoke(o, null);
    //invoking ejb
    bean.updateTable(2, "Second Record")
    //force an ArrayOutOfBoundsException, in order to test
    //if the EJB container will rollback or commit the ejb transaction.
    int x[] = { 0 };
    x[1] = 1;
    x[2] = 1;
    } catch (Exception e) {
    throw new RuntimeException(e);
    //if there was no exception thrown until here... then commit
    commit = true;
    catch ( Exception e ) {
    throw new RuntimeException (e);
    finally {
    try {
    if ( commit ) ut.commit();
    else ut.rollback();
    } catch ( Exception e ) {
    throw new RuntimeException (e);
    </pre>
    Now my question:
    When I use dedicated.rmicontext = true or dedicated.connection = true, the EJB container commits the transaction, even after the exception thrown. I understand that EJB container open a new transaction, instead of use the existing one ( jta UserTransaction.
    When I use dedicated.rmicontext = false and dedicated.connection = false, the EJB container rollbacks the transaction, as I expected.
    I´ve seen many posts about "domain was null" message after a NullPointerException.
    I did many tests, but no NullPointerException was thrown, even when calling the EJB remotely nor issuing concurrent calls.
    - I need the container rollback the transaction.
    - I found that it only rollbacks when I put dedicated.rmicontext = false and dedicated.connection = false.
    - I found that when dedicated.rmicontext = false and dedicated.connection = false, a NullPointerException may ocurr.
    This "domain was null" problem seems to be an OC4J bug and the rmicontext=true an workaround for this bug, but I can´t use rmicontext=true because it will make the EJB transaction not to be the same JTA UserTransaction opened before the EJB call.
    Is there any other way to make an EJB transaction be the same JTA UserTransaction openned before the EJB call?
    PS: I´m using JDeveloper 10.1.2
    Thanks for any help...

    Can anybody help me?
    I need to know how can I set my EJB to use the same connection opened by a POJO class via JTA. ( Actually I need the EJB and POJO class be in same JTA transaction )
    If I set the dedicated.rmicontext to false, it works but I run to risk of getting a NullPointerException "domain was null".
    I realy need your help!
    Thanks!

  • EJB Transaction

    Hi,
    I am inserting the data into six tables under single transaction scope. Basically, if any errors occur it should role back the complete transaction.
    My question is Can I use entity beans (CMP) and DAO based Stored Procedure calls from a session bean, both in a single transaction?
    Right now even though there are problems with some of the procedure calls, the transaction scope is not working and didn�t role back.
    I have tried many methods, including using java.sql.Connection based trasactions, CMT based trasactions (i.e. allowing the container to handle the trasactions) and finally using BMT in the session bean and CMT for the entity beans. All the same i am still faced with this problem.
    Here is my code for the last of these options.
    try{
    ut = ejbContext.getUserTransaction();
    ut.begin();
    // Insert data into Course Table
    insertCourse(courseRequestDTO);
    // Insert data into CourseSession table
    insertCourseSession(courseRequestDTO);
    // Insert data into Course Request table
    insertExternalInfo(courseRequestDTO);
    // Insert data into Manager Table
    insertManager(courseRequestDTO);
    // Insert data into Employee table by Using CMP
    insertEmployee(employeeDTO, courseRequestDTO);
    //Insert data into CourseRequest Table
    insertCourseRequest(courseRequestDTO);
    ut.commit();
    catch(SQLException se){
    ut.rollback();
    System.out.println("<<<< Transaction failed >>>>>");
    Can anyone help me on this ?
    Thanks and Regards
    Kamran

    may be u try this in Main calling program.
    * @param sessionContext SessionContext
    public void setSessionContext(SessionContext sessionContext) {
    this.sessionContext = sessionContext;
    super.setSessionContext(sessionContext);
    try {
    findAllHomes();
    catch (Exception e) {
    throw new EJBException(e.getMessage());
    private void _XX
    try {
    catch (ApplicationException ae) {
    if (!this.sessionContext.getRollbackOnly()) {
    this.sessionContext.setRollbackOnly();
    throwErrorHelper(ae);
    catch (Exception e) {
    throwErrorHelper(e);
    }

  • EJB Transaction timeout and Statement Query Timeout

    I am looking for some details on how statement query timeout is set when statement execution is part of the session bean transaction. I have done some test in webshere 6.1. and JBoss 5.0 and not getting the desired behavior. My understanding is following
    - DB is Oracle 11g
    - EJB transaction is set to 5 mins.
    - Query time out setting is set to default vaule (not sure what is the default value)
    - Session bean is updating say customer record using PreparedStatement
    - Prior to calling session bean method I am locking the customer record using external/db tool and holding the lock.
    - Call session bean method. Method waits endlessly for the lock to be acquired. No transaction rollback after 5 mins.
    - After 10 minutes commit the transaction in the external db tool
    - Session bean methods throws transaction rollback.
    My understanding was that query timeout is set based on transaction "time to live". Please share out thoughts.
    Edited by: hdjava on Jun 18, 2010 1:06 PM
    Edited by: hdjava on Jun 18, 2010 1:07 PM

    The following configuration seems working:
    version: OC4J (9.0.3.0.0) (build 020927.1699)
    AM deployment:
    - bc4j.xcfg: <jbo.ejb.txntimeout>30000</jbo.ejb.txntimeout>
    - orion-ejb-jar.xml: <session-deployment name="..." timeout="0"/>
    OC4J config:
    - data-source: inactivity-timeout="30000"
    This keeps connection open for more than default 30 mins of inactivity (30000 secs configured).
    Although, oc4j console prints multiple warnings:
    DriverManagerConnectionPoolConnection not closed, check your code!
    Looks like this is not an intended usage - but working.
    Notice that it was a test, not a production environment.
    Also pls see 9033: AM as EJB Session bean: pooled connection lost for new txn
    I would be thankful for any experience in running AM Session EJB w/o timeout.

  • SQL Connections remain open after Crystal Report closes

    I am wirting an interface to use the crystal report viewer to print reports, connecting to a Progress Open Edge 10.1B database.  From our application we declare the application, report, exportoptions and connectionproperties objects and pass these to the crystal reports viewer.  Once the report is printed we release the objects and set their variables for null.  However we are finding that the SQL connection to the database is remaining connected and we can only release the connection by manually going in a disconnecting.
    I have read in forums that people use .dispose or .close to release the connection, however we do not have access to these methods as we do not use .NET.  Are there any methods we can use to disconnect these sql connections?

    Hi Dean,
    Moved to the Legacy Application forums. Likely using the RDC as your report engine.
    You should still be able to close and dispose of the report objects. They are not specific to .NET.
    In VB it would look something like these lines::
        crReport.Close
        Set CrystalActiveXReportViewer1.ReportSource = Nothing
        Set crReport = Nothing
    Once the report is closed it should disconnect from the DB. If you close the application does that disconnect?
    Have you looked on 4GL's site for info on how to?
    Thank you
    Don

  • Reference for Connecting EJB in KM scheduler Task

    Hi,
           What are the main References we need to add portalapp.xml,when we connect Ejb in Km scheduler Tasks
    For Example:
    portalapp.xml
    <?xml version="1.0" encoding="UTF-8"?>
      <application >
        <application-config>
        <property name="SharingReference" value="usermanagement, knowledgemanagement,landscape,       htmlb, exportalJCOclient, exportal, com.sap.portal.admin.wizardframework"/>  </application-config>
      <components/>
      <services>
        <service name="RFServiceWrapper">
          <service-config>
            <property name="className" value="com.sap.netweaver.rf.wrapper.RFServiceWrapper"/>
            <property name="startup" value="true"/>
          </service-config>
        </service>
      </services>
    </application>
    Regards,
    Vino

    Hi,
    Try some thing like this:
    ClassLoader originalContextClassLoader = Thread.currentThread().getContextClassLoader();                                   
    try {
              Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
              Context initial = new InitialContext();
              Object objref = initial.lookup("JNDI Name Of the Session Bean");
              Object obj = PortableRemoteObject.narrow(objref, BeanHome.class);
         } catch (NamingException ex) {
              ex.printStackTrace();          
         } catch (Exception ex) {
              ex.printStackTrace();          
         finally {
         Thread.currentThread().setContextClassLoader(originalContextClassLoader);
    Regards,
    Praveen Gudapati

  • Unable to load the necessary SQL connectivity library

    I am installing an older (non-Microsoft) program (32bit) that manages mail online and it requires an access to SQL Server to create database to complete installation. I am installing it on Windows Server 2003 standard. This program
    I am installing recommends SQL Server 2000. We are now running SQL Server 2005 on a separate server. For connectivity, I installed SQL server 2005 tools (full install) on the same 2003 server as the program so that this program could manage to locate
    SQL server 2005 and connect to it in order to create necessary tables and complete the installation. I already manually created the database for this program on SQL Server 2005. I created ODBC SQL Server connection string (User DSN). However, during
    installation, I am getting the following error message:
    ERROR: Setup is unable to load the necessary SQL connectivity library. This indicates that the proper client-side SQL utilities are not installed on your system. Setup cannot continue.
    Could this error be SQL Server version specific and the program only likes SQL 2000 client tools and not 2005? Are there major differences between libraries versions? Should there be something else configured? What am I missing? Thanks in advance.

    ERROR: Setup is unable to load the necessary SQL connectivity library. This indicates that the proper client-side SQL utilities are not installed on your system. Setup cannot continue.
    Could this error be SQL Server version specific and the program only likes SQL 2000
    client tools and not 2005?
    Tools are tools, not a connectivity library and by the error message the right connectivity library is missing. Ask the software vendor which one is required or look it up on the other machine, where the application works.
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • How to specify a variable in the path prefix of an External HTTP (RFC) connection (in transaction SM59)

    Hi There,
    Please can someone tell me how to specify a variable in the  path prefix of an External HTTP (RFC) connection in transaction SM59?
    For example if my path prefix is /invoke/test/example?input=XYZ; how do I replace "XYZ" with a variable so that I can pass in any value after "=" ?
    Thanks,
    Brendon

    Hi,
    This is SAP Business one system administration forum. Please find correct forum and repost above discussion to get quick assistance.
    Please close this thread here with helpful answer.
    Thanks & Regards,
    Nagarajan

Maybe you are looking for