Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • 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
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

transaction commit ( or not? )

 
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 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.
 
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
      Number of slices to send:
      Optional 'thank-you' note:
    • 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
      Number of slices to send:
      Optional 'thank-you' note:
    • 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
      Number of slices to send:
      Optional 'thank-you' note:
    • 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.
     
    Ever since I found this suit I've felt strange new needs. And a tiny ad:
    the value of filler advertising in 2021
    https://coderanch.com/t/730886/filler-advertising
    reply
      Bookmark Topic Watch Topic
    • New Topic