-
1. Re: Commit options not effect
danch1 Nov 8, 2001 4:46 PM (in response to luctran)Problem 1 I'd expect from all options but C. This is just a side effect of using cascaded deletes in the database - JBoss doesn't know that they're being deleted out from under it, so it keeps them cached. Option C fixes this by not caching anything.
Problem 2, on the other hand...
Is your delete and create in the same transaction or a different transaction? -
2. Re: Commit options not effect
luctran Nov 8, 2001 9:03 PM (in response to luctran)Hi danch1,
Thank for your anwser. I think it's a different transaction. Here is the code I do:
lookup();
Application app =home.create("app_id","desc");
ApplicationPK key=(ApplicationPK)app.getPrimaryKey();
System.out.println("----------Before----------");
System.out.println("app_id="+key.toString());
System.out.println("desc="+app.getDescription());
app.remove();
System.out.println("----------After----------");
Application app_new=home.create("app_id","");
System.out.println("app_id="+key.toString());
System.out.println("desc="+app_new.getDescription());
output:
-------Before--------
app_id=app_id
desc =desc
-------After---------
app_id=app_id
desc =desc
The desc do not change in two case. -
3. Re: Commit options not effect
danch1 Nov 9, 2001 11:42 PM (in response to luctran)Is that from a client or a servlet/JSP? Then it _is_ two separate transactions.
-
4. Re: Commit options not effect
danch1 Nov 9, 2001 11:52 PM (in response to luctran)Sorry, I forgot to add "and it should work right."
-
5. Re: Commit options not effect
luctran Nov 11, 2001 8:39 PM (in response to luctran)I tested both servlet and main class client. But it's not work. When I re-create the bean with the primary key the same before once. The container executes ejbCreate, ejbStore but not ejbLoad. And when I call business methods, it does not execute ejbLoad. But if I create a new bean, the container executes ejbCreate, ejbLoad, ejbStore.
I don't understand why?