Hello everybody!
I made a investigate project (to see features of OJB). The current task of
this project is move data from MSAccess database into MySQL.
For getting data from MSAccess I'm using JDBC directly (because I wasn't
able to setup character set for MSAccess through OJB) and I'm using OJB
for writing data into MySQL.
So, I got an "Out Of memory" error during copying a quite a big amount of
data (about 1.500.000 records), so only about 400.000 records was copied.
The generated table is quite easy: one integer fields and 2 strings
fields.
Here is a code how I'm doing copying:
//select data from source database
Statement stmt = getSourceConnection().createStatement();
ResultSet rs = stmt.executeQuery("SELECT * FROM KVART");
//1. open transaction in destination database
getDestBroker().beginTransaction();
while (rs.next()) {
app.MySQL.Kvart kvart =
new app.MySQL.Kvart(rs.getInt("tel"),
rs.getString("fio"),
rs.getString("vid_tel"));
// save new phone
getDestBroker().store(kvart);
}
//commit transaction
getDestBroker().commitTransaction();
So, why in such simple case it generates out of memory error and how it is
possible to fix it (may be I'm doing something wrong?)
I'm using db-ojb 1.0.rc6 with MySQL Connector/J version 3.0.11
Best Regards,
Alexey Kakunin
Project Manager
PIKOS GmbH
Post Str. 24
53111 Bonn
Tel: +49 30 43 72 92-30
Fax: +49 30 43 72 92-30