This should work fine in the given case for the purpose of running the
static code only once and starting the timertask...
But where is your cache lying: in the web tier or ejb tier?
Again, is the cache a singleton object or an "application" object of the web
tier?
Regards,
Partha
> ----------
> From: Manish Malhotra[SMTP:manish.mmalhotra@(protected)]
> Sent: Wednesday, September 29, 2004 12:38 PM
> To: J2EE-INTEREST@(protected)
> Subject: Static block issue.
>
> Hi All,
>
> If Im creating an object from a Session Bean.
> Singleton pattern is used to create this Object.
> There is one static block in this class.
>
> Now my question is if n no. of beans create the object of this class in
> the
> same JVM. Then its static block would be called only once.
> Is this correct? Please let me know from your all good side.
>
> And Im using this class to start one TimerTask thread to refresh my cache
> after fixed amount of delay. Please comment on this design also.
> Actually Bean is the entry point of my application so I cant start this. I
> can call another helper class to start the thread but its more or less
> same.
>
> So, plz give me your comments / help as its highly required.
>
> Many Thanks.
> regards,
> Manish
>
>
>
> Manish Malhotra
> Patni Computer Systems Ltd
> Vashi Infotech Park, Tower-1, Unit No.:141/151, 11P
> Above Vashi Railway Station, Vashi
> Navi Mumbai-400705, India
> Tel: +91 22 55910849 Extn: 235
> Fax:+91 22 55910855
>
> ==========================================================================
> =
> To unsubscribe, send email to listserv@(protected)
> body
> of the message "signoff J2EE-INTEREST". For general help, send email to
> listserv@(protected)".
>
*********************************************************************
Disclaimer: The information in this e-mail and any attachments is
confidential / privileged. It is intended solely for the addressee or
addressees. If you are not the addressee indicated in this message, you may
not copy or deliver this message to anyone. In such case, you should destroy
this message and kindly notify the sender by reply email. Please advise
immediately if you or your employer does not consent to Internet email for
messages of this kind.
*********************************************************************
===========================================================================
To unsubscribe, send email to listserv@(protected)
of the message "signoff J2EE-INTEREST". For general help, send email to
listserv@(protected)".