In instruction is written
"You may assume that at any moment, at most one program is accessing the database file; therefore your locking system only needs to be concerned with multiple concurrent clients of your server."
Let say in standalone mode user starts application , now again he is going to start the application but at
most one program is accessing the database file
, how to do implement this logic when user is going to instance another instance of application , he shoud get message like "database file is already in use" .
how to do this?
how to get lock on database file ?
Partner, this is just to indicate that you don't have to worry about another application accessing the database concurrently with your application. So when you start the server, only your application will be accessing it, so you can, for instance, load all records to a cache in memory. So you don't really have to implement anything. Also, I assumed that only one instance of the application would be running at a time.
So you did not implement this .
But what should happen if
once user started application in standalone mode.
Again user will start the application in standalone mode on same machine (same JVM) ,will application start again ? or we should give Alert message "Application is already running and database file is in used" ?
or second instance of application will start?
will Sun tester do this kind of testing of assignment ?
or Sun tester will not do this kind of testing?
I am just asking what will happen ?
what do you think?
It's like Roberto tells you: if you may assume that just one application will access the database file, then you have to implement nothing at all. And the Sun tester will not try to do this, because that's against the instructions they gave you. So it would be stupid for him to try something like that.
You could always (it's your choice) implement something preventing this and you would add that to your choices-document, i guess then the sun tester will try to see if it works and if your solution fails, some points will be deducted. If your solution works, you will not receive extra points. Conclusion: you could only loose by doing it, so don't do it (and that's the opposite of the Nike slogan )