You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by mayo <al...@hotmail.com> on 2009/05/28 18:59:56 UTC

setting default transaction timeout

I've been searching through the mailing list and google, but can't find if
there is a default transaction timeout for OFBiz.  I have read that I should
set my system's "SO".  I googled on this and there was little help.  Does
OFBiz 4.0 use this system SO as its default timeout value?  If so, can
someone point me in the right direction for setting it for Linux?

-- 
View this message in context: http://www.nabble.com/setting-default-transaction-timeout-tp23765847p23765847.html
Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: setting default transaction timeout

Posted by mayo <al...@hotmail.com>.
Is this the linux value I need to change?

http://thedaneshproject.com/posts/how-to-set-default-session-timeout-in-linux/

echo "TMOUT=300 >> /etc/bashrc

-- 
View this message in context: http://www.nabble.com/setting-default-transaction-timeout-tp23765847p23765878.html
Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: setting default transaction timeout

Posted by Jacques Le Roux <ja...@les7arts.com>.
For the embedded Geronimo it's set à 60 seconds
see DBCPConnectionFactory.java[96]
http://commons.apache.org/dbcp/apidocs/org/apache/commons/dbcp/BasicDataSource.html#setTimeBetweenEvictionRunsMillis(long)

Jacques

From: "mayo" <al...@hotmail.com>
>
> I've been searching through the mailing list and google, but can't find if
> there is a default transaction timeout for OFBiz.  I have read that I should
> set my system's "SO".  I googled on this and there was little help.  Does
> OFBiz 4.0 use this system SO as its default timeout value?  If so, can
> someone point me in the right direction for setting it for Linux?
>
> -- 
> View this message in context: http://www.nabble.com/setting-default-transaction-timeout-tp23765847p23765847.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>



Re: setting default transaction timeout

Posted by Jacques Le Roux <ja...@les7arts.com>.
While I was working on a related issue, I found this idea in Neogia.

They added this snippet
// Begin neogia specific : FR1417354 add a way to setup default transaction timeout globally
else {
    Debug.logVerbose("[TransactionUtil.begin] set default transaction timeout to : " + 
EntityConfigUtil.getDefaultTransactionTimeout() +
    " seconds", module);
    ut.setTransactionTimeout(EntityConfigUtil.getDefaultTransactionTimeout());
}
// End neogia specific : FR1417354 add a way to setup default transaction timeout globally

just after this block

// set the timeout for THIS transaction
if (timeout > 0) {
    ut.setTransactionTimeout(timeout);
    Debug.logVerbose("[TransactionUtil.begin] set transaction timeout to : " + timeout + " seconds", module);
}

in TransactionUtil.java

They use their EntityConfigUtil class for that, but as a test you could simply get the timeout data from a properties file...

HTH

Jacques

From: "mayo" <al...@hotmail.com>
> Thanks for the information guys.  This was very good help.  I ended up
> setting the transactiontimeout for the particular services that were timing
> out and it worked great.  I am still interested in the default value and
> will look into what you suggested David.  Thanks for the quick responses.
>
>
>
> David E Jones-3 wrote:
>>
>>
>> Actually, neither of those are the transaction timeout, those are just
>> connection pool management settings.
>>
>> As for where to configure it now... I'm disappointed to say that it
>> isn't configurable anymore (maybe it never was, but I thought it was a
>> long time ago).
>>
>> In general you can specify a transaction timeout period when beginning
>> a transaction. In OFBiz this is mostly done on service definitions
>> since that is where most transactions are begun. If no timeout value
>> is specified, then the default setup in the transaction manager is used.
>>
>> In the current code base the default value is set in the
>> GeronimoTransactionFactory.defaultTransactionTimeoutSeconds variable,
>> which is passed into the GeronimoTransactionManager object when it is
>> created.
>>
>> In older code, like 4.0, it is set differently. The easiest way to
>> find it is still to look at the *TransactionFactory class that is
>> referred to in the entityengine.xml file (near the top) and see how
>> the default is set.
>>
>> -David
>>
>>
>> On May 28, 2009, at 2:06 PM, Jacques Le Roux wrote:
>>
>>> Mmm, too quick... Actually it seems to be 120 seconds and set by
>>> pool.setMaxWait(120000);
>>> I was abused by the OFBiz documentation which says that it's 60
>>> seconds and saw after that in
>>> pool.setTimeBetweenEvictionRunsMillis(600000); it's actually 10
>>> mins...
>>> The doc is here http://commons.apache.org/dbcp/configuration.html
>>> Jacques
>>>
>>> From: "Jacques Le Roux" <ja...@les7arts.com>
>>>> For the embedded Geronimo it's set à 60 seconds
>>>> see DBCPConnectionFactory.java[96]
>>>> http://commons.apache.org/dbcp/apidocs/org/apache/commons/dbcp/BasicDataSource.html#setTimeBetweenEvictionRunsMillis(long)
>>>>
>>>> Jacques
>>>>
>>>> From: "mayo" <al...@hotmail.com>
>>>>>
>>>>> I've been searching through the mailing list and google, but can't
>>>>> find if
>>>>> there is a default transaction timeout for OFBiz.  I have read
>>>>> that I should
>>>>> set my system's "SO".  I googled on this and there was little
>>>>> help.  Does
>>>>> OFBiz 4.0 use this system SO as its default timeout value?  If so,
>>>>> can
>>>>> someone point me in the right direction for setting it for Linux?
>>>>>
>>>>> -- 
>>>>> View this message in context:
>>>>> http://www.nabble.com/setting-default-transaction-timeout-tp23765847p23765847.html
>>>>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>>>>
>>>>
>>>
>>>
>>
>>
>>
>
> -- 
> View this message in context: http://www.nabble.com/setting-default-transaction-timeout-tp23765847p23771011.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>
>



Re: setting default transaction timeout

Posted by mayo <al...@hotmail.com>.
Thanks for the information guys.  This was very good help.  I ended up
setting the transactiontimeout for the particular services that were timing
out and it worked great.  I am still interested in the default value and
will look into what you suggested David.  Thanks for the quick responses.



David E Jones-3 wrote:
> 
> 
> Actually, neither of those are the transaction timeout, those are just  
> connection pool management settings.
> 
> As for where to configure it now... I'm disappointed to say that it  
> isn't configurable anymore (maybe it never was, but I thought it was a  
> long time ago).
> 
> In general you can specify a transaction timeout period when beginning  
> a transaction. In OFBiz this is mostly done on service definitions  
> since that is where most transactions are begun. If no timeout value  
> is specified, then the default setup in the transaction manager is used.
> 
> In the current code base the default value is set in the  
> GeronimoTransactionFactory.defaultTransactionTimeoutSeconds variable,  
> which is passed into the GeronimoTransactionManager object when it is  
> created.
> 
> In older code, like 4.0, it is set differently. The easiest way to  
> find it is still to look at the *TransactionFactory class that is  
> referred to in the entityengine.xml file (near the top) and see how  
> the default is set.
> 
> -David
> 
> 
> On May 28, 2009, at 2:06 PM, Jacques Le Roux wrote:
> 
>> Mmm, too quick... Actually it seems to be 120 seconds and set by  
>> pool.setMaxWait(120000);
>> I was abused by the OFBiz documentation which says that it's 60  
>> seconds and saw after that in  
>> pool.setTimeBetweenEvictionRunsMillis(600000); it's actually 10  
>> mins...
>> The doc is here http://commons.apache.org/dbcp/configuration.html
>> Jacques
>>
>> From: "Jacques Le Roux" <ja...@les7arts.com>
>>> For the embedded Geronimo it's set à 60 seconds
>>> see DBCPConnectionFactory.java[96]
>>> http://commons.apache.org/dbcp/apidocs/org/apache/commons/dbcp/BasicDataSource.html#setTimeBetweenEvictionRunsMillis(long)
>>>
>>> Jacques
>>>
>>> From: "mayo" <al...@hotmail.com>
>>>>
>>>> I've been searching through the mailing list and google, but can't  
>>>> find if
>>>> there is a default transaction timeout for OFBiz.  I have read  
>>>> that I should
>>>> set my system's "SO".  I googled on this and there was little  
>>>> help.  Does
>>>> OFBiz 4.0 use this system SO as its default timeout value?  If so,  
>>>> can
>>>> someone point me in the right direction for setting it for Linux?
>>>>
>>>> -- 
>>>> View this message in context:
>>>> http://www.nabble.com/setting-default-transaction-timeout-tp23765847p23765847.html
>>>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>>>
>>>
>>
>>
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/setting-default-transaction-timeout-tp23765847p23771011.html
Sent from the OFBiz - User mailing list archive at Nabble.com.