Well I got the first stages of this done. And it is looking really good-
IMHO.
Reading in from csv using HSQLDB; which is fast as lightning! into an
InventoryItem[].
Then I do a load on each Item from the database (Oracle in my case);
If the item exists, I use BeanUtils.copyProperties to map my csv gotten
item's values into the one
I retreived from Oracle.  I then use a custom Interceptor (modification on
AuditInterceptor example) to determine if the item needs to be updated.
If the item didn't exist it is just a straight save and voila.

I must admit I was a bit sceptical about using the Hibernate Framework,
because it does take a few days to 'get into it'.
But I am quite happy with the results.  I had recently ported from Cayenne,
and based on my tests, Hibernate is head and
shoulders above in easy of implementation (Once you know what you are doing)
as well as speed.

My simple benchmarks:

2 test files:

 w/ 10000 row X 25 column dataset of which about 1/2 overlapped (to test
update and insert - I also had some dup keys etc to spice it up)

 Reading a single file in from CSV to a Item[] took under .4 seconds on my
Intel P4 2.4GHz Toshiba laptop w/1Gig.
      Note: this was much faster than the same test with cvsjdbc.

 Checking Oracle and doing the updates took about 5.5 seconds.
     Note: this took upwards of a minute with the cayenne implementation I
had. And it was a memory hog in a lot of cases.

 Also this was run on Window 2000 in Intellij/IDEA 3.05 with minimal
logging.

Anyway, these numbers might not be too relevant to anyone else, but it
impressed me.  Now I feel much more confident moving ahead with Hibernate as
my o/r solution.


Cheers





-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to