Ofcourse! You just have to configure your server for non-exclusive (mostly uncached) access to the database. If you look at the EJB spec, the server mostly does ejbLoad on every single bean you touch in the transaction. You make your changes, transaction commits, and the server executes ejbStores to put the records back into the database (prior to the end of the transaction). Most servers allow you to "cache" the data in memory and avoid having to do ejbStore, or ejbLoads. This however, assumes that the underlying database is uses "exclusively" by ONE EJB server, which in most cases is not practical.
A simple "DELETE FROM table WHERE condition" would occur MUCH MUCH MUCH faster on the SQL server, than doing the same thing with EJB beans. So, yes, it's quite acceptable to do what you are proposing and IS being done in many cases. While saing the above, I need to mention that this does break the CMP model of deployment, however, you do what you have to do to make your application work. In our application we mostly use EJB beans, but when it comes time to MASS deletions we resort to direct DELETE statements on the SQL database. -AP_ -----Original Message----- From: A mailing list for Enterprise JavaBeans development [mailto:[EMAIL PROTECTED]]On Behalf Of Nikhil sharma Sent: Friday, October 05, 2001 2:33 AM To: [EMAIL PROTECTED] Subject: Purging records and bypassing Entity Beans hi, Is it advisable to server the large purge requests by directly firing delete queries from Session bean and bypassing the entity beans. Because if we proceed thru Entity beans un-necessary ejbLoads and ejbStores will get called and in case of thousands of records being purged in a single request they might get loaded by container. So to avoid this can we directly fire db query from session bean. Has anyone been using it this way ... regards, Nikhil. ========================= To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff EJB-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help". =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff EJB-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
