Hello!
Thank you for quick answer but:
1) I tried to put beginTransaction/commiTransaction into while loop -
without success - same out of memory problem
2) I tried to comment beginTransaction/commiTransaction at all with same
result
3) I tried to create one object Kvart before while and store readed values
in this instance, but same without success :(
Yes, I agree with you in case that seems it is probably a problem of
Java/JDBC/Garbage Collector, but how it is possible to fix?
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
Thomas Mahler <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]
05/26/2004 01:23 PM
Please respond to "OJB Users List"
To: OJB Users List <[EMAIL PROTECTED]>
cc:
Subject: Re: Out of Memory bug
Hi Alexey,
you are allocating a new Kvart instance for each Resultset row.
You could change the code to save tons of ram as shown below.
You could also try to commit blocks of say 10000 Kvarts. This will save
a lot of JDBC resources.
cheers,
Thomas
[EMAIL PROTECTED] wrote:
> 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();
>
app.MySQL.Kvart transferKvart =
> new app.MySQL.Kvart();
> while (rs.next()) {
>
transferKvart.setTel(rs.getInt("tel"));
transferKvart.setFio("fio");
transferKvart.setVidTel("vid_tel");
>
> // save new phone
getDestBroker().store(transferKvart);
>
> }
> //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
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]