openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "roger.keays" <>
Subject Re: Different schema per entity manager?
Date Mon, 07 Apr 2008 03:31:15 GMT

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?



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
> <> 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:
>>  Sent from the OpenJPA Users mailing list archive at
> -- 
> Patrick Linskey
> 202 669 5907

View this message in context:
Sent from the OpenJPA Users mailing list archive at

View raw message