Not sure if this is the correct place to post this, but here goes, please let me know if there is a better place for questions like this.
I currently have a servlet based server using http comm's to a flash movie client, everything is currently working fine, I now need to push data from an oracle database to the client.
I have 2 questions:
Using Oracle, does anyone know the best way to get Oracle to let me know in the Java of a data change? Triggers? I am currently only using Servlets and would like to keep it as simple as possible, only using EJB's etc... if it's the only way.
I have looked into 2 ways of pushing this data to the flash client, one is the standard socket architecture, this is fairly standard and easy to implement and understand, but it needs a port to be open for this comm's, in an internet situation this might be a problem. The other idea is to use a ServletAdapter and keep the http connection from the Flash to the a Servlet open pushing data to the client as needed. Does anyone have any opinions on these 2 ideas?
Any help/discussion on these 2 questions would be greatly appreciated.
1. Not unless you are using JServer (and so running you Java application in Oracle). JDBC is inherently pull in design - so there is no way to use it with a push based architecture.
2. "ServletAdapter"? Not sure what you mean by this. But:
keep the http connection from the Flash to the a Servlet open pushing data to the client as needed
This isn't how HTTP works. You have the same problem with it, and therefore HTTPServlets: they are inherently pull, not push. A servlet is not going to be able to update anything client side (like a Flash object) without a request. What you need (as you've realised) is possibly some sort of client side code which opens a socket to a serverside component which possible polls the DB for changes. I've no idea if your Flash components can do this (I've never had any use for Flash) - you suggest its not a problem so I'll take your word for it.