Named queries get put into the same QueryCompilationCache, more or
less. After initialization, there's no significant difference between
a named and a dynamic query, internally.
The QueryCompilationCache (and most of the other OpenJPA caches) can
be set to a fixed size, btw.
-Patrick
On Apr 6, 2008, at 10:31 PM, roger.keays wrote:
Hi Patrick,
Thanks for the reply. I'll look into those options. Our use case is
that we
have one webapp deployed which is set up for 30+ different
customers. To
make things simpler, we're using a separate database (actually,
schema) for
each customer, so we need an EMF for each one. We've found that with
all the
caching going on we have problems with memory usage and our best bet
so far
has been to disable caching entirely and let the OS manage that
memory for
disk caching.
Would using named queries make any difference? Or would they still be
compiled into the same QueryCompilationCache?
Cheers,
Roger
Patrick Linskey-2 wrote:
Hi,
There is no built-in way to configure a shared QueryCompilationCache,
but you could definitely implement such a thing. Probably the easiest
way to do this would be to create a new type that implements Map (or,
ideally, java.util.concurrent.ConcurrentHashMap) that routes get()
and
put() calls to a static singleton instance.
Do you use a lot of different queries, or a fairly predefined set? If
it' a small set, you could use the new MetaDataCacheMaintenance class
to pre-build a serialized dump of the MetaDataRepository, which
includes compiled queries.
-Patrick
On Mon, Mar 31, 2008 at 6:52 PM, roger.keays
<[EMAIL PROTECTED]> wrote:
Hi all,
Does anybody know if it is possible to configure OpenJPA
EntityManagers
to
use a specific database schema. ATM I'm using openjpa.jdbc.Schema,
but
this
only allows configuring the schema on EntityManagerFactories.
Alternatively, is it possible to configure a shared
QueryCompilationCache
across multiple EntityManagerFactories?
Thanks in advance,
Roger
--
View this message in context:
http://www.nabble.com/Different-schema-per-entity-manager--tp16405560p16405560.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.
--
Patrick Linskey
202 669 5907
--
View this message in context:
http://www.nabble.com/Different-schema-per-entity-manager--tp16405560p16533148.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.
--
Patrick Linskey
202 669 5907