You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by membersound <me...@web.de> on 2012/10/16 22:19:55 UTC

Transaction has timed out - how to set the server timeout?

Hi,

how can I set the Server timeout to not get a "Transaction has timed out"
exception any more?

Problem is as follows: I have a JAX-WS Webservice and a client. The client
may call a method from WS, but this method may sometimes last very long
(1h+). I want the connection to be keept alive during the method processing,
because the return value depends on the long routine and has to be given
back to the client.

I'm sure this is a server-side problem. Because on client-side, I already
tried several things like BindingProvider or setting HTTPConduit manually,
like:

((BindingProvider)port).getRequestContext().put("com.sun.xml.internal.ws.request.timeout",
0);
or:
Client client = ClientProxy.getClient(greeter);
HTTPConduit http = (HTTPConduit) client.getConduit();
HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
httpClientPolicy.setConnectionTimeout(0); 
http.setClient(httpClientPolicy);


Please can anybody help how I can keep an invoked method request alive for a
long time until the return response is send?

Thanks




--
View this message in context: http://openejb.979440.n4.nabble.com/Transaction-has-timed-out-how-to-set-the-server-timeout-tp4658090.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Transaction has timed out - how to set the server timeout?

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi,

you can configure the transaction manager timeout (in tomee.xml) but it
means your tx lasts more than 10mn (default)

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*




2012/10/16 membersound <me...@web.de>

> Hi,
>
> how can I set the Server timeout to not get a "Transaction has timed out"
> exception any more?
>
> Problem is as follows: I have a JAX-WS Webservice and a client. The client
> may call a method from WS, but this method may sometimes last very long
> (1h+). I want the connection to be keept alive during the method
> processing,
> because the return value depends on the long routine and has to be given
> back to the client.
>
> I'm sure this is a server-side problem. Because on client-side, I already
> tried several things like BindingProvider or setting HTTPConduit manually,
> like:
>
>
> ((BindingProvider)port).getRequestContext().put("com.sun.xml.internal.ws.request.timeout",
> 0);
> or:
> Client client = ClientProxy.getClient(greeter);
> HTTPConduit http = (HTTPConduit) client.getConduit();
> HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
> httpClientPolicy.setConnectionTimeout(0);
> http.setClient(httpClientPolicy);
>
>
> Please can anybody help how I can keep an invoked method request alive for
> a
> long time until the return response is send?
>
> Thanks
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Transaction-has-timed-out-how-to-set-the-server-timeout-tp4658090.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Transaction has timed out - how to set the server timeout?

Posted by Romain Manni-Bucau <rm...@gmail.com>.
sorry didnt get your answer

well if you can reproduce your issue in a simple maven project we could
have a deeper look

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*




2012/10/22 membersound <me...@web.de>

> As well I set the timeout to 2 minutes, and it does NOT result in a
> transaction timeout exception after this time!
> So I could probably assume: yes, it is not called.
>
> Just to make sure my tomee.xml looks correct:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <tomee>
>
> <TransactionManager type="javax.transaction.TransactionManager">
>       defaultTransactionTimeoutSeconds = 2 minutes
> </TransactionManager>
>
> <Container id="My Singleton Container" type="SINGLETON">
> ...
>
> OK?
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Transaction-has-timed-out-how-to-set-the-server-timeout-tp4658090p4658204.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Transaction has timed out - how to set the server timeout?

Posted by membersound <me...@web.de>.
As well I set the timeout to 2 minutes, and it does NOT result in a
transaction timeout exception after this time!
So I could probably assume: yes, it is not called.

Just to make sure my tomee.xml looks correct:

<?xml version="1.0" encoding="UTF-8"?>
<tomee>

<TransactionManager type="javax.transaction.TransactionManager">
      defaultTransactionTimeoutSeconds = 2 minutes
</TransactionManager>

<Container id="My Singleton Container" type="SINGLETON">
...

OK?



--
View this message in context: http://openejb.979440.n4.nabble.com/Transaction-has-timed-out-how-to-set-the-server-timeout-tp4658090p4658204.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Transaction has timed out - how to set the server timeout?

Posted by Romain Manni-Bucau <rm...@gmail.com>.
are you sure setTransactionTimeout is not called on the usertransaction?

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*




2012/10/22 membersound <me...@web.de>

> I set the timeout to several values, like 200 or 200000. But unfortunately
> there's still the transaction timeout exception! So this does not change
> anything :(
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Transaction-has-timed-out-how-to-set-the-server-timeout-tp4658090p4658195.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Transaction has timed out - how to set the server timeout?

Posted by membersound <me...@web.de>.
I set the timeout to several values, like 200 or 200000. But unfortunately
there's still the transaction timeout exception! So this does not change
anything :(



--
View this message in context: http://openejb.979440.n4.nabble.com/Transaction-has-timed-out-how-to-set-the-server-timeout-tp4658090p4658195.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Transaction has timed out - how to set the server timeout?

Posted by Romain Manni-Bucau <rm...@gmail.com>.
in tomee.xml:


<TransactionManager type="javax.transaction.TransactionManager">
      defaultTransactionTimeoutSeconds = 10 minutes

      # When set to true, Howl logging is enabled
      TxRecovery false

      # Requires TxRecovery
      bufferSizeKb 32

      # Requires TxRecovery
      checksumEnabled true

      # Requires TxRecovery
      adler32Checksum true

      # Requires TxRecovery
      flushSleepTime 50 Milliseconds

      # Requires TxRecovery
      logFileDir txlog

      # Requires TxRecovery
      logFileExt log

      # Requires TxRecovery
      logFileName howl

      # Requires TxRecovery
      maxBlocksPerFile -1

      # Requires TxRecovery
      maxBuffers 0

      # Requires TxRecovery
      maxLogFiles 2

      # Requires TxRecovery
      minBuffers 4

      # Requires TxRecovery
      threadsWaitingForceThreshold -1
</TransactionManager>


*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*




2012/10/19 membersound <me...@web.de>

> Where exactly do I have to specify this? I cannot see any properties
> refering
> to a transaction timeout configuration in tomee.xml.
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Transaction-has-timed-out-how-to-set-the-server-timeout-tp4658090p4658160.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Transaction has timed out - how to set the server timeout?

Posted by membersound <me...@web.de>.
Where exactly do I have to specify this? I cannot see any properties refering
to a transaction timeout configuration in tomee.xml.



--
View this message in context: http://openejb.979440.n4.nabble.com/Transaction-has-timed-out-how-to-set-the-server-timeout-tp4658090p4658160.html
Sent from the OpenEJB User mailing list archive at Nabble.com.