• 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

event propagation from database to app server java component

 
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
All,

I wanted to check some good ways to achieve this.

We have some core java functionality sitting on the application server. This needs to be called from an Oracle database table event (through Oracle triggers for example).
What is the best way to achieve this

1) Asynchronous call to the java web service on the app server from the Oracle table trigger
2) JMS messaging
3) Java app having a polling service to monitor the database table at regular intervals
4) Scheduler functionality like Quartz
5) any other practice for reverse direction functionality calling.


Regards,
 
Mohit Sinha
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can some one provide tips on how to go about this.
 
Sheriff
Posts: 3837
66
Netbeans IDE Oracle Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'd suggest to move the functionality to the database. You can create Java stored procedures in Oracle from 9i on, so you don't need to recode the functionality in PL/SQL.

Other possibility would be to use Database Change Notification, available in Oracle 10 and higher (Oracle 11 has some enhancements). You'll need compatible JDBC client though. This will call your Java procedure sitting on application server whenever a monitored table changes, and is usable with connection pools. However it is only suitable when the changes are infrequent, for heavily modified data this is not usable. This functionality is generally meant to allow caching data in the middle tier. When applicable, it is a good alternative to polling.

We successfully use these two techniques in our project. Messaging (Advanced Queuing in Oracle parlance) is certainly another option, though I have no experience with it.

I'd strongly discourage you from using triggers. Your database performace will suffer badly if you try it. (The Database Change Notification - DCN - mentioned earlier is asynchronous, therefore its impact on performance is not that strong.) Moreover, it's really tricky to get triggers right. The transaction that fired the trigger could be rolled back. If you call extenal code, you must make sure to rollback effects of these calls too. By contrast DCN informs you only about changes that were actually comited to the database.

 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic