It's not a secret anymore!
The moose likes Java in General and the fly likes need some suggestions in CPU % usage and lapse time Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "need some suggestions in CPU % usage and lapse time" Watch "need some suggestions in CPU % usage and lapse time" New topic

need some suggestions in CPU % usage and lapse time

Bala Raju Mandala
Ranch Hand

Joined: Sep 21, 2006
Posts: 40
Hi All,

I need your help. Let me explain the issue,

A XML file is need to parsed and data should be stored in database. So existing implementation is XML file inserted into a database table and fired a trigger on that table. The trigger is reading the XML content and storing the data into appropriate table.

What my idea is, with out inserting the XML file into database i am planning to use JAXB here. I will unmarshalize XML file and using DAOs i can store them into database.

But here i need to prove which approach is better? I need to find the CPU % usage and lapse time in both the cases. Can anybody help me here with you suggestions to find CPU% and lapse time in bothcases.
Martijn Verburg

Joined: Jun 24, 2003
Posts: 3275

Another question to ask yourself is:

Is your application interested in the data stored in the XML or the XML document as a whole?

Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
jiju ka
Ranch Hand

Joined: Oct 12, 2004
Posts: 306
You are talking about two approaches here
1. Making the persistence layer do the parsing
2. Making the business layer do the parsing.

There are pros and cons with each approach.

We are doing approach 1.

Our xml is not very big. We update the xml quite often.

We choose aproach 1 because network traffic is less.

In our case ...
we needed to store the xml anyway- whether we go with approach 1 or approach 2.
If we used approach 2 we would have send the xml and the parsed data too. That would have doubled network usage.

Another consideration was CPU usage in application servers. With approach 2 it may be higher than approach 1. Our servers are clustered and we are already parsing the xml for business needs. So approach 2 didn't have any affect on CPU usage.

Now we are feeling we should have gone with approach 2 because...
of maintenance.
For us we don't have a staff to work on stored procedures. So any change needed on the stored procedures or triggers is a big bottle neck for us.
I agree. Here's the link:
subject: need some suggestions in CPU % usage and lapse time
It's not a secret anymore!