Issue with transactions

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Issue with transactions

Tor Arne Kvaløy
Greetings fellow Mulers!

I have a transacted inbound JMS with an UMO component that calls another component with muleclient.

I want it to rollback if the connections fails, and this works fine when it calls a web service, but not when its using the jdbc connector.

My exception is:

java.lang.RuntimeException: Could not bind connection to current transaction
        at org.mule.providers.jdbc.JdbcConnector.getConnection(JdbcConnector.java:472)
        at com.pointcarbon.mule.comp.AddCurve.addCurve(AddCurve.java:59)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.mule.impl.model.resolvers.DynamicEntryPoint.invokeMethod(DynamicEntryPoint.java:312)
        at org.mule.impl.model.resolvers.DynamicEntryPoint.invoke(DynamicEntryPoint.java:259)
        at org.mule.impl.DefaultLifecycleAdapter.intercept(DefaultLifecycleAdapter.java:194)
        at org.mule.impl.InterceptorsInvoker.execute(InterceptorsInvoker.java:47)
        at org.mule.impl.model.DefaultMuleProxy.onCall(DefaultMuleProxy.java:258)
        at org.mule.impl.model.seda.SedaComponent.doSend(SedaComponent.java:393)
        at org.mule.impl.model.AbstractComponent.sendEvent(AbstractComponent.java:418)
        at org.mule.impl.MuleSession.sendEvent(MuleSession.java:349)
        at org.mule.routing.inbound.InboundRouterCollection.send(InboundRouterCollection.java:197)
        at org.mule.routing.inbound.InboundRouterCollection.route(InboundRouterCollection.java:163)
        at org.mule.providers.AbstractMessageReceiver$DefaultInternalMessageListener.onMessage(AbstractMessageReceiver.java:581)
        at org.mule.providers.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:322)
        at org.mule.providers.AbstractReceiverWorker$1.doInTransaction(AbstractReceiverWorker.java:107)
        at org.mule.transaction.TransactionTemplate.execute(TransactionTemplate.java:92)
        at org.mule.providers.AbstractReceiverWorker.doRun(AbstractReceiverWorker.java:124)
        at org.mule.providers.AbstractReceiverWorker.run(AbstractReceiverWorker.java:60)
        at org.mule.impl.work.WorkerContext.run(WorkerContext.java:310)
        at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)
        at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575)
        at java.lang.Thread.run(Unknown Source)
Caused by: org.mule.transaction.IllegalTransactionStateException: Can only bind "javax.jms.Connection/javax.jms.Session" type reso
urces
        at org.mule.providers.jms.JmsTransaction.bindResource(JmsTransaction.java:36)
        at org.mule.providers.jdbc.JdbcConnector.getConnection(JdbcConnector.java:468)
        ... 25 more


My config:

<mule-descriptor name="AddCurve" implementation="xxx.AddCurve">
<inbound-router>
<endpoint address="jms://GNGCurve" connector="jmsConnector" transformers="JMSMessageToObject">
  <transaction factory="org.mule.providers.jms.JmsTransactionFactory" action="ALWAYS_BEGIN" />
</endpoint>
</inbound-router>
<exception-strategy className="xxx.RollbackComponentExceptionStrategy" />
</mule-descriptor>


<mule-descriptor name="AddCurveWriteToDb" implementation="BridgeComponent">
<inbound-router>
  <endpoint address="vm://AddCurveWriteToDb" synchronous="true"/>
</inbound-router>
<outbound-router>
<router className="org.mule.routing.outbound.OutboundPassThroughRouter">
  <endpoint address="jdbc://receivecurvetable" connector="dwJdbcConnector" />
</router>
</outbound-router>
</mule-descriptor>



Any suggestions? :)

Tor
Reply | Threaded
Open this post in threaded view
|

Re: Issue with transactions

Tor Arne Kvaløy
Hey,

I have located the problem, which is the JdbcConnector.getConnection() call in my UMO component. It tries to the use the current transaction which is the JmsTransacton.

My code:

JdbcConnector connector = (JdbcConnector) MuleManager.getInstance()
                                        .lookupConnector("dwJdbcConnector");
Connection con = connector.getConnection();

ArrayDescriptor des = ArrayDescriptor.createDescriptor("TBL_T_JAVA_CURVE_DATA", con);
ARRAY a = new ARRAY(des, con, dbCurveList);
MuleClient client = new MuleClient();
UMOMessage result = client.send("vm://AddCurveWriteToDb", (Object)a,null);
               

So the question is how can I obtain a jdbc connection without involving the transaction?

Thanks!

Tor


torarnek wrote
Greetings fellow Mulers!

I have a transacted inbound JMS with an UMO component that calls another component with muleclient.

I want it to rollback if the connections fails, and this works fine when it calls a web service, but not when its using the jdbc connector.

My exception is:

java.lang.RuntimeException: Could not bind connection to current transaction
        at org.mule.providers.jdbc.JdbcConnector.getConnection(JdbcConnector.java:472)
        at com.pointcarbon.mule.comp.AddCurve.addCurve(AddCurve.java:59)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.mule.impl.model.resolvers.DynamicEntryPoint.invokeMethod(DynamicEntryPoint.java:312)
        at org.mule.impl.model.resolvers.DynamicEntryPoint.invoke(DynamicEntryPoint.java:259)
        at org.mule.impl.DefaultLifecycleAdapter.intercept(DefaultLifecycleAdapter.java:194)
        at org.mule.impl.InterceptorsInvoker.execute(InterceptorsInvoker.java:47)
        at org.mule.impl.model.DefaultMuleProxy.onCall(DefaultMuleProxy.java:258)
        at org.mule.impl.model.seda.SedaComponent.doSend(SedaComponent.java:393)
        at org.mule.impl.model.AbstractComponent.sendEvent(AbstractComponent.java:418)
        at org.mule.impl.MuleSession.sendEvent(MuleSession.java:349)
        at org.mule.routing.inbound.InboundRouterCollection.send(InboundRouterCollection.java:197)
        at org.mule.routing.inbound.InboundRouterCollection.route(InboundRouterCollection.java:163)
        at org.mule.providers.AbstractMessageReceiver$DefaultInternalMessageListener.onMessage(AbstractMessageReceiver.java:581)
        at org.mule.providers.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:322)
        at org.mule.providers.AbstractReceiverWorker$1.doInTransaction(AbstractReceiverWorker.java:107)
        at org.mule.transaction.TransactionTemplate.execute(TransactionTemplate.java:92)
        at org.mule.providers.AbstractReceiverWorker.doRun(AbstractReceiverWorker.java:124)
        at org.mule.providers.AbstractReceiverWorker.run(AbstractReceiverWorker.java:60)
        at org.mule.impl.work.WorkerContext.run(WorkerContext.java:310)
        at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)
        at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575)
        at java.lang.Thread.run(Unknown Source)
Caused by: org.mule.transaction.IllegalTransactionStateException: Can only bind "javax.jms.Connection/javax.jms.Session" type reso
urces
        at org.mule.providers.jms.JmsTransaction.bindResource(JmsTransaction.java:36)
        at org.mule.providers.jdbc.JdbcConnector.getConnection(JdbcConnector.java:468)
        ... 25 more


My config:

<mule-descriptor name="AddCurve" implementation="xxx.AddCurve">
<inbound-router>
<endpoint address="jms://GNGCurve" connector="jmsConnector" transformers="JMSMessageToObject">
  <transaction factory="org.mule.providers.jms.JmsTransactionFactory" action="ALWAYS_BEGIN" />
</endpoint>
</inbound-router>
<exception-strategy className="xxx.RollbackComponentExceptionStrategy" />
</mule-descriptor>


<mule-descriptor name="AddCurveWriteToDb" implementation="BridgeComponent">
<inbound-router>
  <endpoint address="vm://AddCurveWriteToDb" synchronous="true"/>
</inbound-router>
<outbound-router>
<router className="org.mule.routing.outbound.OutboundPassThroughRouter">
  <endpoint address="jdbc://receivecurvetable" connector="dwJdbcConnector" />
</router>
</outbound-router>
</mule-descriptor>



Any suggestions? :)

Tor
Reply | Threaded
Open this post in threaded view
|

Re: Issue with transactions

Tor Arne Kvaløy

The monologue continues.. :)

I have solved this issue by getting the connection from the connector's datasoure:
Connection con = connector.getDataSource().getConnection();

However, I am still trapped. Now the outbound JDBC endpoint seems to do the same, getConnection(), and it says:

java.lang.RuntimeException: Could not bind connection to current transaction
org.mule.providers.jdbc.JdbcConnector.getConnection(JdbcConnector.java:472)

So I am within the transaction boundary of the JMS, and I would like to tell jdbc outbound jdbconnecor not to use transaction.

I would assume that this would be done by adding the following to the inbound endpoint of the component  that has the oubound jdbc procedure call:

<endpoint address="vm://AddCurveWriteToDb" synchronous="true">
  <transaction factory="org.mule.providers.vm.VMTransactionFactory" action="NONE" />
</endpoint>

Is this right?  How can I make the JDBC enpoint not to join the transaction?

Thanks,

Tor

torarnek wrote
Hey,

I have located the problem, which is the JdbcConnector.getConnection() call in my UMO component. It tries to the use the current transaction which is the JmsTransacton.

My code:

JdbcConnector connector = (JdbcConnector) MuleManager.getInstance()
                                        .lookupConnector("dwJdbcConnector");
Connection con = connector.getConnection();

ArrayDescriptor des = ArrayDescriptor.createDescriptor("TBL_T_JAVA_CURVE_DATA", con);
ARRAY a = new ARRAY(des, con, dbCurveList);
MuleClient client = new MuleClient();
UMOMessage result = client.send("vm://AddCurveWriteToDb", (Object)a,null);
               

So the question is how can I obtain a jdbc connection without involving the transaction?

Thanks!

Tor


torarnek wrote
Greetings fellow Mulers!

I have a transacted inbound JMS with an UMO component that calls another component with muleclient.

I want it to rollback if the connections fails, and this works fine when it calls a web service, but not when its using the jdbc connector.

My exception is:

java.lang.RuntimeException: Could not bind connection to current transaction
        at org.mule.providers.jdbc.JdbcConnector.getConnection(JdbcConnector.java:472)
        at com.pointcarbon.mule.comp.AddCurve.addCurve(AddCurve.java:59)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.mule.impl.model.resolvers.DynamicEntryPoint.invokeMethod(DynamicEntryPoint.java:312)
        at org.mule.impl.model.resolvers.DynamicEntryPoint.invoke(DynamicEntryPoint.java:259)
        at org.mule.impl.DefaultLifecycleAdapter.intercept(DefaultLifecycleAdapter.java:194)
        at org.mule.impl.InterceptorsInvoker.execute(InterceptorsInvoker.java:47)
        at org.mule.impl.model.DefaultMuleProxy.onCall(DefaultMuleProxy.java:258)
        at org.mule.impl.model.seda.SedaComponent.doSend(SedaComponent.java:393)
        at org.mule.impl.model.AbstractComponent.sendEvent(AbstractComponent.java:418)
        at org.mule.impl.MuleSession.sendEvent(MuleSession.java:349)
        at org.mule.routing.inbound.InboundRouterCollection.send(InboundRouterCollection.java:197)
        at org.mule.routing.inbound.InboundRouterCollection.route(InboundRouterCollection.java:163)
        at org.mule.providers.AbstractMessageReceiver$DefaultInternalMessageListener.onMessage(AbstractMessageReceiver.java:581)
        at org.mule.providers.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:322)
        at org.mule.providers.AbstractReceiverWorker$1.doInTransaction(AbstractReceiverWorker.java:107)
        at org.mule.transaction.TransactionTemplate.execute(TransactionTemplate.java:92)
        at org.mule.providers.AbstractReceiverWorker.doRun(AbstractReceiverWorker.java:124)
        at org.mule.providers.AbstractReceiverWorker.run(AbstractReceiverWorker.java:60)
        at org.mule.impl.work.WorkerContext.run(WorkerContext.java:310)
        at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)
        at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575)
        at java.lang.Thread.run(Unknown Source)
Caused by: org.mule.transaction.IllegalTransactionStateException: Can only bind "javax.jms.Connection/javax.jms.Session" type reso
urces
        at org.mule.providers.jms.JmsTransaction.bindResource(JmsTransaction.java:36)
        at org.mule.providers.jdbc.JdbcConnector.getConnection(JdbcConnector.java:468)
        ... 25 more


My config:

<mule-descriptor name="AddCurve" implementation="xxx.AddCurve">
<inbound-router>
<endpoint address="jms://GNGCurve" connector="jmsConnector" transformers="JMSMessageToObject">
  <transaction factory="org.mule.providers.jms.JmsTransactionFactory" action="ALWAYS_BEGIN" />
</endpoint>
</inbound-router>
<exception-strategy className="xxx.RollbackComponentExceptionStrategy" />
</mule-descriptor>


<mule-descriptor name="AddCurveWriteToDb" implementation="BridgeComponent">
<inbound-router>
  <endpoint address="vm://AddCurveWriteToDb" synchronous="true"/>
</inbound-router>
<outbound-router>
<router className="org.mule.routing.outbound.OutboundPassThroughRouter">
  <endpoint address="jdbc://receivecurvetable" connector="dwJdbcConnector" />
</router>
</outbound-router>
</mule-descriptor>



Any suggestions? :)

Tor
Reply | Threaded
Open this post in threaded view
|

Re: Issue with transactions

Andrew Perepelytsya
The error was correct, you were trying to mix different resources in the same TX. Try plugging an extra bridge component in front of JDBC and use the NONE attribute on this vm bridge.

Andrew

On Nov 13, 2007 6:31 AM, torarnek <[hidden email]> wrote:


The monologue continues.. :)

I have solved this issue by getting the connection from the connector's
datasoure:
Connection con = connector.getDataSource().getConnection();

However, I am still trapped. Now the outbound JDBC endpoint seems to do the
same, getConnection(), and it says:

java.lang.RuntimeException: Could not bind connection to current transaction
org.mule.providers.jdbc.JdbcConnector.getConnection (JdbcConnector.java:472)

So I am within the transaction boundary of the JMS, and I would like to tell
jdbc outbound jdbconnecor not to use transaction.

I would assume that this would be done by adding the following to the
inbound endpoint of the component  that has the oubound jdbc procedure call:

<endpoint address="vm://AddCurveWriteToDb" synchronous="true">
 <transaction factory=" org.mule.providers.vm.VMTransactionFactory"
action="NONE" />
</endpoint>

Is this right?  How can I make the JDBC enpoint not to join the transaction?

Thanks,

Tor


torarnek wrote:

>
> Hey,
>
> I have located the problem, which is the JdbcConnector.getConnection()
> call in my UMO component. It tries to the use the current transaction
> which is the JmsTransacton.
>
> My code:
>
> JdbcConnector connector = (JdbcConnector) MuleManager.getInstance()
>                                       .lookupConnector("dwJdbcConnector");
> Connection con = connector.getConnection();
>
> ArrayDescriptor des =
> ArrayDescriptor.createDescriptor("TBL_T_JAVA_CURVE_DATA", con);
> ARRAY a = new ARRAY(des, con, dbCurveList);
> MuleClient client = new MuleClient();
> UMOMessage result = client.send("vm://AddCurveWriteToDb", (Object)a,null);
>
>
> So the question is how can I obtain a jdbc connection without involving
> the transaction?
>
> Thanks!
>
> Tor
>
>
>
> torarnek wrote:
>>
>> Greetings fellow Mulers!
>>
>> I have a transacted inbound JMS with an UMO component that calls another
>> component with muleclient.
>>
>> I want it to rollback if the connections fails, and this works fine when
>> it calls a web service, but not when its using the jdbc connector.
>>
>> My exception is:
>>
>> java.lang.RuntimeException: Could not bind connection to current
>> transaction
>>         at
>> org.mule.providers.jdbc.JdbcConnector.getConnection (JdbcConnector.java:472)
>>         at com.pointcarbon.mule.comp.AddCurve.addCurve(AddCurve.java:59)
>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>         at sun.reflect.NativeMethodAccessorImpl.invoke (Unknown Source)
>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
>> Source)
>>         at java.lang.reflect.Method.invoke(Unknown Source)
>>         at
>> org.mule.impl.model.resolvers.DynamicEntryPoint.invokeMethod(DynamicEntryPoint.java:312)
>>         at
>> org.mule.impl.model.resolvers.DynamicEntryPoint.invoke(DynamicEntryPoint.java:259)
>>         at
>> org.mule.impl.DefaultLifecycleAdapter.intercept(DefaultLifecycleAdapter.java:194)
>>         at
>> org.mule.impl.InterceptorsInvoker.execute(InterceptorsInvoker.java:47)
>>         at
>> org.mule.impl.model.DefaultMuleProxy.onCall(DefaultMuleProxy.java:258)
>>         at
>> org.mule.impl.model.seda.SedaComponent.doSend(SedaComponent.java:393)
>>         at
>> org.mule.impl.model.AbstractComponent.sendEvent(AbstractComponent.java:418)
>>         at org.mule.impl.MuleSession.sendEvent(MuleSession.java:349)
>>         at
>> org.mule.routing.inbound.InboundRouterCollection.send (InboundRouterCollection.java:197)
>>         at
>> org.mule.routing.inbound.InboundRouterCollection.route(InboundRouterCollection.java:163)
>>         at
>> org.mule.providers.AbstractMessageReceiver$DefaultInternalMessageListener.onMessage (AbstractMessageReceiver.java:581)
>>         at
>> org.mule.providers.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:322)
>>         at
>> org.mule.providers.AbstractReceiverWorker$1.doInTransaction (AbstractReceiverWorker.java:107)
>>         at
>> org.mule.transaction.TransactionTemplate.execute(TransactionTemplate.java:92)
>>         at
>> org.mule.providers.AbstractReceiverWorker.doRun (AbstractReceiverWorker.java:124)
>>         at
>> org.mule.providers.AbstractReceiverWorker.run(AbstractReceiverWorker.java:60)
>>         at org.mule.impl.work.WorkerContext.run(WorkerContext.java :310)
>>         at
>> edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)
>>         at
>> edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:575)
>>         at java.lang.Thread.run(Unknown Source)
>> Caused by: org.mule.transaction.IllegalTransactionStateException: Can
>> only bind "javax.jms.Connection/javax.jms.Session" type reso
>> urces
>>         at
>> org.mule.providers.jms.JmsTransaction.bindResource(JmsTransaction.java:36)
>>         at
>> org.mule.providers.jdbc.JdbcConnector.getConnection(JdbcConnector.java :468)
>>         ... 25 more
>>
>>
>> My config:
>>
>> <mule-descriptor name="AddCurve" implementation="xxx.AddCurve">
>> <inbound-router>
>> <endpoint address="jms://GNGCurve" connector="jmsConnector"
>> transformers="JMSMessageToObject">
>>   <transaction factory="org.mule.providers.jms.JmsTransactionFactory "
>> action="ALWAYS_BEGIN" />
>> </endpoint>
>> </inbound-router>
>> <exception-strategy className="xxx.RollbackComponentExceptionStrategy" />
>> </mule-descriptor>
>>
>>
>> <mule-descriptor name="AddCurveWriteToDb"
>> implementation="BridgeComponent">
>> <inbound-router>
>>   <endpoint address="vm://AddCurveWriteToDb" synchronous="true"/>
>> </inbound-router>
>> <outbound-router>
>> <router className="org.mule.routing.outbound.OutboundPassThroughRouter ">
>>   <endpoint address="jdbc://receivecurvetable"
>> connector="dwJdbcConnector" />
>> </router>
>> </outbound-router>
>> </mule-descriptor>
>>
>>
>>
>> Any suggestions? :)
>>
>> Tor
>>
>
>

--
View this message in context: http://www.nabble.com/Issue-with-transactions-tf4791938.html#a13724170
Sent from the Mule - User mailing list archive at Nabble.com .


---------------------------------------------------------------------
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Issue with transactions

Tor Arne Kvaløy
Hey Andrew!

I have tried this but the JDBC connector/enpoint is still trying to bind to the JMS transaction...

Stacktrace:

org.mule.transaction.IllegalTransactionStateException: Can only bind "javax.jms.Connection/javax.jms.Session" type resources
        at org.mule.providers.jms.JmsTransaction.bindResource(JmsTransaction.java:36)
        at org.mule.providers.jdbc.JdbcConnector.getConnection(JdbcConnector.java:468)
        at org.mule.providers.jdbc.JdbcMessageDispatcher.executeWriteStatement(JdbcMessageDispatcher.java:66)
        at org.mule.providers.jdbc.JdbcMessageDispatcher.doSend(JdbcMessageDispatcher.java:161)
        at org.mule.providers.AbstractMessageDispatcher.send(AbstractMessageDispatcher.java:224)
        at org.mule.providers.AbstractConnector.send(AbstractConnector.java:1629)
        at org.mule.impl.ImmutableMuleEndpoint.send(ImmutableMuleEndpoint.java:950)
        at org.mule.impl.MuleSession.sendEvent(MuleSession.java:327)
        at org.mule.impl.MuleSession.sendEvent(MuleSession.java:210)
        at org.mule.routing.outbound.AbstractOutboundRouter.send(AbstractOutboundRouter.java:118)
        at org.mule.routing.outbound.FilteringOutboundRouter.route(FilteringOutboundRouter.java:66)
        at org.mule.routing.outbound.OutboundPassThroughRouter.route(OutboundPassThroughRouter.java:79)


So I am probably configuring this wrong... this is how I have done it:


<mule-descriptor name="AddCurve" implementation="com.pointcarbon.mule.comp.AddCurve">
<inbound-router>
<endpoint address="jms://GNGCurve" connector="jmsConnector" transformers="JMSMessageToObject">
<transaction factory="org.mule.providers.jms.JmsTransactionFactory" action="ALWAYS_BEGIN" />
</endpoint>
</inbound-router>
<exception-strategy className="com.pointcarbon.mule.exception.RollbackComponentExceptionStrategy" />
</mule-descriptor>


<mule-descriptor name="AddCurveWriteToDb" implementation="org.mule.components.simple.BridgeComponent">
<inbound-router>
<endpoint address="vm://AddCurveWriteToDb" synchronous="true">
<transaction factory="org.mule.providers.vm.VMTransactionFactory" action="NONE" />
</endpoint>
</inbound-router>
<outbound-router>
<router className="org.mule.routing.outbound.OutboundPassThroughRouter">
<endpoint address="jdbc://receivecurvetable" connector="dwJdbcConnector">
</endpoint>

</router>
</outbound-router>
</mule-descriptor>

Where the first UMO component (AddCurve) calls AddCurveWriteToDb with muleclient.


How can i configure the jdbc endpoint not to use the transaction?


And by the way Andrew, thanks for providing us with Mule! Keep up the good work.

Tor

Andrew Perepelytsya wrote
The error was correct, you were trying to mix different resources in the
same TX. Try plugging an extra bridge component in front of JDBC and use the
NONE attribute on this vm bridge.

Andrew

On Nov 13, 2007 6:31 AM, torarnek <torarnek@pvv.org> wrote:

>
>
> The monologue continues.. :)
>
> I have solved this issue by getting the connection from the connector's
> datasoure:
> Connection con = connector.getDataSource().getConnection();
>
> However, I am still trapped. Now the outbound JDBC endpoint seems to do
> the
> same, getConnection(), and it says:
>
> java.lang.RuntimeException: Could not bind connection to current
> transaction
> org.mule.providers.jdbc.JdbcConnector.getConnection(JdbcConnector.java
> :472)
>
> So I am within the transaction boundary of the JMS, and I would like to
> tell
> jdbc outbound jdbconnecor not to use transaction.
>
> I would assume that this would be done by adding the following to the
> inbound endpoint of the component  that has the oubound jdbc procedure
> call:
>
> <endpoint address="vm://AddCurveWriteToDb" synchronous="true">
>  <transaction factory="org.mule.providers.vm.VMTransactionFactory"
> action="NONE" />
> </endpoint>
>
> Is this right?  How can I make the JDBC enpoint not to join the
> transaction?
>
> Thanks,
>
> Tor
>
>
> torarnek wrote:
> >
> > Hey,
> >
> > I have located the problem, which is the JdbcConnector.getConnection()
> > call in my UMO component. It tries to the use the current transaction
> > which is the JmsTransacton.
> >
> > My code:
> >
> > JdbcConnector connector = (JdbcConnector) MuleManager.getInstance()
> >
> .lookupConnector("dwJdbcConnector");
> > Connection con = connector.getConnection();
> >
> > ArrayDescriptor des =
> > ArrayDescriptor.createDescriptor("TBL_T_JAVA_CURVE_DATA", con);
> > ARRAY a = new ARRAY(des, con, dbCurveList);
> > MuleClient client = new MuleClient();
> > UMOMessage result = client.send("vm://AddCurveWriteToDb",
> (Object)a,null);
> >
> >
> > So the question is how can I obtain a jdbc connection without involving
> > the transaction?
> >
> > Thanks!
> >
> > Tor
> >
> >
> >
> > torarnek wrote:
> >>
> >> Greetings fellow Mulers!
> >>
> >> I have a transacted inbound JMS with an UMO component that calls
> another
> >> component with muleclient.
> >>
> >> I want it to rollback if the connections fails, and this works fine
> when
> >> it calls a web service, but not when its using the jdbc connector.
> >>
> >> My exception is:
> >>
> >> java.lang.RuntimeException: Could not bind connection to current
> >> transaction
> >>         at
> >> org.mule.providers.jdbc.JdbcConnector.getConnection(JdbcConnector.java
> :472)
> >>         at com.pointcarbon.mule.comp.AddCurve.addCurve(AddCurve.java
> :59)
> >>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >>         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> >>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
> >> Source)
> >>         at java.lang.reflect.Method.invoke(Unknown Source)
> >>         at
> >> org.mule.impl.model.resolvers.DynamicEntryPoint.invokeMethod(
> DynamicEntryPoint.java:312)
> >>         at
> >> org.mule.impl.model.resolvers.DynamicEntryPoint.invoke(
> DynamicEntryPoint.java:259)
> >>         at
> >> org.mule.impl.DefaultLifecycleAdapter.intercept(
> DefaultLifecycleAdapter.java:194)
> >>         at
> >> org.mule.impl.InterceptorsInvoker.execute(InterceptorsInvoker.java:47)
> >>         at
> >> org.mule.impl.model.DefaultMuleProxy.onCall(DefaultMuleProxy.java:258)
> >>         at
> >> org.mule.impl.model.seda.SedaComponent.doSend(SedaComponent.java:393)
> >>         at
> >> org.mule.impl.model.AbstractComponent.sendEvent(AbstractComponent.java
> :418)
> >>         at org.mule.impl.MuleSession.sendEvent(MuleSession.java:349)
> >>         at
> >> org.mule.routing.inbound.InboundRouterCollection.send(
> InboundRouterCollection.java:197)
> >>         at
> >> org.mule.routing.inbound.InboundRouterCollection.route(
> InboundRouterCollection.java:163)
> >>         at
> >>
> org.mule.providers.AbstractMessageReceiver$DefaultInternalMessageListener.onMessage
> (AbstractMessageReceiver.java:581)
> >>         at
> >> org.mule.providers.AbstractMessageReceiver.routeMessage(
> AbstractMessageReceiver.java:322)
> >>         at
> >> org.mule.providers.AbstractReceiverWorker$1.doInTransaction(
> AbstractReceiverWorker.java:107)
> >>         at
> >> org.mule.transaction.TransactionTemplate.execute(
> TransactionTemplate.java:92)
> >>         at
> >> org.mule.providers.AbstractReceiverWorker.doRun(
> AbstractReceiverWorker.java:124)
> >>         at
> >> org.mule.providers.AbstractReceiverWorker.run(
> AbstractReceiverWorker.java:60)
> >>         at org.mule.impl.work.WorkerContext.run(WorkerContext.java:310)
> >>         at
> >>
> edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker
> (ThreadPoolExecutor.java:1061)
> >>         at
> >>
> edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run
> (ThreadPoolExecutor.java:575)
> >>         at java.lang.Thread.run(Unknown Source)
> >> Caused by: org.mule.transaction.IllegalTransactionStateException: Can
> >> only bind "javax.jms.Connection/javax.jms.Session" type reso
> >> urces
> >>         at
> >> org.mule.providers.jms.JmsTransaction.bindResource(JmsTransaction.java
> :36)
> >>         at
> >> org.mule.providers.jdbc.JdbcConnector.getConnection(JdbcConnector.java
> :468)
> >>         ... 25 more
> >>
> >>
> >> My config:
> >>
> >> <mule-descriptor name="AddCurve" implementation="xxx.AddCurve">
> >> <inbound-router>
> >> <endpoint address="jms://GNGCurve" connector="jmsConnector"
> >> transformers="JMSMessageToObject">
> >>   <transaction factory="org.mule.providers.jms.JmsTransactionFactory"
> >> action="ALWAYS_BEGIN" />
> >> </endpoint>
> >> </inbound-router>
> >> <exception-strategy className="xxx.RollbackComponentExceptionStrategy"
> />
> >> </mule-descriptor>
> >>
> >>
> >> <mule-descriptor name="AddCurveWriteToDb"
> >> implementation="BridgeComponent">
> >> <inbound-router>
> >>   <endpoint address="vm://AddCurveWriteToDb" synchronous="true"/>
> >> </inbound-router>
> >> <outbound-router>
> >> <router className="org.mule.routing.outbound.OutboundPassThroughRouter
> ">
> >>   <endpoint address="jdbc://receivecurvetable"
> >> connector="dwJdbcConnector" />
> >> </router>
> >> </outbound-router>
> >> </mule-descriptor>
> >>
> >>
> >>
> >> Any suggestions? :)
> >>
> >> Tor
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Issue-with-transactions-tf4791938.html#a13724170
> Sent from the Mule - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Issue with transactions

Andrew Perepelytsya
Did you try specifying NONE for tx action on JDBC outbound?
Reply | Threaded
Open this post in threaded view
|

Re: Issue with transactions

Tor Arne Kvaløy
Yes, I have tried this, but with no luck:

<endpoint address="jdbc://receivecurvetable" connector="dwJdbcConnector">
<transaction factory="org.mule.providers.jdbc.JdbcTransactionFactory" action="NONE" />
</endpoint>


hmm. I have even tried to read the source code, but I don't really understand how this action is picked up and used at all...  

The JdbcConnector.getConnection() always seem to get the Jms transaction...

And by the way, I am using 1.4.3-SNAPSHOT.


Getting this "basic stuff to work" is pretty critical for my client to continue this mule PoC I'm doing... ;)

Thanks!

Tor

Andrew Perepelytsya wrote
Did you try specifying NONE for tx action on JDBC outbound?
Reply | Threaded
Open this post in threaded view
|

Re: Issue with transactions

Andrew Perepelytsya
Please strip all the irrelevant info and file a jira, I may take a look later.

Andrew

On Nov 14, 2007 9:50 AM, torarnek <[hidden email]> wrote:

Yes, I have tried this, but with no luck:

<endpoint address="jdbc://receivecurvetable" connector="dwJdbcConnector">
<transaction factory="org.mule.providers.jdbc.JdbcTransactionFactory"
action="NONE" />
</endpoint>


hmm. I have even tried to read the source code, but I don't really
understand how this action is picked up and used at all...

The JdbcConnector.getConnection() always seem to get the Jms transaction...

And by the way, I am using 1.4.3-SNAPSHOT.


Getting this "basic stuff to work" is pretty critical for my client to
continue this mule PoC I'm doing... ;)

Thanks!

Tor


Andrew Perepelytsya wrote:
>
> Did you try specifying NONE for tx action on JDBC outbound?
>
>

--
View this message in context: http://www.nabble.com/Issue-with-transactions-tf4791938.html#a13747752
Sent from the Mule - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email