users@glassfish.java.net

Singleton vs. J2EE spec, how to implement a data cache

From: <glassfish_at_javadesktop.org>
Date: Mon, 26 Jan 2009 04:04:52 PST

Hi,

I am struggling with one specific architectural issue for days now:
[i][b]"Where and how to place a data cache in a J2EE Architecture?"[/b][/i]

The reason for this question is that the J2EE spec does not explicitly allow use of singleton objects.

Maybe I misunderstood something, but from my perspective a cache should exist only once per application.

I am pretty new to J2EE, but from my basic understanding placing singleton cache object reference in a stateful/stateless session bean does not really make sense.
Putting it into a resource adapter sounds much cleaner but does not help me separating cache "domains" per application.

I would be very happy if someone could help me out of this dilemma.


Thanks for your help,
Sebastian Mahr
[Message sent by forum member 'smahr' (smahr)]

http://forums.java.net/jive/thread.jspa?messageID=328144