Distributed transaction just involving JMS
Hi,
I have a MDB using a REMOTE DESTINATION to get the messages. The remote
destination is a Topic using a Connection factory set up as following:
User Transactions Enabled = true
XAConnection Factory Enabled = true
The MDB is set to type-transaction=Container and has a durable
suscription for the Topic.
Although, I know I´m using distributed transaction (XAConnection Factory
Enabled = true) I am not sure if it is correct or not.
I read that a distributed transaction is when you have 2 resources
participating in the transaction, but, as you can see I have just JMS
involved.
Should I use distributed transaction or not ?
Any comments will be appreciated!
Thanks,
Edith Rivera
ok Thanks for your help !
Edith
Peter Holditch wrote:
> Edith,
>
> You should use JTA in the normal way, as you describe.
>
> If at commit time there is only 1 participant in the transaction (as
> seems to ber the case in your instance) then the transaction manager
> will optimise out the prepare phase of the processing, and you end up
> with a single phase commit automatically.
>
> Regards,
> Peter.
>
> Edith Rivera wrote:
>
>> Hi,
>>
>> I have a MDB using a REMOTE DESTINATION to get the messages. The
>> remote destination is a Topic using a Connection factory set up as
>> following:
>> User Transactions Enabled = true
>> XAConnection Factory Enabled = true
>>
>> The MDB is set to type-transaction=Container and has a durable
>> suscription for the Topic.
>>
>> Although, I know I´m using distributed transaction (XAConnection
>> Factory Enabled = true) I am not sure if it is correct or not.
>> I read that a distributed transaction is when you have 2 resources
>> participating in the transaction, but, as you can see I have just JMS
>> involved.
>>
>> Should I use distributed transaction or not ?
>>
>> Any comments will be appreciated!
>> Thanks,
>> Edith Rivera
>>
>>
>
Similar Messages
-
How to design Distributed transaction?
Hi
I have distributed transaction that involve MQ and two oracle database. In both database I have stroed procedure that have their own rollback points. My requirement is that either both database shoulb committed or none.
For this to implement I have a MDB that calls SP on first database and without commiting any thing it comes back to MDB and again Calls SP on second database and again come back to MDB and call1 SP on database1..
But problem is when I am calling 2nd database SP and if any thing goes wrong inside SP then its implicit rollback is not working. To overcome this I put this 2nd database logic in another EJB with RequiresNew. But then problem is that if MDB transaction is rolled back then 2nd database transaction is not getting roollbacked.
Please suggest any solution to overcome this.
Server is Websphere 6.0
Database is: Oracle 10g
Datasource: XA
Q: MQ 6.0
ThanksI think you can use Java Trasaction API that is independent of the Resources and will give you more flexibility to handle trasactions
This link may be helpful
http://www.onjava.com/pub/a/onjava/2001/05/23/j2ee.html -
Lock held by in-doubt distributed transaction
I'm having an intermittent problem in our server where a distributed transaction
between WebLogic JMS (6.1 sp3) and Oracle (using the 9.1.2 XA driver) doesn't
complete and subsequent attempts to access the rows in question result in:
java.sql.SQLException: ORA-01591: lock held by in-doubt distributed transaction
4.33.52658
Has anybody else seen anything like this?
Rao,
The BEA patch is CR095835_610SP4. Apparently there is a corresponding patch for
SP3 as well. When configuring the jdbc connection pool set XaSetTransactionTimeout
= true and
XaTransactionTimeout = yourTimeoutValueInSeconds. This will instruct the Transaction
manager to set the timeout value on Oracle's XAResource during the two-phase commit
process. I believe Oracle refers to the timeout value as SesTm.
Cheers,
Tony
"Rao Boppana" <[email protected]> wrote:
>
>We are currently facing the same problem. Could you let us know more
>details about
>the patch BEA put out to fix this? Is there a patch #/bug #? We are currently
>running SP4, Oracle 9.2.3 using 9.2.0.1 drivers. We really cannot set
>our JTA
>timeout to less than 1 minute and hence we are left with option2. Any
>help would
>be greatly appreciated.
>
>
>"Tony Necakov" <[email protected]> wrote:
>>
>>Jane,
>>Thanks for the reply. After talking to Oracle support, we believe we've
>>discovered
>>the cause of the problem. Apparently, setting the JTA transaction timeout
>>does
>>not affect the default timeout from Oracle's point of view. Consequently,
>> XA
>>transactions exceeding 1 minute (Oracle's default) were being marked
>>by Oracle
>>as in-doubt. Subsequent commits or rollback from the transaction manager
>>were
>>being ignored. The solution is to either knock the JTA timeout value
>>to something
>>below Oracle's default or install a BEA patch which allows the transaction
>>manager
>>to set the timeout on the Oracle resource manager.
>>
>>"Jane Sampson" <[email protected]> wrote:
>>>Hi Tony,
>>>
>>>Yes, I believe there were some problems with 8.1.7. I believe it requires
>>>an Oracle patch AND a JDriver patch (if you are using the WebLogic
>JDriver).
>>>Open a case with support for details.
>>>
>>>Thanks,
>>>
>>>Jane
>>>BEA Support
>>>
>>>
>>>"Tony Necakov" <[email protected]> wrote in message
>>>news:[email protected]...
>>>>
>>>> We're seeing the same intermittent problem with Oracle 8.1.7.2 and
>>>8.1.7.4. The
>>>> problem occurs with WLS 6.1 service pack 3 and service pack 4.
>>>>
>>>> "Jane Sampson" <[email protected]> wrote:
>>>> >Hi Tim,
>>>> >
>>>> >There is an issue has been reported for Oracle 9.2.0.1 Database/Oracle
>>>> >9.2.0.1 Thin Driver and exhibits this behavior and is being address
>>>by
>>>> >both
>>>> >BEA and Oracle. I would suggest you open a case with Customer Support
>>>> >and
>>>> >mention CR090816. It could be the same problem.
>>>> >
>>>> >Thanks,
>>>> >
>>>> >Jane
>>>> >BEA Support
>>>> >
>>>> >"Tim Dawson" <[email protected]> wrote in message
>>>> >news:[email protected]...
>>>> >>
>>>> >> I'm having an intermittent problem in our server where a distributed
>>>> >transaction
>>>> >> between WebLogic JMS (6.1 sp3) and Oracle (using the 9.1.2 XA
>driver)
>>>> >doesn't
>>>> >> complete and subsequent attempts to access the rows in question
>>>result
>>>> >in:
>>>> >>
>>>> >> java.sql.SQLException: ORA-01591: lock held by in-doubt distributed
>>>> >transaction
>>>> >> 4.33.52658
>>>> >>
>>>> >> Has anybody else seen anything like this?
>>>> >
>>>> >
>>>>
>>>
>>>
>>
>
-
I need to perform a distributed transaction in My Servlet.
My distributed transaction involves Updating to the DB and also publishing a message to a queue.
The queue is not present in my app server, where my Servlet is running.
It is there on a remote machine.
I'm using below code to achieve the same.
But I'm not getting the transactional behaviour working... That means
If I publish a message to queue and then if DB Operation fails, the transaction should roll back and the queue should not be having any contents.
But my queue is still showing me the contents...
Any glitches in my code???
public class RemoteServlet extends javax.servlet.http.HttpServlet implements
javax.servlet.Servlet {
private QueueConnectionFactory queueConnectionFactory;
private Queue queue;
private QueueConnection queueConnection = null;
private QueueSession queueSession = null;
private QueueSender queueSender = null;
private TextMessage message = null;
@Resource
UserTransaction utx;
protected void doBatch(HttpServletRequest request,
HttpServletResponse response) throws Exception {
try {
initQueue();
utx.begin();
publishMessage(false);
updateDB();//Some DB Operation which will fail to test the rollback
utx.commit();
} catch (Exception e) {
utx.rollback();
e.printStackTrace();
} finally {
closeJMS();
printQueue();
private void closeJMS() {
try {
queueSession.close();
queueConnection.close();
} catch (JMSException jmse) {
jmse.printStackTrace();
private void publishMessage() throws Exception {
for ( int i = 1; i < 5; i++) {
message = queueSession.createTextMessage();
message.setText("Current Time is (" + (new Date().getTime() + i) + "):: " + new Date());
System.out.println("<br>" + "Sending message :: " + message.getText());
queueSender.send(message);
public void initQueue() throws Exception {
Context ctx = getInitialContext();
Object obj = null;
try {
queueConnectionFactory = (QueueConnectionFactory) ctx.lookup("jmsfactory/default/MyQueueConnectionFactoryXA");
queue = (Queue) ctx.lookup("jmsqueues/default/MyQueue");
queueConnection = queueConnectionFactory.createQueueConnection();
queueSession = queueConnection.createQueueSession(true, Session.AUTO_ACKNOWLEDGE);
queueSender = queueSession.createSender(queue);
queueConnection.start();
} catch (Exception e) {
e.printStackTrace();
public void printQueue(String desc) {
try {
QueueBrowser browser = queueSession.createBrowser(queue);
Enumeration<TextMessage> en = browser.getEnumeration();
while (en.hasMoreElements()) {
TextMessage queueBrMessage = en.nextElement();
System.out .println( "<br>" + queueBrMessage.getText());
} catch (JMSException e) {
e.printStackTrace();
public Context getInitialContext() throws Exception {
Properties properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY, "com.sap.engine.services.jndi.InitialContextFactoryImpl");
properties.put(Context.PROVIDER_URL, "10.134.162.75:50004"); // IP Address of the Host where the Queue is setup
properties.put(Context.SECURITY_PRINCIPAL, "Administrator");
properties.put(Context.SECURITY_CREDENTIALS, "password");
properties.put("force_remote", "true");
InitialContext context = new InitialContext(properties);
return context;
public RemoteServlet() {
super();
protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
try {
doBatch(request, response);
} catch (Exception e) {
e.printStackTrace();A "resource adapter" is a JavaEE component used by modern application servers for linking to an external resource such as a JMS provider or database. It will wrap the XAQueueConnection for you and take care of enlisting the resources, performing two-phase commit, etc. - basically hiding all the complexities of XA transactions from you.
Nigel -
Distributed transactions with container-managed MDBs
I have built a framework that employs a high rate of code reuse while abstracting
the complexities of inter-application communication. This allows application
developers to focus on solving their business needs and not worry about "the plumbing"
between the applications.
At this point, the framework is using container-managed MDBs for Topic destinations.
MDBs were chosen because of their concurrent nature for processing JMS messages.
Now that I have this framework up and running, I am trying to add distributed
transaction support and am having trouble understanding what I need to do. Here
is how the framework works:
The MDB will recieve a message, unmarshall it into a business object, and then
route that object to the appropriate business class where it is then processed
accordingly. In most cases, the processing of this message object will require
database interaction. If any error should occur while processing the message,
all XAResources within the transaction should rollback and ultimately, the JMS
message will be redelivered later.
Here is what I'm trying to find out:
1. When control is passed to an application and it gets a DB connection, will
that DB resource be dynamically enlisted with the transaction?
2. Must the DB connection come from the WLS DB pool to be enlisted with the transaction?
I ask this because the current standard at this company is to use a home-grown
DB connection pool for getting DB connections. This is due to the fact that not
all applications here run in a WLS environment and they wanted a standard way
of retrieving a DB connection across applications. They also sited problems with
WLS 4.5.1 connection pool.
3. The documentation states that only one database may be involved in a transaction.
If a connection to another database is required, but not needed in the current
transaction, will WLS ignore enlisting the 2nd DB resource, or throw an exception?
4. Where can I find <B>detailed</B> information about this subject? Everything
that I have read so far has barely scratched the surface for this specific topic.
Thanks,
Bob.
Hi Bob,
If you are using WLS's XA connection pool, then the XAResource associated with
the XA connections are enlisted with the transaction transparently for you. Enlistments
actually occur not at getConnection, but on demand when the JDBC objects are actually
used.
If you are not using WLS connection pools, then you would need to enlist the XAResource
associated with the XA connections yourself. You can obtain the transaction associated
with the current thread by calling weblogic.transaction.TxHelper.getTransaction(),
and then call enlistResource on the transaction.
Weblogic has provisions that allow one (and only one) non-XA connection pool to
participate in a distributed transaction. In this case, you will get a SQLException
when you try to obtain a connection from a second connection pool in the same
distributed transaction. However, if you are using real XA connection pools,
there is no limitation and any number of XA connection pools can participate in
the same distributed transaction.
We will try to incorporate more info in our online docs in the future.
-- Priscilla Fung, BEA Systems, Inc.
"Bob Peroutka" <[email protected]> wrote:
>
>I have built a framework that employs a high rate of code reuse while
>abstracting
>the complexities of inter-application communication. This allows application
>developers to focus on solving their business needs and not worry about
>"the plumbing"
>between the applications.
>
>At this point, the framework is using container-managed MDBs for Topic
>destinations.
> MDBs were chosen because of their concurrent nature for processing JMS
>messages.
>
>Now that I have this framework up and running, I am trying to add distributed
>transaction support and am having trouble understanding what I need to
>do. Here
>is how the framework works:
>
>The MDB will recieve a message, unmarshall it into a business object,
>and then
>route that object to the appropriate business class where it is then
>processed
>accordingly. In most cases, the processing of this message object will
>require
>database interaction. If any error should occur while processing the
>message,
>all XAResources within the transaction should rollback and ultimately,
>the JMS
>message will be redelivered later.
>
>Here is what I'm trying to find out:
>
>1. When control is passed to an application and it gets a DB connection,
>will
>that DB resource be dynamically enlisted with the transaction?
>
>2. Must the DB connection come from the WLS DB pool to be enlisted with
>the transaction?
>
>I ask this because the current standard at this company is to use a home-grown
>DB connection pool for getting DB connections. This is due to the fact
>that not
>all applications here run in a WLS environment and they wanted a standard
>way
>of retrieving a DB connection across applications. They also sited problems
>with
>WLS 4.5.1 connection pool.
>
>3. The documentation states that only one database may be involved in
>a transaction.
> If a connection to another database is required, but not needed in the
>current
>transaction, will WLS ignore enlisting the 2nd DB resource, or throw
>an exception?
>
>4. Where can I find <B>detailed</B> information about this subject?
> Everything
>that I have read so far has barely scratched the surface for this specific
>topic.
>
>Thanks,
>
>Bob.
-
ORA-01591: lock held by in-doubt distributed transaction 14.4.44
Hi,
I am using WLI 8.1 SP2 on Windows 2000, Oracle 9.2. I am getting this error...
<Apr 23, 2004 10:43:43 AM EDT> <Error> <WLW> <000000> <error
java.io.IOException: [BEA][Oracle JDBC Driver][Oracle]ORA-01591: lock held by
in
-doubt distributed transaction 14.4.44
at weblogic.jdbc.base.BaseBlobOutputStream.write(Unknown Source)
at weblogic.jdbc.base.BaseBlobOutputStream.write(Unknown Source)
at com.bea.wlw.runtime.core.bean.BMPContainerBean$OracleTableAccess.doSt
oreByInsert(BMPContainerBean.java:904)
at com.bea.wlw.runtime.core.bean.BMPContainerBean.doInsert(BMPContainerB
ean.java:1785)
at com.bea.wlw.runtime.core.bean.BMPContainerBean.ejbStore(BMPContainerB
ean.java:1742)
at com.bea.wli.bpm.runtime.ProcessContainerBean.ejbStore(ProcessContaine
rBean.java:79)
at com.bea.wlwgen.PersistentContainer_nga2bb_Impl.ejbStore(PersistentCon
tainer_nga2bb_Impl.java:149)
at weblogic.ejb20.manager.ExclusiveEntityManager.beforeCompletion(Exclus
iveEntityManager.java:556)
at weblogic.ejb20.internal.TxManager$TxListener.beforeCompletion(TxManag
er.java:745)
at weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(Serv
erSCInfo.java:1010)
at weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(Se
rverSCInfo.java:115)
at weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAn
dChain(ServerTransactionImpl.java:1142)
at weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(
ServerTransactionImpl.java:1868)
at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(Se
rverTransactionImpl.java:250)
at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTran
sactionImpl.java:221)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:412)
at weblogic.ejb20.internal.MDListener.transactionalOnMessage(MDListener.
java:316)
at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:281)
at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2596)
at weblogic.jms.client.JMSSession.execute(JMSSession.java:2516)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
I have tried dropping all wli tables & deleting tlog files (deleting everything
from cgServer directory). Still get this error.
Any suggestions??
TIA
-AmitGetting this problem with WLI. I have just truncated tables and it's fine now.
Thanks,
Amit
"Sheetal Jain" <[email protected]> wrote:
>
Amit,
If these problem is happening with the WLI database then I would suggest
you should
talk to BEA support. If it is happening in the application you have built
just
look for any deadlock conditions happening in some scenarios inside different
inter-related transactions running at the same time, I mean transaction
1 is locking
something and in the meantime another one B locks something else which
is required
for the transaction A to move farward and now second one needs the resource
locked
by 1st.
Hope this helps
"Nagraj Rao" <[email protected]> wrote:
Hello Amit !,
Lock From In-Doubt Transaction is a 2-p TX issue, A query or DML statement
that
requires locks on a database is probably blocked due to some lock held
by a resource
of an "in-doubt distributed transaction".
A DB Admin can manually Commit or Rollback an "in-doubt distributedtransaction".
So I suggest you talk to the DBA
More at : http://www-rohan.sdsu.edu/doc/oracle/server803/A54653_01/ds_ch3.htm
BTW here's what Oracle says :
ORA-01591 lock held by in-doubt distributed transaction string
Cause: An attempt was made to access resource that is locked by a dead
two-phase
commit transaction that is in prepared state.
Action: The database administrator should query the PENDING_TRANS$ and
related
tables, and attempt to repair network connection(s) to coordinator and
commit
point. If timely repair is not possible, the database administratorshould
contact
the database administrator at the commit point if known or the end user
for correct
outcome, or use heuristic default if given to issue a heuristic COMMIT
or ABORT
command to finalize the local portion of the distributed transaction.
"Sheetal Jain" <[email protected]> wrote:
Amit,
It could be a bug. Open a ticket with BEA and see if they have a patch.
"Amit Bhutra" <[email protected]> wrote:
Hi,
I am using WLI 8.1 SP2 on Windows 2000, Oracle 9.2. I am getting
this
error...
<Apr 23, 2004 10:43:43 AM EDT> <Error> <WLW> <000000> <error
java.io.IOException: [BEA][Oracle JDBC Driver][Oracle]ORA-01591: lock
held by
in
-doubt distributed transaction 14.4.44
at weblogic.jdbc.base.BaseBlobOutputStream.write(Unknown Source)
at weblogic.jdbc.base.BaseBlobOutputStream.write(Unknown Source)
at com.bea.wlw.runtime.core.bean.BMPContainerBean$OracleTableAccess.doSt
oreByInsert(BMPContainerBean.java:904)
at com.bea.wlw.runtime.core.bean.BMPContainerBean.doInsert(BMPContainerB
ean.java:1785)
at com.bea.wlw.runtime.core.bean.BMPContainerBean.ejbStore(BMPContainerB
ean.java:1742)
at com.bea.wli.bpm.runtime.ProcessContainerBean.ejbStore(ProcessContaine
rBean.java:79)
at com.bea.wlwgen.PersistentContainer_nga2bb_Impl.ejbStore(PersistentCon
tainer_nga2bb_Impl.java:149)
at weblogic.ejb20.manager.ExclusiveEntityManager.beforeCompletion(Exclus
iveEntityManager.java:556)
at weblogic.ejb20.internal.TxManager$TxListener.beforeCompletion(TxManag
er.java:745)
at weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(Serv
erSCInfo.java:1010)
at weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(Se
rverSCInfo.java:115)
at weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAn
dChain(ServerTransactionImpl.java:1142)
at weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(
ServerTransactionImpl.java:1868)
at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(Se
rverTransactionImpl.java:250)
at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTran
sactionImpl.java:221)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:412)
at weblogic.ejb20.internal.MDListener.transactionalOnMessage(MDListener.
java:316)
at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:281)
at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2596)
at weblogic.jms.client.JMSSession.execute(JMSSession.java:2516)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
I have tried dropping all wli tables & deleting tlog files (deleting
everything
from cgServer directory). Still get this error.
Any suggestions??
TIA
-Amit -
Newbie question: distributed transaction
Hi,
I am totally new to JMS, and have a question about distributed transaction. Can the sender and receiver both involve in the same distributed transaction? I don't think it's possible, but want to confirm here.
The reason I ask is that I wonder if I can make use of JMS to allow Ruby on Rails app to participate in a distributed transaction.
Any help or tips will be appreciated.
Thanks,
YkngJMS is built around a messaging paradigm. The large majority of JMS providers will be using a broker to decouple the actions of message sending and of message receiving.
As such, the only transactional contract that is possible is between the broker and the client (the message consumer or producer).
When the client resides in a container (like a java app server), the client container can take the role of the transaction manager and extend the transactional aspect of the application to other participants, like a database for example.
But in most JMS providers, that are using the broker as a "man in the middle" architectural decoupler, transactional behavior between the sender and the receiver is not possible.
If a transactional behavior is necessary for this, then JMS is most probably the wrong solution for you.
TE -
How to disable distributed transaction in Weblogic 8.1?
Hi I'm using WL8.1 running EJB. I wish to disable distributed transaction, whatever
that is. It is preventing me from doing and AutoCommit(true) in my database. Please
help. Thanks!
You cannot disable transactions if you are using entity EJBs but you can
get your connections from a non-TX DataSource (just define a regular
DataSource and not TXDataSource in your configuration) and then those
connections will not be transaction aware so you'll be able to do
setAutoCommit(true) in fact it might already be the default setting when
you get the connection.
Regards,
Dejan
Fred wrote:
>Hi I'm using WL8.1 running EJB. I wish to disable distributed transaction, whatever
>that is. It is preventing me from doing and AutoCommit(true) in my database. Please
>help. Thanks!
>
>
-
I've developed an MDB that reads a message from a queue, performs database updates
against up to 2 databases, and sends an outgoing JMS message when all is complete.
The MDB uses container-managed transactions to ensure that all DB updates and
JMS messages are committed or rolled back together. I have had a lot of problems
related to transactions failing, becoming "in-doubt" in the database and locking
database resources indefinitely.
My environment is configured as follows:
WebLogic 8.1.2 Server
Oracle 9.2.0.4 database with RAC
XA Connection Pool with WebLogic Type 2 Oracle Driver OR Oracle 9.2.0.4
OCI Driver
I have read the BEA/HP white paper regarding Weblogic 8.1 with Oracle 9i RAC (http://dev2dev.bea.com/products/wlserver81/whitepapers/wls_bea_hp.jsp)
and have tried all of the solutions suggested in that paper. The only solution
that worked consistently without causing the in-doubt transactions was to change
my connection pools to point directly to a single node of the RAC cluster, not
to the shared instance. However, even with this configuration, I have seen these
errors occur when certain database failures occur.
A side-effect of this problem is that the associated WebLogic connection pools
begin to "forget" connections. The pool thinks that all of the connections are
in use (even though I am always calling Statement.close() and Connection.close()),
and the connection pool cannot be reset manually. The only way to clear the connection
pool is to bounce WebLogic.
The only posts I have found related to this error were regarding Oracle 8.1.7
and WebLogic 6.1. Any help would be greatly appreciated.
Exceptions:
<Mar 23, 2004 2:59:36 PM EST> <Error> <EJB> <BEA-010026> <Exception occurred during
commit of transaction Xid=BEA1-0526A28664707F28EDB9(6412513),Status=Rolled back.
[Reason=javax.transaction.xa.XAException
: prepare failed for XAResource 'ProfilingPool' with error XAER_NOTA : The XID
is not valid],numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=2,seconds
left=60,XAServerResourceInfo[JMS_my
JmsStore]=(ServerResourceInfo[JMS_myJmsStore]=(state=rolledback,assigned=myserver),xar=JMS_myJmsStore),XAServerResourceInfo[ProfilingPool]=(ServerResourceInfo[ProfilingPool]=(state=rolledback,ass
igned=myserver),xar=ProfilingPool),SCInfo[mydomain+myserver]=(state=rolledback),local
properties=({}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=myserver+10.41.0.61:7001+m
ydomain+t3+, XAResources={JMS_myJmsStore, JMS_FileStore, ProfilingPool, SearchManagementPool,
AnnouncementsTxPool},NonXAResources={})],CoordinatorURL=myserver+10.41.0.61:7001+mydomain+t3+):
javax.tran
saction.xa.XAException: prepare failed for XAResource 'ProfilingPool' with error
XAER_NOTA : The XID is not valid
at weblogic.jdbc.oci.xa.XA.createException(XA.java:386)
at weblogic.jdbc.oci.xa.XADataSource.internalPrepare(XADataSource.java:905)
at weblogic.jdbc.oci.xa.XADataSource.prepare(XADataSource.java:885)
at weblogic.jdbc.jta.DataSource.prepare(DataSource.java:846)
at weblogic.transaction.internal.XAServerResourceInfo.prepare(XAServerResourceInfo.java:1167)
at weblogic.transaction.internal.XAServerResourceInfo.prepare(XAServerResourceInfo.java:401)
at weblogic.transaction.internal.ServerSCInfo$1.execute(ServerSCInfo.java:253)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
--------------- nested within: ------------------
weblogic.transaction.RollbackException: Could not prepare resource 'ProfilingPool
prepare failed for XAResource 'ProfilingPool' with error XAER_NOTA : The XID is
not valid - with nested exception:
[javax.transaction.xa.XAException: prepare failed for XAResource 'ProfilingPool'
with error XAER_NOTA : The XID is not valid]
at weblogic.transaction.internal.TransactionImpl.throwRollbackException(TransactionImpl.java:1644)
at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:300)
at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:221)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:412)
at weblogic.ejb20.internal.MDListener.transactionalOnMessage(MDListener.java:316)
at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:281)
at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2596)
at weblogic.jms.client.JMSSession.execute(JMSSession.java:2516)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
2004-03-23 15:00:45,406 ERROR IS003989 [ExecuteThread: '17' for queue: 'ProfileCompleteListenerBean.ExecuteQueue']
my.package.search.business.ProfiledHoldingDAO.setProfilingStatus(ProfiledHoldingDAO.java:350
) - Failed to update profiling status for holding 10014 [] (-2)
java.sql.SQLException: ORA-02049: timeout: distributed transaction waiting for
lock
at weblogic.db.oci.OciCursor.getCDAException(OciCursor.java:282)
at weblogic.jdbc.oci.PreparedStatement.executeUpdate(PreparedStatement.java:226)
at weblogic.jdbc.oci.xa.PreparedStatement.executeUpdate(PreparedStatement.java:81)
at weblogic.jdbc.wrapper.PreparedStatement.executeUpdate(PreparedStatement.java:94)
at my.package.search.business.ProfiledHoldingDAO.setProfilingStatus(ProfiledHoldingDAO.java:345)
at my.package.search.business.ProfilingManager.disseminateAndAcknowledge(ProfilingManager.java:254)
at my.package.search.business.ProfileCompleteListenerBean.onMessage(ProfileCompleteListenerBean.java:128)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:382)
at weblogic.ejb20.internal.MDListener.transactionalOnMessage(MDListener.java:316)
at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:281)
at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2596)
at weblogic.jms.client.JMSSession.execute(JMSSession.java:2516)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
2004-03-23 15:01:43,093 ERROR IS003989 [ExecuteThread: '18' for queue: 'HoldingStatusListenerBean.ExecuteQueue']
my.package.search.business.ProfiledHoldingDAO.getProfilingStatus(ProfiledHoldingDAO.java:265)
- Failed to retrieve profiling results for holding 10060 [] (-2)
java.sql.SQLException: ORA-01591: lock held by in-doubt distributed transaction
189.47.12
at weblogic.db.oci.OciCursor.getCDAException(OciCursor.java:282)
at weblogic.jdbc.oci.PreparedStatement.executeQuery(PreparedStatement.java:152)
at weblogic.jdbc.oci.xa.PreparedStatement.executeQuery(PreparedStatement.java:48)
at weblogic.jdbc.wrapper.PreparedStatement.executeQuery(PreparedStatement.java:80)
at my.package.search.business.ProfiledHoldingDAO.getProfilingStatus(ProfiledHoldingDAO.java:256)
at my.package.search.business.ProfiledHoldingDAO.storeHoldingMetadata(ProfiledHoldingDAO.java:489)
at my.package.search.business.ProfiledHoldingDAO.storeNewHolding(ProfiledHoldingDAO.java:406)
at my.package.search.business.ProfilingManager.profileHolding(ProfilingManager.java:128)
at my.package.search.business.HoldingStatusListenerBean.onMessage(HoldingStatusListenerBean.java:121)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:382)
at weblogic.ejb20.internal.MDListener.transactionalOnMessage(MDListener.java:316)
at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:281)
at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2596)
at weblogic.jms.client.JMSSession.execute(JMSSession.java:2516)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
Hi. There is a serious bug in the Oracle DBMS (all versions) where in-doubt
transactions have their data locked in the DBMS by page rather than by row,
so it will indefinitely prevent access to all data on the page, including
logically uninvolved data. Oracle understands the problem but currently
says they will never fix it (it would take too much work). They offer the
alternative that you configure your table data to ensure that no more than
one datarow resides on a page.
Joe
Matt Smith wrote:
> I've developed an MDB that reads a message from a queue, performs database updates
> against up to 2 databases, and sends an outgoing JMS message when all is complete.
> The MDB uses container-managed transactions to ensure that all DB updates and
> JMS messages are committed or rolled back together. I have had a lot of problems
> related to transactions failing, becoming "in-doubt" in the database and locking
> database resources indefinitely.
>
> My environment is configured as follows:
> WebLogic 8.1.2 Server
> Oracle 9.2.0.4 database with RAC
> XA Connection Pool with WebLogic Type 2 Oracle Driver OR Oracle 9.2.0.4
> OCI Driver
>
> I have read the BEA/HP white paper regarding Weblogic 8.1 with Oracle 9i RAC (http://dev2dev.bea.com/products/wlserver81/whitepapers/wls_bea_hp.jsp)
> and have tried all of the solutions suggested in that paper. The only solution
> that worked consistently without causing the in-doubt transactions was to change
> my connection pools to point directly to a single node of the RAC cluster, not
> to the shared instance. However, even with this configuration, I have seen these
> errors occur when certain database failures occur.
>
> A side-effect of this problem is that the associated WebLogic connection pools
> begin to "forget" connections. The pool thinks that all of the connections are
> in use (even though I am always calling Statement.close() and Connection.close()),
> and the connection pool cannot be reset manually. The only way to clear the connection
> pool is to bounce WebLogic.
>
> The only posts I have found related to this error were regarding Oracle 8.1.7
> and WebLogic 6.1. Any help would be greatly appreciated.
>
> Exceptions:
> -----------------
> <Mar 23, 2004 2:59:36 PM EST> <Error> <EJB> <BEA-010026> <Exception occurred during
> commit of transaction Xid=BEA1-0526A28664707F28EDB9(6412513),Status=Rolled back.
> [Reason=javax.transaction.xa.XAException
> : prepare failed for XAResource 'ProfilingPool' with error XAER_NOTA : The XID
> is not valid],numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=2,seconds
> left=60,XAServerResourceInfo[JMS_my
> JmsStore]=(ServerResourceInfo[JMS_myJmsStore]=(state=rolledback,assigned=myserver),xar=JMS_myJmsStore),XAServerResourceInfo[ProfilingPool]=(ServerResourceInfo[ProfilingPool]=(state=rolledback,ass
> igned=myserver),xar=ProfilingPool),SCInfo[mydomain+myserver]=(state=rolledback),local
> properties=({}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=myserver+10.41.0.61:7001+m
> ydomain+t3+, XAResources={JMS_myJmsStore, JMS_FileStore, ProfilingPool, SearchManagementPool,
> AnnouncementsTxPool},NonXAResources={})],CoordinatorURL=myserver+10.41.0.61:7001+mydomain+t3+):
> javax.tran
> saction.xa.XAException: prepare failed for XAResource 'ProfilingPool' with error
> XAER_NOTA : The XID is not valid
> at weblogic.jdbc.oci.xa.XA.createException(XA.java:386)
> at weblogic.jdbc.oci.xa.XADataSource.internalPrepare(XADataSource.java:905)
> at weblogic.jdbc.oci.xa.XADataSource.prepare(XADataSource.java:885)
> at weblogic.jdbc.jta.DataSource.prepare(DataSource.java:846)
> at weblogic.transaction.internal.XAServerResourceInfo.prepare(XAServerResourceInfo.java:1167)
> at weblogic.transaction.internal.XAServerResourceInfo.prepare(XAServerResourceInfo.java:401)
> at weblogic.transaction.internal.ServerSCInfo$1.execute(ServerSCInfo.java:253)
> at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
> --------------- nested within: ------------------
> weblogic.transaction.RollbackException: Could not prepare resource 'ProfilingPool
> prepare failed for XAResource 'ProfilingPool' with error XAER_NOTA : The XID is
> not valid - with nested exception:
> [javax.transaction.xa.XAException: prepare failed for XAResource 'ProfilingPool'
> with error XAER_NOTA : The XID is not valid]
> at weblogic.transaction.internal.TransactionImpl.throwRollbackException(TransactionImpl.java:1644)
> at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:300)
> at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:221)
> at weblogic.ejb20.internal.MDListener.execute(MDListener.java:412)
> at weblogic.ejb20.internal.MDListener.transactionalOnMessage(MDListener.java:316)
> at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:281)
> at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2596)
> at weblogic.jms.client.JMSSession.execute(JMSSession.java:2516)
> at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
> ...
> 2004-03-23 15:00:45,406 ERROR IS003989 [ExecuteThread: '17' for queue: 'ProfileCompleteListenerBean.ExecuteQueue']
> my.package.search.business.ProfiledHoldingDAO.setProfilingStatus(ProfiledHoldingDAO.java:350
> ) - Failed to update profiling status for holding 10014 [] (-2)
> java.sql.SQLException: ORA-02049: timeout: distributed transaction waiting for
> lock
> at weblogic.db.oci.OciCursor.getCDAException(OciCursor.java:282)
> at weblogic.jdbc.oci.PreparedStatement.executeUpdate(PreparedStatement.java:226)
> at weblogic.jdbc.oci.xa.PreparedStatement.executeUpdate(PreparedStatement.java:81)
> at weblogic.jdbc.wrapper.PreparedStatement.executeUpdate(PreparedStatement.java:94)
> at my.package.search.business.ProfiledHoldingDAO.setProfilingStatus(ProfiledHoldingDAO.java:345)
> at my.package.search.business.ProfilingManager.disseminateAndAcknowledge(ProfilingManager.java:254)
> at my.package.search.business.ProfileCompleteListenerBean.onMessage(ProfileCompleteListenerBean.java:128)
> at weblogic.ejb20.internal.MDListener.execute(MDListener.java:382)
> at weblogic.ejb20.internal.MDListener.transactionalOnMessage(MDListener.java:316)
> at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:281)
> at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2596)
> at weblogic.jms.client.JMSSession.execute(JMSSession.java:2516)
> at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
> ...
> 2004-03-23 15:01:43,093 ERROR IS003989 [ExecuteThread: '18' for queue: 'HoldingStatusListenerBean.ExecuteQueue']
> my.package.search.business.ProfiledHoldingDAO.getProfilingStatus(ProfiledHoldingDAO.java:265)
> - Failed to retrieve profiling results for holding 10060 [] (-2)
> java.sql.SQLException: ORA-01591: lock held by in-doubt distributed transaction
> 189.47.12
> at weblogic.db.oci.OciCursor.getCDAException(OciCursor.java:282)
> at weblogic.jdbc.oci.PreparedStatement.executeQuery(PreparedStatement.java:152)
> at weblogic.jdbc.oci.xa.PreparedStatement.executeQuery(PreparedStatement.java:48)
> at weblogic.jdbc.wrapper.PreparedStatement.executeQuery(PreparedStatement.java:80)
> at my.package.search.business.ProfiledHoldingDAO.getProfilingStatus(ProfiledHoldingDAO.java:256)
> at my.package.search.business.ProfiledHoldingDAO.storeHoldingMetadata(ProfiledHoldingDAO.java:489)
> at my.package.search.business.ProfiledHoldingDAO.storeNewHolding(ProfiledHoldingDAO.java:406)
> at my.package.search.business.ProfilingManager.profileHolding(ProfilingManager.java:128)
> at my.package.search.business.HoldingStatusListenerBean.onMessage(HoldingStatusListenerBean.java:121)
> at weblogic.ejb20.internal.MDListener.execute(MDListener.java:382)
> at weblogic.ejb20.internal.MDListener.transactionalOnMessage(MDListener.java:316)
> at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:281)
> at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2596)
> at weblogic.jms.client.JMSSession.execute(JMSSession.java:2516)
> at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
>
>
-
Errors in DB alert log for distributed transactions
Hi,
I am receiving the following type of errors regularly in one of our development databases:
Errors in file e:\oracle\product\diag\rdbms\agdev10g\agdev10g\trace\agdev10g_reco_16356.trc:
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
ORA-02062: distributed recovery received DBID d672931d, expected 2d7b9dec
ORA-12154: TNS:could not resolve the connect identifier specified
ORA-12500: TNS:listener failed to start a dedicated server process
ORA-12154: TNS:could not resolve the connect identifier specified
From researching on the net it looks like it may have something to do with distributed transactions and database links however I'm not sure how to proceed to diagnose the problem and find out where the issue is. Can anyone help?
Thanks
Adam
Edited by: Adam J. Sawyer on 27/05/2010 16:57SQL*Net typically involves two systems so post following details for both systems
Post Operating System (OS) name & version for DB server system.
Post results of
SELECT * from v$version
or post Oracle version to 4 decimal places
oerr ora 12514
12514, 00000, "TNS:listener does not currently know of service requested in connect descriptor"
// *Cause: The listener received a request to establish a connection to a
// database or other service. The connect descriptor received by the listener
// specified a service name for a service (usually a database service)
// that either has not yet dynamically registered with the listener or has
// not been statically configured for the listener. This may be a temporary
// condition such as after the listener has started, but before the database
// instance has registered with the listener.
// *Action:
// - Wait a moment and try to connect a second time.
// - Check which services are currently known by the listener by executing:
// lsnrctl services <listener name>
// - Check that the SERVICE_NAME parameter in the connect descriptor of the
// net service name used specifies a service known by the listener.
// - If an easy connect naming connect identifier was used, check that
// the service name specified is a service known by the listener.
// - Check for an event in the listener.log file.
bcm@bcm-laptop:~$ oerr ora 2062
02062, 00000, "distributed recovery received DBID %s, expected %s"
// *Cause: a database link at a coordinator no longer points to the expected
// database. Link may have been redefined, or a different DB mounted.
// *Action: restore link definition or remote database.
bcm@bcm-laptop:~$ oerr ora 12154
12154, 00000, "TNS:could not resolve the connect identifier specified"
// *Cause: A connection to a database or other service was requested using
// a connect identifier, and the connect identifier specified could not
// be resolved into a connect descriptor using one of the naming methods
// configured. For example, if the type of connect identifier used was a
// net service name then the net service name could not be found in a
// naming method repository, or the repository could not be
// located or reached.
// *Action:
// - If you are using local naming (TNSNAMES.ORA file):
// - Make sure that "TNSNAMES" is listed as one of the values of the
// NAMES.DIRECTORY_PATH parameter in the Oracle Net profile
// (SQLNET.ORA)
// - Verify that a TNSNAMES.ORA file exists and is in the proper
// directory and is accessible.
// - Check that the net service name used as the connect identifier
// exists in the TNSNAMES.ORA file.
// - Make sure there are no syntax errors anywhere in the TNSNAMES.ORA
// file. Look for unmatched parentheses or stray characters. Errors
// in a TNSNAMES.ORA file may make it unusable.
// - If you are using directory naming:
// - Verify that "LDAP" is listed as one of the values of the
// NAMES.DIRETORY_PATH parameter in the Oracle Net profile
// (SQLNET.ORA).
// - Verify that the LDAP directory server is up and that it is
// accessible.
// - Verify that the net service name or database name used as the
// connect identifier is configured in the directory.
// - Verify that the default context being used is correct by
// specifying a fully qualified net service name or a full LDAP DN
// as the connect identifier
// - If you are using easy connect naming:
// - Verify that "EZCONNECT" is listed as one of the values of the
// NAMES.DIRETORY_PATH parameter in the Oracle Net profile
// (SQLNET.ORA).
// - Make sure the host, port and service name specified
// are correct.
// - Try enclosing the connect identifier in quote marks.
// See the Oracle Net Services Administrators Guide or the Oracle
// operating system specific guide for more information on naming.
bcm@bcm-laptop:~$ oerr ora 12500
12500, 00000, "TNS:listener failed to start a dedicated server process"
// *Cause: The process of starting up a dedicated server process failed.
// The executable could not be found or the environment may be set up
// incorrectly.
// *Action: Turn on tracing at the ADMIN level and reexecute the operation.
// Verify that the ORACLE Server executable is present and has execute
// permissions enabled. Ensure that the ORACLE environment is specified
// correctly in LISTENER.ORA. The Oracle Protocol Adapter that is being
// called may not be installed on the local hard drive. Please check that
// the correct Protocol Adapter are successfully linked.
// If error persists, contact Oracle Customer Support.What explicit SQL or command trigger these errors? -
We setup a server core single node cluster (W2012 R2). The MS DTC is running, and the Distributed Transaction Coordinator firewall rules are enabled. I can connect to the firewall rules and compmgmt.msc remotely for this server. When
I attempt to connect to the Component Services Management console with this server, the MS DTC object is not displayed. Only the COM+ applications are displayed. We've setup other server core instances with out clustering and DTC is displayed.Hi Steve,
We just finished the local test and found this behavior is by design. It’s expected that we can’t see the DTC remotely from component services for a cluster node.
In my lab, 2012R2 node3 is a single node cluster and has DTC role. -
ORA-02049: timeout: distributed transaction waiting for lock
Hi,
My name is Guneet and I'm working on an application running on BEA Weblogic Server 9.2 running on a Red Hat Linux box using Oracle 10g as the database. My problem is that recently our code started getting the following exception while updating a database table.
java.sql.SQLException: [BEA][Oracle JDBC Driver][Oracle]ORA-02049: timeout: distributed transaction waiting for lock
Application Details
* Using Stateless Session EJB
* Only one Business method in this EJB with transaction attribute set to "required"
* This method executes two select queries & one update query
* We are using JDBC to access the database.
* We have configured a Data Source & are using it to get a database connection.
* Weblogic's Oracle Driver is being used.
More details
* The application has been running well since a month.
* Two days ago,the update query failed with the above error.
* At that time, a single client was accessing the system.
* Once this problem occurs, it starts appearing frequently.
* Eventually a request to get a connection from the Data Source times out & the exception copied at the end is thrown
* At this stage the application gets stuck and all requests trying to get a connection end up with this exception.
* Fortunately, Restarting the Weblogic Server gets us out of this problem and transactions resume normally.
Now my questions are
# Why is this error happening & what does it mean?
# It looks like the second exception (unable to get a connection from ds) is an after effect of the first problem (ORA-02049) once it appears for a couple of times. Can somebody validate this?
# Though I don't understand JTA well but I don't think this application needs distributed transactions so, I'm thinking of modifying the driver type to non-XA oracle driver. Any advise/pointers/comments on this front is welcome !!!!!!!!
Thanks
Guneet Sahai
Exception Trace
Dec 27, 2006 4:47:50 PM | com.gisil.themis.db | SEVERE | Unable to load merchant DEL = 911168900164. Reason - java.sql.SQLException: Unexpected exception while enlisting XAConnection java.sql.SQLException: XA error: XAResource.XAER_RMERR start() failed on resource 'themis-ds': XAER_RMERR : A resource manager error has occured in the transaction branch
javax.transaction.xa.XAException: Unexpected error during start for XAResource 'themis-ds': Transaction timed out after 29 seconds
BEA1-252DE51AC930078CA638
at weblogic.jdbc.wrapper.XA.createException(XA.java:103)
at weblogic.jdbc.jta.DataSource.start(DataSource.java:753)
at weblogic.transaction.internal.XAServerResourceInfo.start(XAServerResourceInfo.java:1182)
at weblogic.transaction.internal.XAServerResourceInfo.xaStart(XAServerResourceInfo.java:1115)
at weblogic.transaction.internal.XAServerResourceInfo.enlist(XAServerResourceInfo.java:274)
at weblogic.transaction.internal.ServerTransactionImpl.enlistResource(ServerTransactionImpl.java:497)
at weblogic.transaction.internal.ServerTransactionImpl.enlistResource(ServerTransactionImpl.java:429)
at weblogic.jdbc.jta.DataSource.enlist(DataSource.java:1408)
at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:1332)
at weblogic.jdbc.jta.DataSource.getConnection(DataSource.java:440)
at weblogic.jdbc.jta.DataSource.connect(DataSource.java:396)
at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:359)
at com.gisil.themis.db.impl1.DbManagerImpl.isPinValid(DbManagerImpl.java:872)
at com.gisil.themis.ejb.ThemisBean.isPinValid(ThemisBean.java:185)
at com.gisil.themis.ejb.Themis_aqqc4k_EOImpl.isPinValid(Themis_aqqc4k_EOImpl.java:207)
at com.gisil.themis.ejb.Themis_aqqc4k_EOImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:517)
at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:224)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:407)
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:403)
at weblogic.rmi.internal.BasicServerRef.access$300(BasicServerRef.java:56)
at weblogic.rmi.internal.BasicServerRef$BasicExecuteRequest.run(BasicServerRef.java:934)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
at weblogic.jdbc.jta.DataSource.enlist(DataSource.java:1413)
at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:1332)
at weblogic.jdbc.jta.DataSource.getConnection(DataSource.java:440)
at weblogic.jdbc.jta.DataSource.connect(DataSource.java:396)
at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:359)
at com.gisil.themis.db.impl1.DbManagerImpl.isPinValid(DbManagerImpl.java:872)
at com.gisil.themis.ejb.ThemisBean.isPinValid(ThemisBean.java:185)
at com.gisil.themis.ejb.Themis_aqqc4k_EOImpl.isPinValid(Themis_aqqc4k_EOImpl.java:207)
at com.gisil.themis.ejb.Themis_aqqc4k_EOImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:517)
at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:224)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:407)
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:403)
at weblogic.rmi.internal.BasicServerRef.access$300(BasicServerRef.java:56)
at weblogic.rmi.internal.BasicServerRef$BasicExecuteRequest.run(BasicServerRef.java:934)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)guneet sahai wrote:
Hi,
My name is Guneet and I'm working on an application running on BEA Weblogic Server 9.2 running on a Red Hat Linux box using Oracle 10g as the database. My problem is that recently our code started getting the following exception while updating a database table.
java.sql.SQLException: [BEA][Oracle JDBC Driver][Oracle]ORA-02049: timeout: distributed transaction waiting for lock
Application Details
* Using Stateless Session EJB
* Only one Business method in this EJB with transaction attribute set to "required"
* This method executes two select queries & one update query
* We are using JDBC to access the database.
* We have configured a Data Source & are using it to get a database connection.
* Weblogic's Oracle Driver is being used.
More details
* The application has been running well since a month.
* Two days ago,the update query failed with the above error.
* At that time, a single client was accessing the system.
* Once this problem occurs, it starts appearing frequently.
* Eventually a request to get a connection from the Data Source times out & the exception copied at the end is thrown
* At this stage the application gets stuck and all requests trying to get a connection end up with this exception.
* Fortunately, Restarting the Weblogic Server gets us out of this problem and transactions resume normally.
Now my questions are
# Why is this error happening & what does it mean?
# It looks like the second exception (unable to get a connection from ds) is an after effect of the first problem (ORA-02049) once it appears for a couple of times. Can somebody validate this?
# Though I don't understand JTA well but I don't think this application needs distributed transactions so, I'm thinking of modifying the driver type to non-XA oracle driver. Any advise/pointers/comments on this front is welcome !!!!!!!!
Thanks
Guneet SahaiHi Guneet. If you want to debug the JTA issue, I suggest opening an official
support case. They will lead you through producing the JTA debug information.
However, I believe you are correct that the transaction you describe is
completely doable with a simple local transaction, so if you were to alter
your pool to use the non-XA driver, it would probably be faster, simpler,
and just work.
Let me know...
Joe
>
Exception Trace
Dec 27, 2006 4:47:50 PM | com.gisil.themis.db | SEVERE | Unable to load merchant DEL = 911168900164. Reason - java.sql.SQLException: Unexpected exception while enlisting XAConnection java.sql.SQLException: XA error: XAResource.XAER_RMERR start() failed on resource 'themis-ds': XAER_RMERR : A resource manager error has occured in the transaction branch
javax.transaction.xa.XAException: Unexpected error during start for XAResource 'themis-ds': Transaction timed out after 29 seconds
BEA1-252DE51AC930078CA638
at weblogic.jdbc.wrapper.XA.createException(XA.java:103)
at weblogic.jdbc.jta.DataSource.start(DataSource.java:753)
at weblogic.transaction.internal.XAServerResourceInfo.start(XAServerResourceInfo.java:1182)
at weblogic.transaction.internal.XAServerResourceInfo.xaStart(XAServerResourceInfo.java:1115)
at weblogic.transaction.internal.XAServerResourceInfo.enlist(XAServerResourceInfo.java:274)
at weblogic.transaction.internal.ServerTransactionImpl.enlistResource(ServerTransactionImpl.java:497)
at weblogic.transaction.internal.ServerTransactionImpl.enlistResource(ServerTransactionImpl.java:429)
at weblogic.jdbc.jta.DataSource.enlist(DataSource.java:1408)
at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:1332)
at weblogic.jdbc.jta.DataSource.getConnection(DataSource.java:440)
at weblogic.jdbc.jta.DataSource.connect(DataSource.java:396)
at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:359)
at com.gisil.themis.db.impl1.DbManagerImpl.isPinValid(DbManagerImpl.java:872)
at com.gisil.themis.ejb.ThemisBean.isPinValid(ThemisBean.java:185)
at com.gisil.themis.ejb.Themis_aqqc4k_EOImpl.isPinValid(Themis_aqqc4k_EOImpl.java:207)
at com.gisil.themis.ejb.Themis_aqqc4k_EOImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:517)
at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:224)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:407)
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:403)
at weblogic.rmi.internal.BasicServerRef.access$300(BasicServerRef.java:56)
at weblogic.rmi.internal.BasicServerRef$BasicExecuteRequest.run(BasicServerRef.java:934)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
at weblogic.jdbc.jta.DataSource.enlist(DataSource.java:1413)
at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:1332)
at weblogic.jdbc.jta.DataSource.getConnection(DataSource.java:440)
at weblogic.jdbc.jta.DataSource.connect(DataSource.java:396)
at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:359)
at com.gisil.themis.db.impl1.DbManagerImpl.isPinValid(DbManagerImpl.java:872)
at com.gisil.themis.ejb.ThemisBean.isPinValid(ThemisBean.java:185)
at com.gisil.themis.ejb.Themis_aqqc4k_EOImpl.isPinValid(Themis_aqqc4k_EOImpl.java:207)
at com.gisil.themis.ejb.Themis_aqqc4k_EOImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:517)
at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:224)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:407)
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:403)
at weblogic.rmi.internal.BasicServerRef.access$300(BasicServerRef.java:56)
at weblogic.rmi.internal.BasicServerRef$BasicExecuteRequest.run(BasicServerRef.java:934)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:181) -
Unable to enlist in a distributed transaction (Windows7, Oracle 11G R1)
Hi,
I have a .Net application running on Windows 7 x64 using VisualStudio2008 and Oracle 11G R1 32bit client
In it I call a webservice calling another webservice, this requires to use oramts that interfaces with Microsoft DTC. However I'm getting the following error when calling the service method:
"Unable to enlist in a distributed transaction"
I have checked the following:
- Ora MTS is installed
- DTC is running, the security settings allow AX transactions (in fact I just allowed everything)
- Network services have the permission to access oracle dlls
- The registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSDTC\MTxOCI contains the following: "OracleXaLib"="xa80.dll" "OracleSqlLib"="SQLLib80.dll" "OracleOciLib"="oci.dll" (not sure if this is right)
What is it I'm doing wrong ? Does this version of Oracle work correctly on W7 ?
By the way it works fine on Windows XP !
I've spend quite some time trying to find a resolution..
Thanks!I think I answered my own question
It seems that MSDTC is not supported by Oracle 11G R1 on Windows x64 !
All Oracle Database components are supported on Windows x64 with the following exceptions:
•Oracle Services for Microsoft Transaction Server are not supported on Windows Vista. As a result, all Oracle Windows data access drivers on Windows Vista that use Oracle Services for Microsoft Transaction Server to enlist in Microsoft Distributed Transaction Coordinator (MSDTC) coordinated transactions cannot participate in those coordinated transactions. These data access drivers include Oracle Data Provider for .NET, Oracle Provider for OLE DB, Oracle Objects for OLE, and ODBC. Check OracleMetaLink for up to date information on Oracle Services for Microsoft Transaction Server certification with Windows Vista.
http://download.oracle.com/docs/cd/B28359_01/install.111/b32006/reqs.htm#CHDCEFIJ
Edited by: 845528 on 18 mars 2011 05:05 -
ORA-00164: autonomous transaction disallowed within distributed transaction
I have been trying to solve this problem for weeks now, I have posted this question everywhere I can think of, but I havent really received and answer that has helped, so now I am going to post it here hoping for an answer.
We are running 9iAS on Solaris and when the following stuff is run we are getting ORA-00164 errors. If you refresh the page a bunch of time the problem goes away. But it comes back the next time you try to execute the procedure again. Here are the cases when the problem shows up.
Editing the style:
PROCEDURE : PORTAL30.wwpob_app_style.edit_style
Saving changes to the banner for a page
PROCEDURE : PORTAL30.wwptl_banner.savecustom
Logging out
PROCEDURE : PORTAL30.wwsec_app_priv.logout
After setting the default user group and applying the changes:
PROCEDURE : PORTAL30.wwsec_app_user_mgr.edit_user
Creating a new group:
PROCEDURE : PORTAL30.wwsec_app_group_mgr.create_group
Opening the add portlet screen:
PROCEDURE : PORTAL30.wwv_main.main
There are a few other places but I don't have them documented. In ALL cases the problem goes away once we start and stop the Apache using the following comands:
/app/oracle/n_portal/Apache/Apache/bin/apachectl stop
ps -ef | grep httpd | grep n_portal
/app/oracle/n_portal/Apache/Apache/bin/apachectl start
After starting and stopping Apache the problem is gone for a little while (20-30 mins) then it starts coming back slowly (sometimes the problem is there then it is not). Once the problem is back if you continually press refresh on the browser (5-10 times) the page might appear, if the page does not appear you will see the
ORA-00164: autonomous transaction disallowed within distributed transaction
The following error appears in apache log (50% of the time) when Autonomous Transaction error shows up on the screen:-
DSHttpSessionBindingListenerImpl.valueUnbound : closing DS session : DSSession id = 5225534324468880950975536484
215 PortalSession id = 521335001720MERAJ
DSHttpSessionBindingListenerImpl.valueUnbound : closing DS session : DSSession id = -638034231325135430097553725
8001 PortalSession id = 992335001711JDALGLIESH
These errors might be related to dynamic services but we were had the problem long before Dynamic services was installed.
We want to start pre-production user testing as we have just had 11 developers building portlets for the company, but we cant do much with this error popping up every time a user wants to test it. We have one of the Oracle consultants here and he has asked the oracle developer group what the problem could be, and they seem to think it might be related to our use of DB links however, we never get the problem when we try to run a portlet that uses a database link.
Please help.
Jeff Dalgliesh
nullJay,
My name is Craig McCauley. I'm an Oracle Technical Manager working onsite at Unocal Indonesia. I'm with the Portal group in ATS.
When I got here the first thing we did was bump up init.ora parameters and apache confif parameters as suggested by the iPlatform group. We have thes sessions parameter (in init.ora) bumped up from 100 to 700. I'm watching v$session and the get these AT messages with as few as 70 total db sessions. Any help your group can give will be greatly appreciated.
Unocal is planning on implementing Oracle Portal globally - as a common interface. They have similar installs in Thailand and Houston and thus far have not seen the AT messages (although there has not been much development going on at those sites).
Thanks,
Craig -
Works in sql not in apex: ORA-02049 distributed transaction waiting lock
Hi,
I get this error
failed to parse SQL query:
ORA-02049: timeout: distributed transaction waiting for lockwhen trying to run this query from it's page. But it works fine if I run it in the SQL console...
failed to parse SQL query:
ORA-select distinct n.notif_no,
n.maint_work_centre,
n.maint_work_centre_text,
n.raised_by,
n.notif_text,
(select (SAP_LONG_TEXT.NOTIFICATION_TEXT_1||SAP_LONG_TEXT.NOTIFICATION_TEXT_2||SAP_LONG_TEXT.NOTIFICATION_TEXT_3||SAP_LONG_TEXT.NOTIFICATION_TEXT_4||SAP_LONG_TEXT.NOTIFICATION_TEXT_5||SAP_LONG_TEXT.NOTIFICATION_TEXT_6||SAP_LONG_TEXT.NOTIFICATION_TEXT_7||SAP_LONG_TEXT.NOTIFICATION_TEXT_8||SAP_LONG_TEXT.NOTIFICATION_TEXT_9||SAP_LONG_TEXT.NOTIFICATION_TEXT_10||SAP_LONG_TEXT.NOTIFICATION_TEXT_11||SAP_LONG_TEXT.NOTIFICATION_TEXT_12||SAP_LONG_TEXT.NOTIFICATION_TEXT_13||SAP_LONG_TEXT.NOTIFICATION_TEXT_14||SAP_LONG_TEXT.NOTIFICATION_TEXT_15||SAP_LONG_TEXT.NOTIFICATION_TEXT_16||SAP_LONG_TEXT.NOTIFICATION_TEXT_17||SAP_LONG_TEXT.NOTIFICATION_TEXT_18||SAP_LONG_TEXT.NOTIFICATION_TEXT_19||SAP_LONG_TEXT.NOTIFICATION_TEXT_20||SAP_LONG_TEXT.NOTIFICATION_TEXT_21||SAP_LONG_TEXT.NOTIFICATION_TEXT_22||SAP_LONG_TEXT.NOTIFICATION_TEXT_23||SAP_LONG_TEXT.NOTIFICATION_TEXT_24||SAP_LONG_TEXT.NOTIFICATION_TEXT_25||SAP_LONG_TEXT.NOTIFICATION_TEXT_26||SAP_LONG_TEXT.NOTIFICATION_TEXT_27||SAP_LONG_TEXT.NOTIFICATION_TEXT_28||SAP_LONG_TEXT.NOTIFICATION_TEXT_29||SAP_LONG_TEXT.NOTIFICATION_TEXT_30||SAP_LONG_TEXT.NOTIFICATION_TEXT_31||SAP_LONG_TEXT.NOTIFICATION_TEXT_32||SAP_LONG_TEXT.NOTIFICATION_TEXT_33||SAP_LONG_TEXT.NOTIFICATION_TEXT_34||SAP_LONG_TEXT.NOTIFICATION_TEXT_35||SAP_LONG_TEXT.NOTIFICATION_TEXT_36||SAP_LONG_TEXT.NOTIFICATION_TEXT_37||SAP_LONG_TEXT.NOTIFICATION_TEXT_38||SAP_LONG_TEXT.NOTIFICATION_TEXT_39||SAP_LONG_TEXT.NOTIFICATION_TEXT_40||SAP_LONG_TEXT.NOTIFICATION_TEXT_41||SAP_LONG_TEXT.NOTIFICATION_TEXT_42||SAP_LONG_TEXT.NOTIFICATION_TEXT_43||SAP_LONG_TEXT.NOTIFICATION_TEXT_44||SAP_LONG_TEXT.NOTIFICATION_TEXT_45||SAP_LONG_TEXT.NOTIFICATION_TEXT_46||SAP_LONG_TEXT.NOTIFICATION_TEXT_47||SAP_LONG_TEXT.NOTIFICATION_TEXT_48||SAP_LONG_TEXT.NOTIFICATION_TEXT_49||SAP_LONG_TEXT.NOTIFICATION_TEXT_50) from sap_long_text@genadm where sap_long_text.notification = n.notif_no) "long",
n.notif_date,
n.funct_loc,
n.order_no,
n.notif_status,
n.room,
n.notif_type
from notifications@amt n, SAP_LONG_TEXT@genadm
where instr(':'||:P9_NOTIFTYPE||':',':'||n.NOTIF_TYPE||':')>0 and
instr (':'||:P9_SITE||':',':'||n.site||':') > 0 and
n.notif_date BETWEEN :P9_DATEFROM and :P9_DATETO and
n.notif_status not like '%NOCO%'I've had this error before but I don't remember why/what happened. The page has been working fine, the error just randomly cropped up today.
And a secondary question, is there a better way to write the query (it's a copy/paste from an older query). That select within the select is ugly...Hello,
Take a look at the following thread -
help ORA-02049
Is it really necessary that you always query across the DBLink? Is using local materialized views not an option for you?
John.
http://jes.blogs.shellprompt.net
http://apex-evangelists.com
Maybe you are looking for
-
ALV truncates last digit of field when exported to Excel.
Hello SAPients! I have an ALV grid that truncates the last digit of one of the fields (VBELN) when it is exported to Excel. The field is defined with reference to the standard field VBRK-VBELN. I'm working on SAP 4.6C. Any idea? Thank you for your he
-
Powering on is mest up! Need Help!
When I turn on my Blueberry iBook G3 Clamshell it turns on properly making the chimes noise and everything. Then it just stays on a gray screen and in the center a folder switches from a folder with the "finder: logo on it to a folder with a "?" on i
-
Is it possible to backup to TC through TM without being connected to Wi-Fi?
As I had several issues with TC and couldn't resolve it in time I have resorted to erasing all data to start over again. I connected my TC to my Mac using an Ethernet cable and tried to set it up without setting it up to a wi-fi network. Although it
-
Load balance issues with RV042
Hi, I have some issue to configure my RV042. I have 8 voip phones and 10 pcs on my network. I used DHCP to attribute IP between 192.168.1.10 and 192.168.1.20 to the phones and over .100 to the PC. I want my phone to have their own connexion. My switc
-
Library shows wrong ports when using external MIDI
Whenever I start a new project and choose an external midi track the library displays the wrong ports. I have an Axiom 25, Motif XS6, and a Kurzweil through an Ultralite. The Axiom and Ultralite show correctly but the MOTIF (which has 3 ports) are al