Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

transaction commit ( or not? )  RSS feed

 
mickey hendrix
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello to everybody,I have a problem with DataBase data visibility after the end of the operation.
I have deployed a stateless session bean with the transaction attribute set to REQUIRED:The trasaction is of CONTaINER type.
When I call an ejb service this take the connection from a ConnectionPool ( DRIVERS Oracle 9.2 THIS ) and it insert multiple rows into the database:the problem is that I can see the data
written from other sessions,also if I stop the client ( JSwing ).The only possible way is to stop the server:after this the data become visible.
How is this possible?Can anyone help me?
thanks for all and sorry for bad english.
 
Valentin Tanase
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mickey,

Let me see if I got you right: you have this SLSB that has the tx attribute = REQUIRED. Some client calls the bean in order to insert several rows into the database and the operation succeeds. On the other hand your Swing clients cannot see the data, unless the ejb server is restarted. Is that true?
Whether my assumption is right or wrong let�s firs eliminate the obvious:
  • By any chances, does the client (or other server component) start the transaction?
  • Does the transaction always succeed (you might check the log files for that)?
  • Is there any place in your code that could rollback the transaction inadvertently?
  • Is it possible to have set different transaction attributes at the bean vs method level? (the one at the method level takes precedence)


  • Here by transaction I mean the insert operation.
    Regards.
     
    mickey hendrix
    Greenhorn
    Posts: 19
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    I can't see the data not by the swing client......I see them from the application.I don't see them from external application like SqlPlus,TOAD....etc.I answer to your question:
    1)The transaction has started by the Weblogic Container
    2)Yes
    3)No

    4)what do you mean for method level?

    thanks for help
     
    Valentin Tanase
    Ranch Hand
    Posts: 704
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator

    4)what do you mean for method level?

    Something like this:

    Of course there is a slightly chance this to be the problem, but is better to check first :-)
    Basically you have RMI clients (using Swing) that talks to your bean. They make only RMI calls to your bean, the container starts the transaction calls the bean's method, commits the transaction and returns. No other components involved, isn't it? Your extenal tools cannot see these changes, which of course makes the point that the transaction actually never commits. Does your bean return the connection to the pool (closing the connection in a finally block eventually)?
    Regards.
     
    mickey hendrix
    Greenhorn
    Posts: 19
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    the problem was the DataSource:
    I had not created it in transactional mode ( Honor Global Transaction ).Now it works.
    thanks for help.Bye.
     
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!