aspose file tools
The moose likes Threads and Synchronization and the fly likes e voting machine Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Threads and Synchronization
Reply Bookmark "e voting machine" Watch "e voting machine" New topic
Author

e voting machine

anarkali perera
Ranch Hand

Joined: Sep 10, 2009
Posts: 237
i am going to develop a e voting system.
there is a server for each district.
each server has a more than 100 voting machine.
my problem is how to handle threading in the server?
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 8795

If you mean an application server, then you do not have to worry about multi threading issues.


SCJP 1.4, SCWCD 1.4 - Hints for you, SCBCD Hints - Demnachst, SCDJWS - Auch Demnachst
Did a rm -R / to find out that I lost my entire Linux installation!
anarkali perera
Ranch Hand

Joined: Sep 10, 2009
Posts: 237
not appliucation server.
there is a 100 voting places in district.each of them connect to one data base server.so when going to save simultaniously how to
handle the thread problem.because if we synchronise the save method only one can access one time.
so there are 100 voting places .each of them sending a vote to the server.
hot to solve this problem?
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 8795

anarkali perera wrote:not appliucation server.
there is a 100 voting places in district.each of them connect to one data base server.so when going to save simultaniously how to
handle the thread problem.because if we synchronise the save method only one can access one time.
so there are 100 voting places .each of them sending a vote to the server.
hot to solve this problem?


What is the interface that you are providing to the voters? Is it a Web interface or a Swing client? Have you heard of Application / Web servers? How are those voting machines in different districts going to connect to the database server?
anarkali perera
Ranch Hand

Joined: Sep 10, 2009
Posts: 237
it transfer the vote as a soap message.
client interface is swing.
anarkali perera
Ranch Hand

Joined: Sep 10, 2009
Posts: 237
what are the advantage using swing interface than web interface
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12271
    
    1
it transfer the vote as a soap message.


SOAP servers are easily hosted on typical web servers such as Tomcat. You should study the best practice for web server applications keeping users separate and simultaneously managing multiple requests.

Bill


Java Resources at www.wbrogden.com
anarkali perera
Ranch Hand

Joined: Sep 10, 2009
Posts: 237
there is a thread problem also.
there is only one server machine.So all the voting machine requestion authentication from voters details from this one machine.
imagin there are 100 request at given time .so what happen if the authentication method is synchronize.all the other 99 users have to wait.
How to avoid this problem?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35258
    
    7
Why would the other 99 threads have to wait? What does the authentication do that would require synchronization?

If synchronization of some kind does need to be done (and remember, there are other ways than making complete methods synchronized), then it's good practice to guard only that section of code that does whatever needs protection. Most often, that is not the complete method.

If you're serious at all about multi-threading in Java, then you need to read one of standard books ("Java Threads" or "Java Concurrency in Practice"). You'll learn far more than you ever could by perusing forums and articles on the web.


Android appsImageJ pluginsJava web charts
Nitesh Kant
Bartender

Joined: Feb 25, 2007
Posts: 1638

anarkali perera wrote:
my problem is how to handle threading in the server?


Then it does not belong to this forum! (CarefullyChooseOneForum)

Moving to Threads forum. (I agree with Ulf though. You need to read those books)


apigee, a better way to API!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: e voting machine
 
Similar Threads
Counting
node, node manager, admin server, and managed server
list all machine name and ip addresses in LAN using java
WA #1.....word association
The Busch, I mean Bush, Teen Daughters