cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <>
Subject Re: Archive tables
Date Fri, 19 Dec 2014 08:44:31 GMT
A few more things I need to ask:

* I assume it is a multi-user app?
* If a user checks the checkbox, you switch *all* entities to the archive tables, not just
a subset of entities?
* How do you distinguish between regular and archive tables? Are archives in a separate schema,
or in the same schema, but using different naming conventions?

But here is also an idea of the solution, that can be further tweaked depending on the answers.
You need to start 2 ServerRuntime's (I assume you are on Cayenne 3.1 / 4.0 here). One mapped
to access regular tables, and another - the archive tables. And depending on a given user
state, you allocate them an ObjectContext from the corresponding runtime. 


> On Dec 19, 2014, at 11:24 AM, Markus Reich <> wrote:
> Hi Andrus,
> the switch is durring runtime, so it's not defined at start up. The trigger
> is e.g. a checkbox in the ui where the user can decide if he want to read
> from archive. One idea was to create a view over archive and real table,
> because it's only read only necessary.
> Andrus Adamchik <> schrieb am Fri Dec 19 2014 at
> 08:22:26:
>> I guess the answer depends on what "easily" means. So a few questions to
>> clarify the scenario:
>> When you start an app, do you already know whether it will read from
>> regular or archive tables? If not, what event triggers the switch in the
>> running app? Is this for all sessions or just specific users?
>> Andrus
>>> On Dec 19, 2014, at 10:08 AM, Markus Reich <>
>> wrote:
>>> Hi,
>>> I need some hints for a very special issue :-)
>>> We have archived old entries of our tables to shadow tables, which have
>>> exactly the same columns structure as the source table.
>>> No we need to have a possibility to switch easily between real and
>>> shadowtable.
>>> Maybe someone already is/was facing such a constellation?
>>> thx
>>> Meex

View raw message