I am very new to the EJB world and understand the basics. So please pardon me if I am not very clear in explaining my problem.
I am given an assignment where I need to read data from tables in one database(Informix) and write it to another database(Oracle). The data needs to be transferred once a day and lock contention is not an issue. Maximum data that can be copied is about 1000 rows per table.
My questions are:
1. Is there any pattern that addresses my case.
2. Should I write a Java program that uses direct JDBC calls or should I use EJB's?
Any thoughts/comments/opinions will be appreciated.
Jag
-
EJB Vs JDBC calls (3 messages)
- Posted by: Jagdeep Sharma
- Posted on: December 03 2002 13:09 EST
Threaded Messages (3)
- EJB Vs JDBC calls by Rajasekar Kayamboo on December 03 2002 13:42 EST
- EJB Vs JDBC calls by Dave C on December 03 2002 17:49 EST
- EJB Vs JDBC calls by marko lauke on December 04 2002 10:06 EST
- EJB Vs JDBC calls by Dave C on December 03 2002 17:49 EST
-
EJB Vs JDBC calls[ Go to top ]
- Posted by: Rajasekar Kayamboo
- Posted on: December 03 2002 13:42 EST
- in response to Jagdeep Sharma
Hi Jag,
It is my very personal opinion. Having worked on projects involving both JDBC and EJBs I prefer to use JDBC calls to the probelm that you have described. My opinion is based on the following:
1. It is just a batch process running once a day.
2. There is little / no transaction isolation involved. I mean, any rollbacks or constraint violation.
3. The operation is just going to be INSERTS/ UPDATES on the table rather than a distributed transaction.
I would use EJBs for a transaction that involves a set of inserts/updates/deletes spanning over multiple tables or even multiple databases.
I would like to use less overhead on demand calls using JDBC for simple inserts/updates/deletes (which I presume is the problem you have described)
Last but not the least, get some more opinion of experts in this forum before yo jump into a conclusion.
Good Luck.
Sekar -
EJB Vs JDBC calls[ Go to top ]
- Posted by: Dave C
- Posted on: December 03 2002 17:49 EST
- in response to Rajasekar Kayamboo
With EJBs though, you get the transactions, and so what it gives you is the ability to do your entire batch process in a transaction, and then at the end, either every row from Informix made it to Oracle, or none did. Depending on your application, it may be a real pain if you get a failure halfway through and can't figure out which rows made it and which didn't. With EJB and transactions, you get all or nothing.
Dave -
EJB Vs JDBC calls[ Go to top ]
- Posted by: marko lauke
- Posted on: December 04 2002 10:06 EST
- in response to Dave C
a simple JDBC proggy called once a day are more as enough for your use case.
tx are also supported by the databases you use even with JDBC. so there is no reason why u should use a fat EJB server with JTA/JTS...
cy