Pedro, here's another solution to those spoken of already.

Code your persistence as CMP Entity Beans(for simplicity). Create Value
Objects for those instances(IDEA does it automagically, and xdoclet
handles it as well). Then have a stateless session bean with a static
Vector or list and access the ReadOnly beans thru it like in:

PropertySet (Entity Bean)
PropertySetVO (Value Object)
PropertyManager (Stateless Session Bean).

PropertyManager ... {

private static final Map properties = Collections.new HashMap(); //
it'll be shared in the container.

Public Object findProperty(Object criteria) {
        if (properties.contains(criteria) { // cache hit
                return properties.get(criteria);
        } else { // cache miss
                load(criteria); // load the missing entity
                return properties.get(criteria);
                // optionally, implement a caching policy such as LRU
here(i.e.: dump the oldest
                // properties entry.
        }
}

Now, a number of session beans (nevermind how many) will handle the
loading and provision of the VOs, which will also run faster if you
perform complex calculations on them(it sounds like you're just worried
about ease of persistence with your EJBs, but the operations need not to
be transactional....).

HTH,



My 2c,

Juan Pablo Lorandi
Chief Software Architect
Code Foundry Ltd.
[EMAIL PROTECTED]

Barberstown, Straffan, Co. Kildare, Ireland.
Tel: +353-1-6012050  Fax: +353-1-6012051
Mobile: +353-86-2157900
www.codefoundry.com


> -----Original Message-----
> From: A mailing list for Enterprise JavaBeans development
> [mailto:[EMAIL PROTECTED]] On Behalf Of Pedro Salazar
> Sent: Friday, November 15, 2002 11:06 AM
> To: [EMAIL PROTECTED]
> Subject: entity beans: concepts
>
>
> Greetings,
>
> I have no experience with entity beans, and therefore I would
> like to appeal to your knowledge.
>
> 1) I would like to have a Entity Bean that would map not only
> a record from my database, but severals, and that I could
> manipulate that information in the Entity Bean class to be
> prepared to handle client requests. For example, I want
> create a Entity Bean that represents a Graph (several
> records), and I would like that Graph to be initialized in a
> specific data structure in my Java class, for I could run a
> routing algorithm (Dijkstra). Is this possible?
>
> 2) If I have create a Entity Bean, and if I create Session
> Beans to make the callback interface for the clients, I would
> have several Session Beans for every client's request. But
> how many Entity Beans would I have in my container? Only one,
> right? All Session Beans would go to the same Entity Bean?
>
> thanks,
> Pedro Salazar.
>
> --
> pedro salazar (pt-inovacao) <[EMAIL PROTECTED]>
> key id: D803BC61
>
> ==============================================================
> =============
> 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