If you are using MessageBeans, then I can only assume you are also using
Weblogic's EJB 2.0 beta patch?  If so, you can take advantage of EJB 2.0's
static EJBHome methods, hence effectively creating a removeAll that findAll
then removes each bean...

But of course, like you said, this is inefficient.  If instead in your
static method you hit the db table directly and remove all rows, then your
ReadOnly beans will start throwing EJBException when its read-timeout time
expires...  if you don't MIND this, then its probably the only "efficient"
way to go!

(Unless EJB 2.0 has EJBHome.removeAll that I'm not aware of!)

Gene

-----Original Message-----
From: A mailing list for Enterprise JavaBeans development
[mailto:[EMAIL PROTECTED]]On Behalf Of Ram Komarraju
Sent: Tuesday, August 29, 2000 6:41 AM
To: [EMAIL PROTECTED]
Subject: Removing multiple entity beans.


A protocol that I am using requires that I store all the messages I send be
persisted, so that they can resent in case of communications failure or
system
crash.  So, I have decided to store them in a table with just two fields,
the
message id (primary key), and actual message itself as a string.  Then, I
created a container managed entity bean that maps to the table.  Once
created,
these beans are virtually read-only, except when I go back to delete them at
the
beginning of a day (clean new session).

Now the problem that I am facing is this:  from time to time (for example,
at
the beginning of a day), I want to remove all the messages in the table, and
start all over again.  It would not be very efficient to remove one bean at
a
time, and I guess what I need is something like ejbRemoveAll() (I have no
idea
how this could be implemented by a container though :)).

Is there a way of implementing this within the EJB1.1 framework, or do I
need to
resort to other ways such as cleaning the table before creating any entity
beans
at the start of a clean new session.

Any suggestions are greatly appreciated,
Ram.

(BTW, I am using Weblogic 5.1 )



<<Disclaimer>>

This message is intended only for the use of the Addressee and may contain
information that is PRIVILEGED and/or CONFIDENTIAL or both.

This email is intended only for the personal and confidential use of the
recipient(s) named above.

If the reader of this email is not an intended recipient, you have received
this
email in error and any review, dissemination, distribution or copying is
strictly prohibited.

If you have received this email in error, please notify the sender
immediately
by return email and permanently delete the copy you received.

Thank you.

===========================================================================
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".

Reply via email to