Hallo Alexander,
> IIRC the JBoss transaction manager, which I used to check the
implementation,
> and the SAP Web AS always set the configured transaction timeout
before starting
> a transaction on an XA Resource ... so that's why I never bothered
with the
> default value too much ...
I havent managed to configure Jboss 3.2.6 to call setTransactionTimeout,
I think it does not support it. Have you tried Jboss 4.0? But even if
the method is invoked, I wonder why it is coded to return false.
So our patch involves adding a property to the xatimeout to
DataSourceSapDBBase and acessing it from within XAConnectionSapDB (both
com.sap.dbtech.jdbcext.*) and making the connection to return true.
Greetings
Bernd
Index: DataSourceSapDBBase.java
===================================================================
RCS file:
/var/cvs/Products/SAP/sapdbc_patch/src/java/com/sap/dbtech/jdbcext/DataS
ourceSapDBBase.java,v
retrieving revision 1.1
diff -u -r1.1 DataSourceSapDBBase.java
--- DataSourceSapDBBase.java 28 Jun 2005 11:07:31 -0000 1.1
+++ DataSourceSapDBBase.java 15 Jul 2005 14:26:26 -0000
@@ -45,6 +45,7 @@
public class DataSourceSapDBBase
{
public static final int DEFAULT_LOGINTIMEOUT=30;
+ public static final int DEFAULT_XATIMEOUT=30;
protected Properties connectProperties;
protected PrintWriter logWriter;
@@ -171,6 +172,24 @@
return "jdbc:sapdb://" + getServerName() + ":" + getPort() +
"/" + getDatabaseName();
}
+ public void setXATimeout(int xatimeout)
+ {
+
connectProperties.setProperty("xatimeout",Integer.toString(xatimeout));
+ }
+
+ public int getXATimeout()
+ {
+ String s=connectProperties.getProperty("xatimeout");
+ if(s == null) {
+ return DEFAULT_XATIMEOUT;
+ }
+ try {
+ return Integer.parseInt(s);
+ } catch(NumberFormatException numberFormatEx) {
+ return DEFAULT_XATIMEOUT;
+ }
+ }
+
private int portFromUrl(String url)
{
int slashPos;
@@ -428,6 +447,7 @@
result.add(new StringRefAddr("trace", getTrace()));
result.add(new StringRefAddr("tracesize", getTraceSize()));
result.add(new StringRefAddr("xatrace", getXATrace()));
+ result.add(new StringRefAddr("xatimeout", getXATimeout()));
return result;
}
}
Index: XAConnectionSapDB.java
===================================================================
RCS file:
/var/cvs/Products/SAP/sapdbc_patch/src/java/com/sap/dbtech/jdbcext/XACon
nectionSapDB.java,v
retrieving revision 1.1
diff -u -r1.1 XAConnectionSapDB.java
--- XAConnectionSapDB.java 28 Jun 2005 11:07:31 -0000 1.1
+++ XAConnectionSapDB.java 15 Jul 2005 14:27:55 -0000
@@ -62,8 +62,7 @@
this.trace=trace;
this.nonTxConnection=null;
this.currentTransaction=null;
- this.transactionTimeout = 30;
+ this.transactionTimeout = ds.getXATimeout();
}
boolean isTraceEnabled()
@@ -366,9 +365,9 @@
xaerror(null,XAException.XAER_INVAL);
}
this.transactionTimeout=transactionTimeout;
- return false;
+ return true;
}
//----------------------------------------------------------------------
void sendErrorEvent(SQLException sqlEx)
{
--
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]