I did the following in the flow:
- start Transaction
- SQL service to call stored procedure
- rollback Transaction (if stored procedure returns error)
The flow service completed successfully but there’s an error log like this:
2003-06-12 16:15:30 GMT+07:00 pub.art.transaction:rollbackTransaction [SCC.0121.0026E] delisted transaction commit failed: javax.transaction.RollbackException: Already marked for rollback xid = server-webmethods/1055404280974 Stack trace data … a2411cd24a8c16bcf5914d5305 NULL a2411cd24a8c16bcf5914d5305
Anybody knows what does that mean ?
The Flow finished but are you sure it was successful? For example, did your stored procedure perform as expected?
To get a better handle on your error, step through your Flow using F7. After stepping over the stored procedure step (step #2 in your post), look at the Results tab in Developer. Make sure that there re no strange values in there that may indicate a problem.
If everything looks normal, try taking a (small) screenshot and uploading it to your next post. This forum allows for images of 500x400 pixels and less than 30k. You could also try using a BMP and zipping it up.
Being able to see what you see may help somebody to debug with you.
I couldn’t perform a step-thru on startTransaction service as it showed error. Pls see the error message in the screenshot.
If I run the service, it completed successfully. No strange values. The insert statement also rollback successfully.
It’s just the server error log the error messages shown in my previous post.
BTW, the transaction type for my jdbc connection is LOCAL_TRANSACTION.
In JDBCAdapter for insert operation,There is no need of
calling startTransaction,RollbackTransaction operations.Internally
JDBC Adapter take care of.Try only call insert service only.
For Calling storedProcedure also JDBC Adapter internally take
care of(wmART).No need to call startTransaction,RollbackTransaction
like in wmDB Adapter.
Thanks for the reply.
If I want to rollback a transaction based on the return value from the stored procedure, how should I do?
For example, the service internally loop 5 times to call a stored procedure, stored procedure processes the first 2 looping successfully but returns value to indicate error on the 3rd looping, how should I do to rollback the first 2 calls?
I think you used startTransaction from WmART package,pub.art.transaction:startTrasaction.It input is transactionName
inside startTransactionInput document.So you have to setup any name
like alias for trasactionName.You have to setvalue(hardcoded).Pass
this value to trasactionName string in rollbackTransaction service.
I think this will work.Otherwise you can use wmDB package.
Yes, that’s exactly what I do. Unfortunately the error message appeared in the error log even though the transaction has been rolled back successfully.
That message only indicates that you have a exception in your stored procedure and the IS server executes a rollback. However, there is nothing wrong with it.
However, we are also have problems to trace services(F7) when we use a startTransaction service inside.Did you solve your problem finally?.
I’m a WebMetohd’s newbie. I’ve already configured a JDBC connection, and an adapter service to insert in my Oracle Database. However, I have no idea how I’m suposed to control the transaction of my JDBCAdapter service. How I’m supposed to rollback if one of the lines is incorrect? I must use a TRY-CATCH sequence?
Thanks in advance,
Ignasi If you used NO TRANSACTION in your JDBC connection setting you do not have control over this. your transaction will be commited automatically after every executionas as well as it will be rolled back if error occures. This is using default autocommit of standard JDBC Api. If you use LOCAL TRANSACTION setting that you have some control using commiTransaction rollbackTransaction built in services
Now I’m using LOCAL_TRANSACTION. But I’m having some kind of problems related with an insert opertion. The first time I try to insert in my DB it works fine (and quick), but when I try to insert a record again, it doesn’t seem to do anything. If I take a look at the Transaction page in the Terminal Services Client, I can see that my main flow has been invoked, but nothing more happens. Does anybody know what’s happening?
If it helps, I’m using an adapter service (InsertSQL pattern), and without ant transaction management.
Thanks in advance,
I’m working with JDBCAdapter, and all I’m doing with the DB are inserts and updates. I’m supposed to use the wmART.pub.art packacge to manage the transactions, or are internally checked?
It’s necessary in the case that I musn’t perform one action depending of the result of one update done before?
Thanks in advance,
When you use LOCAL_TRANSACTION it is mandatory to have a start/commit/rollback trans that’s in WmART.pub.art.transaction. Once you implement this in your service, it should be fine.
Please let us know how your service responds after implementing this.
One question…are both the services (insert / update ) to the same connection or different db connections?
Thanks, my problem with the transaction is now solved. But I’m still having problems with my service.
I think I’ve finally been able to determinate what’s going wrong with my JDBC adapter service. The tables where I’m trying to insert don’t have primary key (instead of this, a unique index is used). If I insert a record and then erase it, when afterwards I try to insert again the same record my service generates an infinite loop, and doesn’t seem to finish.
Does anyone knows if this can be solved without modifying my tables definitions?
Thanks in advance,