Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Fire events from server to clients

 
Yingie Pitts
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is an application written by swing and using JDBC to connect to Oracle 9i database on the server.
After a user logged into the application, he will see a list of forms
that created by the application users. He can edit those forms as well.
The scenario:
Suppose there are two users logged into the application installed on two seperate client computers. One of them just edited a form and saved it to the database. In this case, the same form shown on the other user's screen should get updated instantly.
So if I create a eventServer.java on the server side, how can I fire events to the other user and get him updated?
In the other word, how the EventServer knows how many users are currently logged in and update them automatically?
Any thoughts, buddy?
 
George McCain
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
from what I heard
Client side callbacks from RMI?
 
Daniel Puryear
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I implemented just such a system several years ago using Sybase. Any client, anywhere in the world was made aware of updates concurently and in real time. This is not an enormous undertaking, but it is also non trival.
You develop a high speed, robust JDBC proxy server that sits just outside the DB. The proxy basically is a two-way pass-thru server for the bulk of the JDBC stuff such as ad hoc queries, etc. However, for those cases requiring multi-cast notification everthing is handled via stored procedures on the DB, of course. Then buried within the stored procedure(s) is a call to a custom system stored procedure that communicates with the proxy. The proxy then iterates thru it list of clients and passes the "event" ResultSet back to each of the clients. You will be tailoring the client side JDBC drivers to include callback hooks for use by the proxy. RMI, as suggested earlier, is a relatively painless methodology since most of the infrastructure code is already done for you. Or if you'r really breave, roll your own messaging protocol, just be sure to take into account the various bandwidths of the pipes through which the clients may be connected.
While I'm not familiar with Oracle outside of their SQL dilect, its my understanding from conversations with others that the big O already has a packaged solution to your problem
- Dan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic