-
1. Re: How to delete multiple records (entity beans)?
srinij77 Sep 11, 2002 1:09 AM (in response to cs710)Hi,
Did you find any solution to this issue?
Thanks
Sreeni -
2. Re: How to delete multiple records (entity beans)?
dsundstrom Sep 11, 2002 2:42 PM (in response to cs710)Unfortunately, that is the way EJB works. May be we (JBoss) could add support for a special remove method in the home interface that takes a collection. Would that work for you? If so, can you post a feature request at source forge.
-
3. Re: How to delete multiple records (entity beans)?
srinij77 Sep 12, 2002 12:02 AM (in response to cs710)Thanks for your response.
So, in this case, mass deletion will become JBOSS specific. Is there any way, which works in most of the application servers.
-Sreeni -
4. Re: How to delete multiple records (entity beans)?
dsundstrom Sep 12, 2002 1:52 AM (in response to cs710)There are now ways that I know of other then cascade delete. If you do find one, I'd like to know.
-
5. Re: How to delete multiple records (entity beans)?
dsundstrom Sep 12, 2002 1:55 AM (in response to cs710)Actually now that I think about it. From the application perspective you have to delete the entities one by one, but the application server can wait until the end of the transaction and delete all rows in a single delete statement.
Delayed deletes (and inserts) is planned for JBoss 4.0. -
6. Re: How to delete multiple records (entity beans)?
cs710 Sep 12, 2002 2:55 PM (in response to cs710)Thanks for your response.
My solution to this problem is to code JDBC directly using command pattern (which is called from session beans) as suggested in J2EE pattern book.
I had been doing Pro*C for a couple of years before I started to do J2EE. The biggest problem I have is how entity bean works. I am not complaining about JBoss, which in fact performs very decently, but about how entity bean works generally. It is nice to map object to tables through entity beans. However for a relatively complicated system, entity bean doesn't provide enough mechanism to do batch processing (for example, insert 5 hundred records or delete 5 hundred). More importantly, joining tables seems a big hassle to me. EJB-QL doesn't seem to address the real problem, for example, if tables don't have a FK relationship.
Delayed delete and insert would definitely be helpful. I assume the container is smart enough to do the delete in one sql and do batch insert instead of many sql as well. I guess the same applies to finder methods. It would be nice for container to do one sql instead of one for each row. Or does EJB say that container has exactly to fetch each row at a time?
Thanks. -
7. Re: How to delete multiple records (entity beans)?
dsundstrom Sep 12, 2002 4:17 PM (in response to cs710)The EJB specification does not day anything about the persistence mapping other than you must store it persistently.
All of what you suggest here is planned for JBoss 4.0. -
8. Re: How to delete multiple records (entity beans)?
cs710 Sep 12, 2002 4:28 PM (in response to cs710)Thanks for your response.
My solution to this problem is to code JDBC directly using command pattern (which is called from session beans) as suggested in J2EE pattern book.
I had been doing Pro*C for a couple of years before I started to do J2EE. The biggest problem I have is how entity bean works. I am not complaining about JBoss, which in fact performs very decently, but about how entity bean works generally. It is nice to map object to tables through entity beans. However for a relatively complicated system, entity bean doesn't provide enough mechanism to do batch processing (for example, insert 5 hundred records or delete 5 hundred). More importantly, joining tables seems a big hassle to me. EJB-QL doesn't seem to address the real problem, for example, if tables don't have a FK relationship.
Delayed delete and insert would definitely be helpful. I assume the container is smart enough to do the delete in one sql and do batch insert instead of many sql as well. I guess the same applies to finder methods. It would be nice for container to do one sql instead of one for each row. Or does EJB say that container has exactly to fetch each row at a time?
Thanks. -
9. Re: How to delete multiple records (entity beans)?
cosmic_crusader Sep 12, 2002 10:01 PM (in response to cs710)Heh... being a developer I know the pain of being asked this question, but I'm only asking out of curioisity not out of pressure.
When is JBOSS 4.0 expected to hit the world?
1 year? 18 months?
(I honestly have no idea) -
10. Re: How to delete multiple records (entity beans)?
dsundstrom Sep 13, 2002 12:09 AM (in response to cs710)This is targeted for JavaOne next year, but features may get bumped. We tend to bump features instead of pushing dates way out.
-
11. Re: How to delete multiple records (entity beans)?
sonwh98 Sep 13, 2002 3:21 PM (in response to cs710)Regarding your question about building relationships without FK between tables, use ejbSelect methods and wrapper methods that delegates to the ejbSelect methods.
-
12. Re: How to delete multiple records (entity beans)?
srinij77 Oct 20, 2003 9:53 PM (in response to cs710)"Delayed deletes (and inserts) is planned for JBoss 4.0."
Is this taken care in JBOSS 4?
Thanks
Sreeni