Tansaction Code Hanging

I am building a VB.NET web service connecting to Tamino 4.1.4 using the API.

The following function works if I use autocommit (and comment ou the BeginTransaction) but with LocalTransaction, it hangs (though the data is wrtieen to tamino, and even if I do a stop of the database using roll-back the data is still in tamino).

(Sorry for the lack for formatting, it seems your input removes the tabs that make the code easier to follow.)

<WebMethod()> Public Function SaveDynaFormDoc(ByVal TaminoDB As String, ByVal strCollection As String, ByVal strXML As String) As String
Dim tConn As TaminoConnection
Dim tCom As TaminoCommand
Dim tDom As TaminoDocument
Dim tTran As TaminoTransaction
Dim tResponse As TaminoResponse
Dim strError As String
Dim oDom As New Xml.XmlDocument
Dim tPref As New TaminoPreference
Dim tUser As New TaminoUserInfo("", “”)
tDom = New TaminoDocument(oDom)
tPref.NonActivityTimeout = 20
tPref.TransactionTimeout = 20
tConn = New TaminoConnection(TaminoDB, tUser, tPref)
tCom = tConn.CreateCommand(strCollection)
Catch ex As Exception
strError = String.Concat("Unexpected error connecting to Tamino. ;; Error_Message: ", ex.Message, Constants.vbCrLf, " ;; Stack_Trace: ", ex.StackTrace)
Return String.Concat(“Fail: Standard Exception,”, strError)
End Try
tTran = tConn.BeginTransaction()
tResponse = tCom.Insert(tDom)
If Not tResponse.ReturnValue = “0” Then
strError = tResponse.ErrorText
If tConn.IsInTransaction Then
End If
Return String.Concat("Fail: ", strError)
If tConn.IsInTransaction Then
End If
Return "Success " & tResponse.ReturnValue
End If
Catch tExcp As TaminoException
strError = String.Concat("A WebException has been caught. ", tExcp.ToString(), tExcp.TargetSite.Name)
If tConn.IsInTransaction Then
End If
Return String.Concat(“Fail: Tamino Exception,”, strError)
Catch webExcp As WebException
strError = String.Concat("A WebException has been caught. ", webExcp.ToString())
Dim status As WebExceptionStatus = webExcp.Status
’ If status is WebExceptionStatus.ProtocolError,there has been a protocol error and a WebResponseshould exist. Display the protocol error.
If status = WebExceptionStatus.ProtocolError Then
strError = strError & "The server returned protocol error "
’ Get HttpWebResponse so that you can check the HTTP status code.
Dim httpResponse As HttpWebResponse = CType(webExcp.Response, HttpWebResponse)
strError = String.Concat(“Unexpected error executing transaction.”, strError, Int(httpResponse.StatusCode).ToString(), " - ", httpResponse.StatusCode.ToString())
End If
If tConn.IsInTransaction Then
End If
Return String.Concat(“Fail: Web Exception,”, strError)
Catch ex2 As Exception
strError = String.Concat("Unexpected error executing transaction. ;; Error_Message: ", ex2.Message, Constants.vbCrLf, " ;; Stack_Trace: ", ex2.StackTrace)
If tConn.IsInTransaction() Then
End If
Return String.Concat(“Fail: Standard Exception,”, strError)
End Try

End Function

The following (equivalent?) C# works for me - I used the CODE layout brackets button. If you use larger timeouts (e.g. 60) does that make any difference?

TaminoUserInfo    userInfo   = new TaminoUserInfo("", "");

TaminoPreference  preference = new TaminoPreference();
preference.TransactionTimeout = 20;
preference.NonActivityTimeout = 20;

// create connection
TaminoConnection connection = new TaminoConnection(URL, userInfo, preference);

// open connection

// begin transaction
TaminoTransaction transaction = connection.BeginTransaction();

// create command for test collection
TaminoCommand command = connection.CreateCommand(COLLECTION);

// create test document
XmlDocument xmlDoc = new XmlDocument();
TaminoDocument doc = new TaminoDocument(xmlDoc);
doc.DocName = "SimpleInsertTimeout";

// insert test document
TaminoResponse response = command.Insert(doc);
if (response.ReturnValue != "0") Console.WriteLine("Insert failed: "+response.ErrorText);

// rollback

// close connection
if (connection != null) connection.Close();

[This message was edited by Mark Kuschnir on 08 Sep 2003 at 11:59.]

[This message was edited by Mark Kuschnir on 09 Sep 2003 at 07:41.]

Is the code hanging on the Close method? Or another method?

One question I have on your code, you are not using Commit() or RollBack() this seems like it would cause the transaction to timeout.

Also I have code to handle errors that might occur in object execution, I have found this essecial in the past in dealing with transactions within Tamino (as in the past I found if they are not Rolled back they can lock the database and or schemas).

I added the more restrictive timeouts after the service went out to lunch for very extended periods of time.

Oh just as FYI I am Larry, last night I could not find my previous userid as so I re-registered.


I added code to do a Rollback. When I run this it works and there is no document in the database as expected. If I use Commit instead then I get a document in the database as expected.

When you say that you made the timeouts more restrictive because the “service went out to lunch” what does that mean? Did you get a WebException “operation timed out”?

Yes I am getting Operation Timed Out.

And it seems to be the the Close() operation that is cuasing the difficulty.

Here is a sample:
System.Net.WebException: The operation has timed-out. at SoftwareAG.Tamino.Api.Common.Command.Execute() at SoftwareAG.Tamino.Api.TaminoConnection.Close() at TaminoConnect.TaminoConnect.SaveDynaFormDoc(String TaminoDB, String strCollection, String strXML) in c:\inetpub\wwwroot\TaminoConnect\TaminoConnect.asmx.vb:line 110

We used to get this in our automated test suites if we had forgotten to do cleanup (i.e. TaminoConnection.Close() calls). It seemed to be indicative of running out of system resources such as streams.

Does this happen immediately or after a number of runs? Which TaminoAPI.dll are you using? You can check using Properties->Version from Windows Explorer.