Scheduled operation in WebService

S

strzalek83

Hi,
I'm trying to build some WebService with NetBeans5.0. My WebService
makes available some information from database which are modified
sometimes. I would like to check periodically if changes happened. My
question is how to do that in NetBeans? By implementing some new class
which extends Thread or by adding some new metods to the class which
implements metods for WebService interface? There is no main() in the
code so I don't know how to start that checking thread at the moment
whe WebService is deployed at the Application Server.
Thanks for help.
Gregory
 
O

Oliver Wong

Hi,
I'm trying to build some WebService with NetBeans5.0. My WebService
makes available some information from database which are modified
sometimes. I would like to check periodically if changes happened. My
question is how to do that in NetBeans? By implementing some new class
which extends Thread or by adding some new metods to the class which
implements metods for WebService interface? There is no main() in the
code so I don't know how to start that checking thread at the moment
whe WebService is deployed at the Application Server.

I believe what's usually done is that whenever a user request
information from the web service, the service will query the database then
and there, thus ensuring that the data the user receives is fresh.

- Oliver
 
S

strzalek83

I believe what's usually done is that whenever a user request
information from the web service, the service will query the database then
and there, thus ensuring that the data the user receives is fresh.

- Oliver

Thanks for Your response. I'm afraid that we have misunderstood.
Database has two interfaces.. one for the WebService and the other for
the measurement system which makes some changes to. And I want to chek
if the mesurement system changes was made so checking state of database
just in the moment of WebService request isn't good for me. I'm waiting
for some new ideas.

Gregory
 
O

Oliver Wong

Thanks for Your response. I'm afraid that we have misunderstood.
Database has two interfaces.. one for the WebService and the other for
the measurement system which makes some changes to. And I want to chek
if the mesurement system changes was made so checking state of database
just in the moment of WebService request isn't good for me. I'm waiting
for some new ideas.

This sounds like classic MVC (Model View Controller). The DB is your
Model, the WebService is your View, and the measurement system is your
Controller.

You might put a layer around the DB so that you can add behaviour to it.
When your "measurement system" wants to make changes, instead of directly
changing the DB, it talks to that wrapper layer. The wrapper layer then
takes care of both modifying the DB, and notifying any subscribers who want
to be alerted to changes.

Failing that, you could just poll the DB every now and then.

- Oliver
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
SterlingLa
Top