You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Will Hoover <ja...@gmail.com> on 2013/01/04 20:07:09 UTC
OpenJPA DCN/QCN Caching Support?
Does OpenJPA support caching using DCN/QCN similar to EclipseLink?
http://wiki.eclipse.org/EclipseLink/Examples/JPA/DCN
http://wiki.eclipse.org/EclipseLink/UserGuide/JPA/Basic_JPA_Development/Cach
ing/DatabaseEvents
RE: OpenJPA DCN/QCN Caching Support?
Posted by Will Hoover <ja...@gmail.com>.
Unfortunately, my current project requires a close to real-time solution.
So, an eviction schedule would not suffice. I was originally thinking that I
could utilize a distributed cache like Ehcache, Coherence, DynaCache, etc.
in conjunction with OpenJPA, but I'm not sure how feasible/easy that would
be.
AFAIF, most other vendors only support C functions? So, interfacing a change
notification/L2 feature for other DB vendors may be a bit more involved.
Either way establishing an extendable interface sounds like a good idea.
I would also like to have the capability to listen to changes on an
application level in order to propagate the push to clients. I assume that's
outside the scope of the Remote Event Notification Framework?
-----Original Message-----
From: Kevin Sutter [mailto:kwsutter@gmail.com]
Sent: Monday, January 07, 2013 10:39 AM
To: users@openjpa.apache.org
Subject: Re: OpenJPA DCN/QCN Caching Support?
Hi Will,
Good to know it's not a make-or-break usage scenario for OpenJPA.
Depending on your application and the interactions with your database, this
change notification may not even be necessary. One capability that OpenJPA
does provide is the ability to drop and re-load the cache on a regular basis
(you define the interval of the eviction schedule) [1]. This type of data
cache refresh may be sufficient for your needs, depending on your scenarios.
> I guess there would have to be some thought/discussion on
> configuration
options. Maybe there could be an option that would allow control over how
stale data is handled during the L2 window period?
If you do decide to pursue this option, then we would definitely need some
type of configuration to control this processing. Configuring whatever
listener is required should be sufficient for the enable/disable capability.
We would also need to keep in mind that other databases exist besides
Oracle... :-) That is, if other databases provide a similar type of
callback, we would want the configuration to handle these other databases.
Not that your contributed solution has to handle other databases, but we
need the ability to extend the capability to other databases.
Thanks!
Kevin
[1]
http://openjpa.apache.org/builds/latest/docs/docbook/manual.html#ref_guide_c
ache_conf
On Mon, Jan 7, 2013 at 8:00 AM, Will Hoover <ja...@gmail.com> wrote:
> I wouldn't say it's a make or break feature for using OpenJPA, but it
> would be a bonus. I wouldn't mind making a contribution to add this
> feature. By the looks of how EclipseLink did things it doesn't seem
> like it would be too difficult to implement (
> http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/trunk/founda
> tion/
>
> org.eclipse.persistence.oracle/src/org/eclipse/persistence/platform/da
> tabase /oracle/dcn/OracleChangeNotificationListener.java ). I guess
> there would have to be some thought/discussion on configuration
> options. Maybe there could be an option that would allow control over
> how stale data is handled during the L2 window period?
>
> -----Original Message-----
> From: Kevin Sutter [mailto:kwsutter@gmail.com]
> Sent: Friday, January 04, 2013 2:25 PM
> To: users@openjpa.apache.org
> Subject: Re: OpenJPA DCN/QCN Caching Support?
>
> Hi Will,
> OpenJPA does support L2 caching. But, it does not currently support
> the "database change notification" as specified in the EclipseLink
> documentation. We are looking at providing this type of notification
> support, but there is some concern about the "window" between the time
> that the data gets updated in the database and notifying the L2 cache
> to either remove or update the contents. You could argue that any
> window of time is better than no automatic notification, but the app
> still has to know that they could be processing stale data. And,
> closing the window completely may not actually even be desired since
> there could be a potential bottleneck at the notification and
> processing levels...
>
> It's good to have this conversation though... Are you indicating this
> lack of DCN processing is a make-or-break feature for your usage of
> OpenJPA? If so, would you be interested in helping to develop such a
feature?
>
> Thanks,
> Kevin
>
> On Fri, Jan 4, 2013 at 1:07 PM, Will Hoover <ja...@gmail.com>
> wrote:
>
> > Does OpenJPA support caching using DCN/QCN similar to EclipseLink?
> >
> > http://wiki.eclipse.org/EclipseLink/Examples/JPA/DCN
> >
> > http://wiki.eclipse.org/EclipseLink/UserGuide/JPA/Basic_JPA_Developm
> > en
> > t/Cach
> > ing/DatabaseEvents<http://wiki.eclipse.org/EclipseLink/UserGuide/JPA
> > /B asic_JPA_Development/Cach%0Aing/DatabaseEvents>
> >
> >
> >
>
>
Re: OpenJPA DCN/QCN Caching Support?
Posted by Kevin Sutter <kw...@gmail.com>.
Hi Will,
Good to know it's not a make-or-break usage scenario for OpenJPA.
Depending on your application and the interactions with your database, this
change notification may not even be necessary. One capability that OpenJPA
does provide is the ability to drop and re-load the cache on a regular
basis (you define the interval of the eviction schedule) [1]. This type of
data cache refresh may be sufficient for your needs, depending on your
scenarios.
> I guess there would have to be some thought/discussion on configuration
options. Maybe there could be an option that would allow control over how
stale data is handled during the L2 window period?
If you do decide to pursue this option, then we would definitely need some
type of configuration to control this processing. Configuring whatever
listener is required should be sufficient for the enable/disable
capability. We would also need to keep in mind that other databases exist
besides Oracle... :-) That is, if other databases provide a similar type
of callback, we would want the configuration to handle these other
databases. Not that your contributed solution has to handle other
databases, but we need the ability to extend the capability to other
databases.
Thanks!
Kevin
[1]
http://openjpa.apache.org/builds/latest/docs/docbook/manual.html#ref_guide_cache_conf
On Mon, Jan 7, 2013 at 8:00 AM, Will Hoover <ja...@gmail.com> wrote:
> I wouldn't say it's a make or break feature for using OpenJPA, but it would
> be a bonus. I wouldn't mind making a contribution to add this feature. By
> the looks of how EclipseLink did things it doesn't seem like it would be
> too
> difficult to implement
> (
> http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/trunk/foundation/
>
> org.eclipse.persistence.oracle/src/org/eclipse/persistence/platform/database
> /oracle/dcn/OracleChangeNotificationListener.java ). I guess there would
> have to be some thought/discussion on configuration options. Maybe there
> could be an option that would allow control over how stale data is handled
> during the L2 window period?
>
> -----Original Message-----
> From: Kevin Sutter [mailto:kwsutter@gmail.com]
> Sent: Friday, January 04, 2013 2:25 PM
> To: users@openjpa.apache.org
> Subject: Re: OpenJPA DCN/QCN Caching Support?
>
> Hi Will,
> OpenJPA does support L2 caching. But, it does not currently support the
> "database change notification" as specified in the EclipseLink
> documentation. We are looking at providing this type of notification
> support, but there is some concern about the "window" between the time that
> the data gets updated in the database and notifying the L2 cache to either
> remove or update the contents. You could argue that any window of time is
> better than no automatic notification, but the app still has to know that
> they could be processing stale data. And, closing the window completely
> may
> not actually even be desired since there could be a potential bottleneck at
> the notification and processing levels...
>
> It's good to have this conversation though... Are you indicating this lack
> of DCN processing is a make-or-break feature for your usage of OpenJPA? If
> so, would you be interested in helping to develop such a feature?
>
> Thanks,
> Kevin
>
> On Fri, Jan 4, 2013 at 1:07 PM, Will Hoover <ja...@gmail.com>
> wrote:
>
> > Does OpenJPA support caching using DCN/QCN similar to EclipseLink?
> >
> > http://wiki.eclipse.org/EclipseLink/Examples/JPA/DCN
> >
> > http://wiki.eclipse.org/EclipseLink/UserGuide/JPA/Basic_JPA_Developmen
> > t/Cach
> > ing/DatabaseEvents<http://wiki.eclipse.org/EclipseLink/UserGuide/JPA/B
> > asic_JPA_Development/Cach%0Aing/DatabaseEvents>
> >
> >
> >
>
>
RE: OpenJPA DCN/QCN Caching Support?
Posted by Will Hoover <ja...@gmail.com>.
I wouldn't say it's a make or break feature for using OpenJPA, but it would
be a bonus. I wouldn't mind making a contribution to add this feature. By
the looks of how EclipseLink did things it doesn't seem like it would be too
difficult to implement
(http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/trunk/foundation/
org.eclipse.persistence.oracle/src/org/eclipse/persistence/platform/database
/oracle/dcn/OracleChangeNotificationListener.java ). I guess there would
have to be some thought/discussion on configuration options. Maybe there
could be an option that would allow control over how stale data is handled
during the L2 window period?
-----Original Message-----
From: Kevin Sutter [mailto:kwsutter@gmail.com]
Sent: Friday, January 04, 2013 2:25 PM
To: users@openjpa.apache.org
Subject: Re: OpenJPA DCN/QCN Caching Support?
Hi Will,
OpenJPA does support L2 caching. But, it does not currently support the
"database change notification" as specified in the EclipseLink
documentation. We are looking at providing this type of notification
support, but there is some concern about the "window" between the time that
the data gets updated in the database and notifying the L2 cache to either
remove or update the contents. You could argue that any window of time is
better than no automatic notification, but the app still has to know that
they could be processing stale data. And, closing the window completely may
not actually even be desired since there could be a potential bottleneck at
the notification and processing levels...
It's good to have this conversation though... Are you indicating this lack
of DCN processing is a make-or-break feature for your usage of OpenJPA? If
so, would you be interested in helping to develop such a feature?
Thanks,
Kevin
On Fri, Jan 4, 2013 at 1:07 PM, Will Hoover <ja...@gmail.com> wrote:
> Does OpenJPA support caching using DCN/QCN similar to EclipseLink?
>
> http://wiki.eclipse.org/EclipseLink/Examples/JPA/DCN
>
> http://wiki.eclipse.org/EclipseLink/UserGuide/JPA/Basic_JPA_Developmen
> t/Cach
> ing/DatabaseEvents<http://wiki.eclipse.org/EclipseLink/UserGuide/JPA/B
> asic_JPA_Development/Cach%0Aing/DatabaseEvents>
>
>
>
Re: OpenJPA DCN/QCN Caching Support?
Posted by Kevin Sutter <kw...@gmail.com>.
Hi Will,
OpenJPA does support L2 caching. But, it does not currently support the
"database change notification" as specified in the EclipseLink
documentation. We are looking at providing this type of notification
support, but there is some concern about the "window" between the time that
the data gets updated in the database and notifying the L2 cache to either
remove or update the contents. You could argue that any window of time is
better than no automatic notification, but the app still has to know that
they could be processing stale data. And, closing the window completely
may not actually even be desired since there could be a potential
bottleneck at the notification and processing levels...
It's good to have this conversation though... Are you indicating this lack
of DCN processing is a make-or-break feature for your usage of OpenJPA? If
so, would you be interested in helping to develop such a feature?
Thanks,
Kevin
On Fri, Jan 4, 2013 at 1:07 PM, Will Hoover <ja...@gmail.com> wrote:
> Does OpenJPA support caching using DCN/QCN similar to EclipseLink?
>
> http://wiki.eclipse.org/EclipseLink/Examples/JPA/DCN
>
> http://wiki.eclipse.org/EclipseLink/UserGuide/JPA/Basic_JPA_Development/Cach
> ing/DatabaseEvents<http://wiki.eclipse.org/EclipseLink/UserGuide/JPA/Basic_JPA_Development/Cach%0Aing/DatabaseEvents>
>
>
>