This content has been marked as final. Show 5 replies
messaging support built-in into both commerical LDS and open source BlazeDS seems a good fit for near-real time server push.
Googling BlazeDS and messaing would give you some nice articles to read on the topic.
why does this BlazeDS got to do with Java, May I know the reason? Can I use the apache instead of tomcat?
You need some kind of server side API to get data from MySql and send it over to Flex. Flex, as you might know already, cannot connect to any DB directly. It can connect to some server 'page' or a webservice or can use remoting to get data.
BlazeDS, as well LiveCycle Data Services, is service side impl by Adobe to help with messaging and remoting. of course, you don't have to have these technologies on the server side. Plain java servlets/jsp or .net app would do. But this is the messaging that's built-in into these server side impls that I thought might interest you.
Otherwise, it is as simple as:
1) set up a servlet/jsp/ASP/PHP page on the server that returns you data that you're interested in
2) set up a Timer in the Flex app to tick after, let's say, every 5 seconds
3) on every tick of the timer use HTTPService class to send a request to the server page
4) listen for the result/fault events of the HTTPService class
5) get the data in the result event and display it.
6) timer would tick again in 5 seconds and get the newer data
A more advanced solution is to use the Hibernate Assember in the Data Management Services of the LiveCycle Data Services server in order to connect to your database. So, you can not only synchronize your client with your DB, but also synchronize all clients at the same time using push data. When a user on a given client changes data in a datagrid whose dataprovider is an array collection of [Managed] objects, it reflects immediately in the database as well as in all the other clients. When the DB changes (for example as the result of a backend process), all clients are sent a push data update.
You can also use EJB3s if you write a Custom Java Assembler class, so you have a layer of abstraction and do not access the DB directly.
So far I have no problem inserting the data and get the data out from the database using asSQL but I not sure is this good enough for real time data? Can comment on it?
Thank Karl but those are every new to me as I just only student trying to do something new on Flex application and I will do research on what you post if I not sure will post here.....
Thank atta707 will try out the BlazeDS if I encounter problem I will post here...
Thank a lot for your advice.... wow learn something cool....hahaha