• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

transaction rollback or commit

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello to everybody...I'd need a solution for a probem that I 'm not able to resolve.I have a session bean on the server ( WeblogicServer 8.1 Sp3 ) and a Java Swing client.I need to break and rollback a long process on the server by client swing button pression.I have thought to create a user transaction (under a client thread process) on the client and I try to propagate it to the container ( Container Managed Transaction).Now I have to break the long time server operation at certain moment by make a rollback on the client trasaction,after the button pression.The problem is that the rollback DOES NOT ARRIVE to the server and the sever process continue to operate.How this is possible?I think that I make basic mistake,but which?Can Anyone help me please?
thanks for help and sorry for bad english.
 
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is almost always poor practice to start a transaction from a remote client like yours. What you need to do is ascertain why the transaction is taking so long. For instance, are you running inefficient SQL? Or do you have a method in a transaction which need not be in a transaction, eg it is only reading data from a database in response to a client retrieval request.
 
mickey hendrix
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
whaqt I need to do is to break and rollback the transaction ( REQUIRED on the container ) by the client when I want....Whit this prototipe now I try to pass the transaction rollback operation from the client to the server,bt now the message on the server is the following:

java.sql.SQLException: The transaction is no longer active - status: 'Marked rollback. [Reason=weblogic.transaction.internal.TimedOutException: Transaction timed out after 33 seconds

Xid=BEA1-00006D5145365E026810(6407574),Status=Active,numRepliesOwedMe=0,numRepliesOwedOthers=1,seconds since begin=33,seconds left=30,activeThread=Thread[ExecuteThread: '23' for queue: 'weblogic.kernel.Default',5,Thread Group for Queue: 'weblogic.kernel.Default'],XAServerResourceInfo[weblogic.jdbc.wrapper.JTSXAResourceImpl]=(ServerResourceInfo[weblogic.jdbc.wrapper.JTSXAResourceImpl]=(state=started,assigned=none),xar=weblogic.jdbc.wrapper.JTSXAResourceImpl@f30862,re-Registered = false),SCInfo[mydomain+IRMA_Admin]=(state=active),properties=({weblogic.jdbc=t3://10.2.1.16:10004}),CoordinatorURL=IRMA_Admin+10.2.1.16:10004+mydomain+t3+)]'. No further JDBC access is allowed within this transaction.

at weblogic.jdbc.wrapper.JTSConnection.checkIfRolledBack(JTSConnection.java:155)

at weblogic.jdbc.wrapper.JTSConnection.checkConnection(JTSConnection.java:164)

at weblogic.jdbc.wrapper.Statement.checkStatement(Statement.java:234)

at weblogic.jdbc.wrapper.Statement.preInvocationHandler(Statement.java:83)

at weblogic.jdbc.wrapper.Statement_oracle_jdbc_driver_T4CStatement.clearBatch(Unknown Source)

at irma.utility.database.DataBaseUtility.executeBatchUpdate(DataBaseUtility.java:62)

at irma.technology.IrmaTechno.updateDBData(IrmaTechno.java:1077)

at irma.business.service.ImportService.importFileEricsson(ImportService.java:698)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:324)

at irma.business.Dispatcher.callService(Dispatcher.java:66)

at irma.ejb.serviceSessionManager.ServiceSessionManagerBean.getService(ServiceSessionManagerBean.java:67)

at irma.ejb.serviceSessionManager.ServiceSessionManager_b1engw_EOImpl.getService
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You cannot do what you are attempting. You need to ascertain why the transaction is taking too long.
 
mickey hendrix
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the transaction is long because the server process is long,but this is right.The problem is:How can I interrupt and rollback a server transaction
by the client?
 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I understand your problem, if server takes too much time for process your request, How you will cancel the previous request.

At this time you don't have any control because you can't attempt your EJB methos in asynchronous way.


The real solution of this problem is asynchronous processing. But it might be possible that it's not suitable in your case.

First one
If you are making any jdbc call to Oracle, then you can set the query time out whn you execute the query on database.
And after query timeout, Oracle will give you an exception that you can handle it.
So basically in this case you are not cancelling your EJB request actually.
But it might solve your problem.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic