Login Register Actian.com  

Actian Community Forum


Go Back   Actian Community Forums > Development Tools > Application Development using Java, ODBC, .NET, OpenAPI, PHP, etc
 

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 2012-07-19   #1 (permalink)
Ingres Community
 
dejan's Avatar
 
Join Date: Jun 2009
Location: London, UK
Posts: 377
Question Is there a way to get notified about create/update/delete ?

I need a way to get a notification message whenever table in database gets a new record, a record gets deleted, or when a record is updated, so I can update my JTable model(s). I am quite sure someone have already solved this problem somehow. Any clues?
dejan is offline   Reply With Quote
Old 2012-07-19   #2 (permalink)
Ingres Community
 
daryl.monge@ingres.com's Avatar
 
Join Date: Mar 2007
Location: Naperville, IL
Posts: 242
Default

One idea: Write a rule/procedure that fires a database event. Unfortunately I have never used dbevents in Java so I'm not entirely sure how to receive those other than a JNI interface.
daryl.monge@ingres.com is offline   Reply With Quote
Old 2012-07-19   #3 (permalink)
Ingres Community
 
dejan's Avatar
 
Join Date: Jun 2009
Location: London, UK
Posts: 377
Default

I have already thought about it, but it won't work because JDBC driver can't handle DBEVENTs...

The only sane approach I came up with is to write an OME function, say SENDMSG, which will communicate with another JAVA application, or HornetQ server directly, to send database events around...

Last edited by dejan; 2012-07-19 at 07:45 AM.
dejan is offline   Reply With Quote
Old 2012-07-19   #4 (permalink)
Ingres Community
 
rhann's Avatar
 
Join Date: Mar 2007
Location: roy.hann@rationalcommerce.com
Posts: 1,145
Blog Entries: 25
Default

I imagine it would be pretty easy to write a DBEvent listener in C that would relay messages to any port at any address using any protocol you can name.

Or, if you don't need synchronous/real-time notification, you can select from iiaudit in iidbdb.
__________________
Roy Hann

UK Actian User Association Conference 2014 will be on Tuesday June 10 2014. Mark the date in your diary.
rhann is online now   Reply With Quote
Old 2012-07-27   #5 (permalink)
Ingres Community
 
Join Date: Mar 2007
Location: Cheshire, UK
Posts: 84
Default

Rather than rules, you should use "security alarms" to raise the events.

You'd then need something registered to receive the events (e.g. a bit of C) and pass them onto your Java app. The problem with events is that if nothing is there to receive them; then the situation did not happen, so you won't just catch-up at some point. At least with a security alarm, you can find anything you missed from the audit logs.
nick.bolton@barclays.com is offline   Reply With Quote
Old 2012-07-30   #6 (permalink)
Ingres Community
 
dejan's Avatar
 
Join Date: Jun 2009
Location: London, UK
Posts: 377
Lightbulb

This is actually a pretty good solution. It would be really, really great if iijdbc driver was capable of listening to Ingres DBevents... Btw. any plans of having this functionality in the Ingres JDBC driver?
dejan is offline   Reply With Quote
Old 2012-07-30   #7 (permalink)
Actian Corp
 
Join Date: Nov 2007
Posts: 61
Default

The JDBC interface is an external spec. Can you a suggest a way to pass dbevent info between the driver and the application?
thogo01 is offline   Reply With Quote
Old 2012-09-17   #8 (permalink)
Ingres Community
 
dejan's Avatar
 
Join Date: Jun 2009
Location: London, UK
Posts: 377
Default

Well, I do not mind Ingres JDBC doing the same what Oracle does: Database Change Notification
dejan is offline   Reply With Quote
Old 2012-09-19   #9 (permalink)
Junior Member
 
Join Date: Sep 2009
Posts: 2
Unhappy

With ORACLE you can use dbms_alert.register and dbms_alert.waitone as java.sql.CallableStatement. I would expect to use register dbevent and get dbevent in the same way with Ingres.

Users have been requesting this feature for such a long time - many years and Ingres releases later and still no solution ... very poor.
3magku is offline   Reply With Quote

Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


© 2011 Actian Corporation. All Rights Reserved