• Post Reply Bookmark Topic Watch Topic
  • New Topic

standalone mode - two clients, same database and cache  RSS feed

 
Bernd Wollny
Ranch Hand
Posts: 59
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody!

While testing our applications, my colleague and i were wondering about this situation: we start two (or more) clients in standalone mode that share the same database file and want to book the same entry. Since we have all information in a cache (no worries in server mode), this leads to corrupt data. The underlying database file changes an the cache won't notice that change. So at least one of the clients data is in an inconsistent state. But, what's the question? The question is: Do we have to check for such situations (e.g reading that entry once again before writing) or can we ignore them? Indeed, you can argue that every standalone client lives in its own universe, no matter if others share the same database... What do you think?

Thanks and regards
Bernd
 
Roel De Nijs
Sheriff
Posts: 11082
173
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bernd,

we start two (or more) clients in standalone mode
That's not possible according to the instructions: You may assume that at any moment, at most one program is accessing the database file;

Kind regards,
Roel
 
Bernd Wollny
Ranch Hand
Posts: 59
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Roel,

you are right, thanks a lot!!! This prevents me from a bigger code change...

Regards
Bernd

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!