Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I have developed a Windows application in c# in which multiple users can add some numbers and their name and can view the data entered. The problem that I have is that the sever is on my laptop and every time I log off or close my laptop, they are losing connection to the DB and can not add or view any more.

It seems that the port is closed or something. Is there a way to keep the port and their connection established all the time even when I'm logging out?

share|improve this question
    
You should better ask this question in Stack Overflow. –  user34768 Nov 5 '12 at 8:44
5  
You need to be running the application as a service that's independent of login. However, you should really be looking at running it on a proper server. What happens when your laptop has to be shut down completely or moves out of range of a network? –  ChrisF Nov 5 '12 at 9:04
2  
I think your architecture for the solution is very strange! –  Emmad Kareem Nov 5 '12 at 9:04
    
Suggest off topic here... may be better at ServerFault or maybe StackExchange - but running the MySQL server on a laptop is a tad bizarre! –  Andrew Nov 5 '12 at 9:07
    
Welcome to Programmers SE. –  Joseph Quinsey Nov 5 '12 at 17:54
add comment

1 Answer

Very probably, the SQL database engine is running from your own local account; when you log off, all the processes running from this account are stopped, including the database engine.

Instead, the database engine should be run using either Local Service or Network Service account, or a dedicated account which will never be logged off. Those accounts are for example used by many Windows Services, which allow them to remain active when there are no active users, and do some tasks on the background, like defragmenting the disks.


This being said and other people have pointed it out, you shouldn't run a database used by other people on your laptop, but use a server instead.

Even if you have a very basic needs (no SLA needed, frequent downtime is acceptable, data loss acceptable, etc.) and don't need real server-level infrastructure with redundancy, backup power, etc., running a database used by several people is rather strange. If you don't need anything provided by real server hardware and infrastructure, then at least build a basic, inexpensive PC that will be always on.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.