you may be right there:

Section 18.1.2 of the EJB 1.1 specification states: 

        *       The enterprise bean must not attempt to manage threads. The enterprise 
bean must not attempt to start, stop, suspend, or resume a thread; or to change a 
thread�s priority or name. The enterprise bean must not attempt to manage thread 
groups. 

(it does not say sleep ;)

But then again I'd avoid any kind of "Thread." in EJB code. And I'd choose something 
more light-weight

than EJBs for polling, as I said one could use a simple Java class that could do the 
job and trigger an

EJB for the real action...

         

        -----Urspr�ngliche Nachricht----- 
        Von: Nicholas [mailto:[EMAIL PROTECTED]] 
        Gesendet: Do 24.01.2002 17:35 
        An: [EMAIL PROTECTED] 
        Cc: 
        Betreff: Re: Implementing wait in EJBs
        
        

        It seems to me that implementing a try/wait loop is a
        highly sketchy way of doing this. I quite like the JMS
        solution, but technically, I believe the sketchiness
        is not prohibited. In leiu of some highbrow quote from
        the EJB spec, my understanding is that you
        cannot/should not spawn additional threads. So.... on
        that basis, I do not see why Thread.sleep(x) would be
        illegal. It does not spawn any other threads, it
        simply pauses the current one.
        
        Am I off base here ?
        
        //Nicholas
        
        
        --- Sriphani Singaraju <[EMAIL PROTECTED]>
        wrote:
        > Hi Fabian,
        >
        > The scenario goes like this:
        >
        > Bean B invokes a method on Bean A (B is ignorant of
        > the state of A)
        > Bean B should try this repeatedly until the state of
        > A is changed (to a
        > state favourable for servicing Bean B's request).
        > I know it is a performance overhead, but, thatz how
        > the business logic goes.
        > For this case, I'm worried more abt achieving this
        > rather than the amount of
        > time Bean B is blocked.
        >
        > Hope this makes my point clear!
        >
        > Regards,
        > Sriphani.
        >
        > -----Original Message-----
        > From: Fabian Crabus [mailto:[EMAIL PROTECTED]]
        > Sent: Thursday, January 24, 2002 3:36 PM
        > To: [EMAIL PROTECTED]
        > Subject: AW: Re: Implementing wait in EJBs
        >
        >
        >
        > Hi,
        >
        > it depends on what you want to achieve: one possible
        > workaround
        > is to use JMS. For example if you're using Weblogic
        > 6.1 you could
        > create a message and set a delivery time (this is
        > not in the spec). This
        > would trigger a message-driven bean.
        > Or to be spec compliant you could implement your own
        > queue via a database.
        > ...
        > I'm not sure if there's an ideal solution to your
        > problem, perhaps tell us a
        > bit
        > more...
        >
        >
        > Fabian
        > [EMAIL PROTECTED]
        >
        >
        >         -----Urspr�ngliche Nachricht-----
        >         Von: sasi.bhushan
        > [mailto:[EMAIL PROTECTED]]
        >         Gesendet: Do 24.01.2002 09:33
        >         An: [EMAIL PROTECTED]
        >         Cc:
        >         Betreff: Re: Implementing wait in EJBs
        >
        >
        >
        >         U cann,t use any thread related operations
        > in EJB's
        >         Regards
        >         Sbpodila
        >         ---- Sriphani Singaraju
        > <[EMAIL PROTECTED]>
        >         wrote:
        >         >
        >         > Hi,
        >         >
        >         > Can someone tell me if I can use
        > "Thread.sleep()"
        >         in my SFSB. I understand
        >         > from the specs that Thread concepts should
        > not be
        >         used in EJBs. Any
        >         > container specific jargon involved in this
        > ??
        >         >
        >         > Thanks in advance.
        >         > Sriphani.
        >         >
        > ----------------------------------------------------
        >
        >
        ------------------------------------------------------
        >         ----------
        >         > This email and any files transmitted with
        > it are
        >         confidential and
        >         > intended solely for the use of the
        > individual or
        >         entity to whom
        >         > they are addressed. If you have received
        > this email
        >         in error please notify the
        >         > originator of the message or
        >         [EMAIL PROTECTED]
        >         >
        >         > Any views expressed in this message are
        > those of
        >         the individual
        >         > sender, except where the sender specifies
        > and with
        >         authority,
        >         > states them to be the views of Huawei
        > Technologies
        >         India Pvt. Ltd.
        >
        >
        >
        ===========================================================================
        >         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".
        >
        
--------------------------------------------------------------------------------------------------------------------
        > This email and any files transmitted with it are
        > confidential and
        > intended solely for the use of the individual or
        > entity to whom
        > they are addressed. If you have received this email
        > in error please notify the
        > originator of the message or
        > [EMAIL PROTECTED]
        >
        > Any views expressed in this message are those of the
        > individual
        > sender, except where the sender specifies and with
        > authority,
        > states them to be the views of Huawei Technologies
        > India Pvt. Ltd.
        
        
        =====
        Nicholas Whitehead
        Home: (973) 377 9335
        Cell: (201) 615 2716
        Work(@ JP Morgan): (212) 235 5783
        [EMAIL PROTECTED]
        
        __________________________________________________
        Do You Yahoo!?
        Great stuff seeking new owners in Yahoo! Auctions!
        http://auctions.yahoo.com
        
        ===========================================================================
        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