|
From: Alef A. <al...@jt...> - 2004-01-06 13:32:28
|
A serializable beanfactory in my opinion is not a really good option,
what about the beans it contains? Should they be serializable as well
(which is what a serializable beanfactory would indicate as far as I'm
concerned).
We use the BeanFactory in EJBs a lot and we declare it as being
transient and force re-initialization an activation. This just works
fine. When limiting the amount of beans in a BeanFactory for an EJB and
creating multiple beanfactories for multiple different EJBs, it
shouldn't be that big an overhead.
Alef
> -----Original Message-----
> From: spr...@li...
> [mailto:spr...@li...]
> On Behalf Of MacMahon, Mark
> Sent: Tuesday, January 06, 2004 1:34 PM
> To: 'spr...@li...'
> Subject: [Springframework-developer] Serializable support
>
>
>
> Hi All,
>
> I have got a package of Spring configured objects that I
> would like to use interchangeably in both a web application and
> an EJB application (from SFSB).
> Some of my Objects are BeanFactoryAware so that they can
> create on demand, prototype instances of spring configured objects.
>
> All works well in web application mode. However I cannot get
> it to work reliably in ejb mode due to the fact that
> BeanFactory is not serializable - exceptions on passivation
> of the SFSB.
>
> Why isn't BeanFactory serializable? I can see that the Log
> class is being stored as a member rather than a class
> variable in some of the spring classes but surely this can be
> changed easily?
>
>
> Shouldn't the BeanFactoryWare interface be documented so as
> to discourage use of it in beans that are used in an EJB environment?
>
> Is there any way that I can avoid reverting back to using a
> typical java singleton for access to the BeanFactory for the
> scenario that I have described (loading prototypes on demand)
>
>
> I am also getting problems passivating the SFSB due to the
> fact that AbstractEnterpriseBean stores its logger as a
> member rather than a class
> variable:
> Is this convenience really worth sacrificing serializable support?
>
> abstract class AbstractEnterpriseBean implements EnterpriseBean
> {
>
> /** Logger, available to subclasses */
> protected final Log logger = LogFactory.getLog(getClass());
>
> //Change to static to support serializable
> //private final static Log logger =
> LogFactory.getLog(AbstractEnterpriseBean.class);
>
> }
>
>
>
> Please forgive me if I am addressing the wrong mailing list here!
>
> Any help appreciated!
> Thanks in advance!
>
> Mark
>
> ____________________________________________________
>
> emuse technologies
> U24 Trinity Enterprise Centre, Pearse Street, Dublin 2, Ireland.
> Tel: +353 (0)1 6717317 Fax: +353 (0)1 6717319
> website: <http://www.emusetechnologies.com/>
> email: in...@em... <mailto:in...@em...>
> ____________________________________________________
>
> This message has been scanned for viruses using GroupShield
> for Exchange Server.
>
> CONFIDENTIALITY NOTICE - The information contained in this
> email message is intended only for confidential use of the
> named recipient. If the reader is not the intended recipient
> or the person responsible for delivering it to the recipient,
> you are hereby notified that you have received this
> communication in error and that any review, dissemination or
> copying of this communication is strictly prohibited. If you
> have received this in error, please notify the sender immediately.
>
> The information, opinions and recommendations contained
> herein are and must be construed solely as statements of
> opinion and not statements of fact. No warranty, expressed or
> implied, as to the accuracy, timeliness, completeness,
> merchantability or fitness for any particular purpose of any
> such recommendation or information is given or made by emuse
> technologies in any form or manner whatsoever.
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: IBM Linux Tutorials.
> Become an expert in LINUX or just sharpen your skills. Sign
> up for IBM's Free Linux Tutorials. Learn everything from the
> bash shell to sys admin. Click now!
> http://ads.osdn.com/?ad_id=1278&alloc_id=> 3371&op=click
>
>
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
|