A way to refresh a hashtable in memory taking data from database by some event.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Ruben_Perez
Posted On:   Tuesday, May 28, 2002 01:05 AM

Hello Everybody. I think I have an interesting problem. I have to keep information in a hashtable that comes from a datasource. I'm using a jdbc (Oracle thin driver) connection with weblogic 6.1 to access the tables of the database. I'd like to find some way to refresh the data of the hashtable only when the table of the database has some change. I know that's posible to refresh the table every time, but I'd like to know some other elegant way. If I considered the table of the database like a source event, would be posible to capture change events in the tables in order to refresh the hashtable that I have in memory or call other java methods? Do you know any solution?    More>>

Hello Everybody. I think I have an interesting problem. I have to keep information in a
hashtable that comes from a datasource. I'm using a jdbc (Oracle thin driver) connection with
weblogic 6.1 to access the tables of the database. I'd like to find some way to refresh
the data of the hashtable only when the table of the database has some change.
I know that's posible to refresh the table every time, but I'd like to know some other elegant
way.

If I considered the table of the database like a source event, would be posible to capture
change events in the tables in order to refresh the hashtable that I have in memory or call
other java methods?


Do you know any solution?


Thanks in advance

   <<Less

Re: A way to refresh a hashtable in memory taking data from database by some event.

Posted By:   Christopher_Koenigsberg  
Posted On:   Tuesday, May 28, 2002 06:44 AM

Have a trigger on INSERT or UPDATE or DELETE in the database table, which calls a stored procedure, which invokes a servlet URL by HTTP (or a Web Service via SOAP over HTTP), and this invoked servlet is in the same application (servlet context) as your other main servlet, and it updates the hash table which is maintained as an attribute of the servlet context.

About | Sitemap | Contact