Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

XML Property File Configuration

Posted on 2008-06-20
5
Medium Priority
?
162 Views
Last Modified: 2013-11-05
Hi,

I've currently got an java application which uses Quartz to schedule jobs. The jobs typically go to various regional databases and populate another consolidated database to get a consolidated view of the data. It also schedules routine tasks such as nightly batch activities and archiving.

The configuration data i.e job, trigger and database connection details are held in an XML config file and read by the java process.

However, today a problem occurred. A member of the team had accidental coped the production XML config file to UAT and changed some of the regional DB values to UAT values, but not the consolidated DB connection details. As a result we had erroneous UAT data in production and some details were duplicated (one from prod and one from UAT. As you can imagine this was a nightmare!

As a result I've proposed getting the DB connection details out of the xml config file and putting it in a unix vi properties file with property value pairs. This will split the job / triggers and connection details. The property file name would be propertyfile.properties.prod and propertyfile.properties.uat and the correct file read in depending on property set in the unix user .profile file.

This seems a bit complex. I was just wondering if anyone had similar problems and how the resolved it / if anyone has any advice to help create a fool-proof solution.

Your help ould be much appreciated
0
Comment
Question by:bowemc
  • 2
  • 2
5 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 21833866
Back up the config files? If you want to do it more flexibly, you could even use a versioning system for the config files, then you can keep track of edits, particularly who's allowed to make them, and roll them back if they're wrong
0
 

Author Comment

by:bowemc
ID: 21834926
Hi Cehj,

I'm looking for a way to ensure my production DB connection details are not used in a config file unless in prod, or at least reducing the likelihood of. I can't see how back-up or conversioning can help with this???
0
 
LVL 92

Expert Comment

by:objects
ID: 21835075
db connection details should be installed in a separate file, that way you have one version in production and another in testing/development

0
 
LVL 86

Expert Comment

by:CEHJ
ID: 21835184
>>This will split the job / triggers and connection details.

That's probably a good idea, but it won't in itself prevent rogue edits such as the one you've mentioned. The best thing to do is to restrict write access and keep backups then things can be restored easily
0
 
LVL 92

Accepted Solution

by:
objects earned 2000 total points
ID: 21835796
> but it won't in itself prevent rogue edits such as the one you've mentioned.

of course it will. You obviously would not deploy the production file in the test environment.
And you don't need to backup it up, that won't help at all.

0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question