• Post Reply Bookmark Topic Watch Topic
  • New Topic

System.setProperty  RSS feed

Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

In a web app I need to connect to different data sources and get data depending upon user selection of DB location.
Depending upon whichever option the user selects , a system property is set and this property is used to get the data base connection(external party code).
Usage of system property though not advisable is a restriction here .I can not use alternatives.

But this is going to an issue when more than one user accesses the application ,
each user overriding the property for other .
I am thinking of putting the code where a user sets the property and gets the data from respective db in a synchronised block so that only one user at a time will be able to set property and get the data.

Is this approach ok.
If not any other better approaches .

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!