Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Help coderanch get a
new server
by contributing to the fundraiser

Mark Savory

Ranch Hand
+ Follow
since Feb 08, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Mark Savory

Ok I see how that would show that there are two transactions. That's a good idea.

Update: I think I discovered what the problem is. In Weblogic 7.0, I should be using TxtDataSource because that honors global transactions. TxtDataSource was defined in Weblogic 5.1 but when the applications was ported to 7.0, only a plain DataSource was configured - oops.
I'm happy to try different things but I'm wondering about this one. The transaction level TRANSACTION_READ_UNCOMMITTED is supposed to allow other transactions to read uncommited data that was modified from another tranaction. One, why would you ever want to do that? Two, what does this have to do with my stated problem?
I tried setting <delay-updates-until-end-of-tx> to false already but it didn't make a noticable change in behavior.
Ok I will modify the weblogic-ejb-jar.xml file so that it has values appropriate for Weblogic 7. I'll report back the results...
ejb-jar.xml:



weblogic-ejb-jar.xml:

I'm not sure what the DD is. Is that the weblogic-ejb-jar.xml file or the ejb-jar.xml file?
Yes I suspected that the utility and the ejb were using a different Connection objects(session). How would I ensure that they're using the same Connection object? Can I somehow get the Connection object from the CMP and pass it to the utility?
Yes the utility looks up the datasource from weblogic whose jdbcpool is the same as that configured for the ejb. Am I to understand that it doesn't matter if the ejb and the utility are using different Connection objects? As long as the inserts are done within the same transaction then that equates to the same database session?
Thanks Nitesh. The code used to work in the weblogic 5.1 environment. I think you're right that the ejbCreate and ejbPostCreate should be within the same transaction. I would think that the table A and table B should also use the same jdbc connnection object. The ejb is configured to use the same weblogic jdbc pool as the utility code that inserts table B. Anyway, how do I ensure that these inserts are done within the same transaction.
That's a very good question, Vu. This application was ported from weblogic 5.1 to 7.0. The weblogic-ejb-jar.xml says to use the weblogic 5.1.0 persistence type - I didn't change that going to weblogic 7.0. The ejb-jar.xml file refers to the ejb 1.1 DTD but I don't think that effects which ejb version is used. The ejb was built using ANT and the weblogic.ejbc compiler from the weblogic 7.0 environment so I assume that the build/run ejb versions are in sync.
Thanks Vu for responding. The table B record is being inserted using jdbc. The CMP Entity bean is configured to use the same jdbcPool in Weblogic as that used by the table B insert. I'm not sure where to look for the transaction attribute in the ejbPostCreate. Can you tell me where?
The application that I'm debugging is inserting a record into a table (say Table A) and inserted some related data into a related table (say table B). Table A is implemented with a CMP entity bean. Now the ejbPostCreate method is written to write to table B by calling some utility class(does not use entity bea). This technique is a simple one that I've found examples for on the web. However, in our application when table B is being inserted into, I'm getting a Oracle database error saying that that the FK cannot be found. This FK is the PK in table A. So what this means to me is that in the ejbPostCreate method, the insert is not committed and was inserted in a different database session, if it was inserted at all. I should point out here that the CMP Entity does work for the overloaded ebjCreate/ejbPostCreate methods that insert a Table A record with no related tables. This behavior contradicts all of the promised behavior that I've found on the Web. Does anybody have any insight into what might resolve this issue(xml configuration perhaps)?
The application that I'm debugging is inserting a record into a table (say Table A) and inserted some related data into a related table (say table B). Table A is implemented with a CMP entity bean. Now the ejbPostCreate method is written to write to table B by calling some utility class(does not use entity bea). This technique is a simple one that I've found examples for on the web. However, in our application when table B is being inserted into, I'm getting a Oracle database error saying that that the FK cannot be found. This FK is the PK in table A. So what this means to me is that in the ejbPostCreate method, the insert is not committed and was inserted in a different database session, if it was inserted at all. I should point out here that the CMP Entity does work for the overloaded ebjCreate/ejbPostCreate methods that insert a Table A record with no related tables. This behavior contradicts all of the promised behavior that I've found on the Web. Does anybody have any insight into what might resolve this issue(xml configuration perhaps)?
17 years ago
Is your jar file declared explicitly by file name in the classpath?
[This message has been edited by Mark Savory (edited April 18, 2001).]
23 years ago
The Windows operating system is telling you that it cann't find jre.exe. Either the directory in which jre.exe resides is not in the PATH or jre.exe doesn't exist. Why don't you run java.exe?
23 years ago