db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yves pielusenet <yvespieluse...@free.fr>
Subject Re: [MEMORY] Derby full fill my the JVM memory
Date Mon, 22 May 2006 18:37:05 GMT
Yes I do commit every 'n' ( I choose 50) insert.

Le lundi 22 mai 2006 à 14:55 -0300, Edson Carlos Ericksson Richter a
écrit :
> You do a commit after like
> 
> int n = psInsert.executeUpdate();
> con.commit();
> 
> ???
> (I've not seen this piece of code there...)
> 
> Richter
> 
> 
> yves pielusenet escreveu:
> > Here is how I connect to the database :
> >
> > String url = "jdbc:derby:"+purl+pdbname+";create="+cancreatedb;
> > String driver = "org.apache.derby.jdbc.EmbeddedDriver";
> >
> > Class.forName(driver);
> > con = DriverManager.getConnection(url, user, passwd);
> > con.setAutoCommit(false);
> >
> > And here is how I execute sql statements :
> >
> > // I create the prepared statement only once :
> > psInsert = dbgencon.getConnection().prepareStatement("INSERT INTO data
> > (numvign, data) VALUES (?, ?)");
> >
> > ...
> > // I configure the statement and execute it
> > psInsert.setInt(1, numvign);
> > psInsert.setBytes(2, DBGenConnection.obj2Bytes(jv));
> > int n = psInsert.executeUpdate();
> >
> >
> > When I comment the last line I haven't got the
> > java.lang.OutOfMemoryError
> >
> > Maybe it important to say that I use 2 derby connexion into the same
> > application. And I do lots of insert into the two one.
> >
> > thanks for any help :)
> >
> >
> >
> >   
> 


Mime
View raw message