1

My database(Oracle) pushes rowID's when DML operations are performed and my java program has a listeners which handles the events and gets the rowID's.

For Example: Below are the values returned from database on DML operation

ROW: operation=UPDATE, ROWID=AAASjgAABAAAVapAAA

Now I have to store this rowID's in a cache? How do I do this in java? Any clues would help. I am thinking of JCS or Ehcache. Which one is preferrable?

Handling RowID's returned as part of DB events through a listener:

class DCNDemoListener implements DatabaseChangeListener
    {
      DBChangeNotification demo;
      DCNDemoListener(DBChangeNotification dem)
      {
        demo = dem;
      }
      public void  onDatabaseChangeNotification(DatabaseChangeEvent e)
      {
        System.out.println(e.toString());
      }
    }
  • how exactly will you deal with your cache? do you need multiple machines accessing this cache or you just need it for your current program, so a simple HashSet would do the job? What about cache expiration feature, do you need it? do you need to store the rowid only or other data as well? – Kostas Kryptos Jan 04 '15 at 10:32
  • Yes multiple machines will be accessing the cache. I need to store only the rowId's –  Jan 04 '15 at 11:06
  • You need to build a clustered cache. How do you plan to get notified when updates & deletes are performed? – Andy Dufresne Jan 04 '15 at 17:18
  • Updated the question please have a look. I am already handling the notifications. All I need is to store this returned RowId's and update another table in database. But how do I do this? :( –  Jan 04 '15 at 19:02
  • Can you define the problem statement clearly so that a solution could be thought off? – Andy Dufresne Jan 05 '15 at 05:12

1 Answers1

0

Have a look at the basic caching documentation for Ehcache 2.9.0.

Regarding recommendations on technology, hard to say given only limited information about the use case is presented.

Louis Jacomet
  • 13,661
  • 2
  • 34
  • 43