• 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

data visibility across weblogic pool connection and JDBC connection

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I have a user managed transaction.
I am inserting a record in database using a weblogic connection (ejbCreate method of CMP Bean).
In the same transaction, I open a JDBC connection from the same class.
I am trying to access the records inserted using the weblogic connection through the JDBC connection.
I am not able to view the records in the JDBC connection.
Is there a way to make the data visible to the JDBC connection as well.
Following is the pseudocode of what I am doing:
Begin User Transaction;
Call ejbCreate() method of CMP Bean (Insert record in database);
Open JDBC connection(user name, password, driver, datasource);
read record from database using JDBC connection
(This read does not return the inserted data through ejbCreate())
End User Transaction;

Thanks,
Pranav
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Granted, this is a weblogic specific problem and should PROBABLY be in the Weblogic board, but I'm guessing that the problem is the EJB has not committed to the database at all because the write is in the same transction as the JDBC statement, and thus the ejbStore() method won't be called until the transaction ends.
Why do you feel you have to do things in this way? Can't you just get the data from the Entity bean rather than going to the database?
Kyle
 
Pranav Singh
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need to return an array of database objects from the database to java. Thats why I am using JDBC connection as it is not possible to do so through weblogic connection.
 
I'm all tasted up for a BLT! This tiny ad wants a monte cristo!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic