By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,773 Members | 1,777 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,773 IT Pros & Developers. It's quick & easy.

Queueing in Client Server Application

P: n/a
Hi,

I have a client server application where the client sends a request to
the server with a filename. The server needs to read the file
contents, massage the data, and then add it to the database. However,
if two requests show up at the same time, I need to create some sort
of a waiting mechanism or queue.

I was thinking about using a Singleton Server Activation object for
this reason, but I am not sure how I can implement the queueing
mechanism. As far as I know, once the server method is done adding the
file contents to the database, it will return true/false. But I need
it to pick up any pending files in the queue and process them as well.
At the same time, I don't want the first client request to wait until
all the files in the queue are processed.

The client also is waiting for a success/failure bool from the server
side method.

Any ideas on how I can accomplish this?

Asad

Feb 1 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Why do you need a waiting mechanism? You could certainly use a Queue object
to hold the requests and process them serially. But you could also use
QueueUserWorkItem onto the Threadpool with a specified callback and have them
all processed on threadpool threads in parallel.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"as*******@gmail.com" wrote:
Hi,

I have a client server application where the client sends a request to
the server with a filename. The server needs to read the file
contents, massage the data, and then add it to the database. However,
if two requests show up at the same time, I need to create some sort
of a waiting mechanism or queue.

I was thinking about using a Singleton Server Activation object for
this reason, but I am not sure how I can implement the queueing
mechanism. As far as I know, once the server method is done adding the
file contents to the database, it will return true/false. But I need
it to pick up any pending files in the queue and process them as well.
At the same time, I don't want the first client request to wait until
all the files in the queue are processed.

The client also is waiting for a success/failure bool from the server
side method.

Any ideas on how I can accomplish this?

Asad

Feb 1 '07 #2

P: n/a
Asad,

Since you don't specify too much of your current architecture, there are
some questions that would change the way you could do things.

a) do your client needs to wait for an answer or result?
b) does the server need to process the requests are they are sent or could
this be done from times to times?
c) are the files located on the server?
d) are clients/server running on the same physical network or do you have
the ability to have clients outside your network (like internet)?

With these answers, I think I could be of more help.

--
Regards,
Robson Siqueira
Enterprise Architect
<as*******@gmail.comwrote in message
news:11*********************@v45g2000cwv.googlegro ups.com...
Hi,

I have a client server application where the client sends a request to
the server with a filename. The server needs to read the file
contents, massage the data, and then add it to the database. However,
if two requests show up at the same time, I need to create some sort
of a waiting mechanism or queue.

I was thinking about using a Singleton Server Activation object for
this reason, but I am not sure how I can implement the queueing
mechanism. As far as I know, once the server method is done adding the
file contents to the database, it will return true/false. But I need
it to pick up any pending files in the queue and process them as well.
At the same time, I don't want the first client request to wait until
all the files in the queue are processed.

The client also is waiting for a success/failure bool from the server
side method.

Any ideas on how I can accomplish this?

Asad

Feb 1 '07 #3

P: n/a
a) Yes, the client is waiting for a success/failure response from the
server.
b) The server must respond and work on the request immediately and
return the result.
c) No the files are located on a seperate server. The client
application will be on the workstations spread out across the company.
The server application will be running on a SQL server machine. And
the files are physically located on a third server machine we have.
d) No internet. Everything is on the same network.

Asad

On Feb 1, 4:27 pm, "Robson Siqueira" <rob...@robsonfelix.comwrote:
Asad,

Since you don't specify too much of your current architecture, there are
some questions that would change the way you could do things.

a) do yourclientneeds to wait for an answer or result?
b) does theserverneed to process the requests are they are sent or could
this be done from times to times?
c) are the files located on theserver?
d) are clients/serverrunning on the same physical network or do you have
the ability to have clients outside your network (like internet)?

With these answers, I think I could be of more help.

--
Regards,
Robson Siqueira
Enterprise Architect<asadik...@gmail.comwrote in message

news:11*********************@v45g2000cwv.googlegro ups.com...
Hi,
I have aclientserverapplication where theclientsends a request to
theserverwith a filename. Theserverneeds to read the file
contents, massage the data, and then add it to the database. However,
if two requests show up at the same time, I need to create some sort
of a waiting mechanism or queue.
I was thinking about using a SingletonServerActivation object for
this reason, but I am not sure how I can implement thequeueing
mechanism. As far as I know, once theservermethod is done adding the
file contents to the database, it will return true/false. But I need
it to pick up any pending files in the queue and process them as well.
At the same time, I don't want the firstclientrequest to wait until
all the files in the queue are processed.
Theclientalso is waiting for a success/failure bool from theserver
side method.
Any ideas on how I can accomplish this?
Asad

Feb 2 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.