From: Juergen H. <jho...@us...> - 2008-10-20 14:26:12
|
Update of /cvsroot/springframework/spring/src/org/springframework/transaction/jta In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv6973/src/org/springframework/transaction/jta Modified Files: JotmFactoryBean.java Log Message: JotmFactoryBean sets "defaultTimeout" value as actual JOTM default (even if no transaction timeout specified at all) Index: JotmFactoryBean.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/transaction/jta/JotmFactoryBean.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** JotmFactoryBean.java 31 Dec 2006 19:55:43 -0000 1.14 --- JotmFactoryBean.java 20 Oct 2008 14:25:58 -0000 1.15 *************** *** 1,4 **** /* ! * Copyright 2002-2006 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); --- 1,4 ---- /* ! * Copyright 2002-2008 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); *************** *** 18,21 **** --- 18,22 ---- import javax.naming.NamingException; + import javax.transaction.SystemException; import org.objectweb.jotm.Current; *************** *** 26,31 **** /** ! * FactoryBean that retrieves the JTA UserTransaction/TransactionManager for ! * ObjectWeb's <a href="http://jotm.objectweb.org">JOTM</a>. Will retrieve * an already active JOTM instance if found (e.g. if running in JOnAS), * else create a new local JOTM instance. --- 27,32 ---- /** ! * {@link FactoryBean} that retrieves the JTA UserTransaction/TransactionManager ! * for ObjectWeb's <a href="http://jotm.objectweb.org">JOTM</a>. Will retrieve * an already active JOTM instance if found (e.g. if running in JOnAS), * else create a new local JOTM instance. *************** *** 105,110 **** --- 106,120 ---- public void setDefaultTimeout(int defaultTimeout) { this.jotmCurrent.setDefaultTimeout(defaultTimeout); + // The following is a JOTM oddity: should be used for demarcation transaction only, + // but is required here in order to actually get rid of JOTM's default (60 seconds). + try { + this.jotmCurrent.setTransactionTimeout(defaultTimeout); + } + catch (SystemException ex) { + // should never happen + } } + /** * Return the JOTM instance created by this factory bean, if any. *************** *** 116,120 **** } - public Object getObject() { return this.jotmCurrent; --- 126,129 ---- |