• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Toplink Cache coordination using JMS for manual DB updates

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We are having 2 web application using same Database and common Toplink library, but 2 different session objects for both the applications. We are using JMS for cache coordination. JMS propagating messages successfully between the applications and able to see the object changes in both the applications properly. Now, we are trying to refresh cache for manual updates in Database.
We are trying to refresh particular object which is modified in database in one application, it is able to refresh in the application from which refresh happened but not in other application. Is there any way we can force JMS to propagate these changes/updates?

Our intention is refreshing in one application so that JMS should coordinate and update in others when DB manual updates. Please let us know any comments for the same.

Database using: Oracle 11g
Toplink Version:- 9.0.3

Also, we are planning to migrate Toplink to eclipse Link soon but i think above issue will be persists.

Please let us know if any more details required on the same.
 
Ranch Hand
Posts: 553
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In TopLink 9.0.3, there is no API, but you could create and send your own cache coordination message. You would just need to create a change set for the object and send it.

In TopLink 11g (EclipseLink) you can use the JpaCache API evict(Class, Object, boolean) to invalidate an object in the cluster.

See,
http://wiki.eclipse.org/EclipseLink/UserGuide/JPA/Basic_JPA_Development/Caching/Cache_API

The API is also available in the native API on the IdentityMapAccessor.

FYI: TopLink 11g inlcudes EclipseLink, so migrating to EclipseLink is the same as migrating to TopLink 11g.
 
allareddy suneel
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
James,
Thanks for the inputs.
 
allareddy suneel
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
James,
I am trying to prepare JMS message but not able to complete, any sample code/ link i can refer to?
 
James Sutherland
Ranch Hand
Posts: 553
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would not create your own JMS message, but use the session's commandManager (or cacheSynch) to send the message. You just need to give it the UnitOfWorkChangeSet that you will build with the ObjectChangeSet of your changed object.

I would be much easier if you upgrade to 11g.
 
allareddy suneel
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks James!!! i am able to send message and able to succeed.
reply
    Bookmark Topic Watch Topic
  • New Topic