You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Edson Carlos Ericksson Richter <ed...@mgrinformatica.com.br> on 2003/08/12 16:18:43 UTC
Large database force use of recordset
Hi!
I'm using a large database to make some reporting.
The problem is when I need to show a report with about 100000 records. This just freeze my machinery, and after 10 minutes, I get OutOfMemoryException...
Yes, I know that I should use java -Xmx 128M -Xms 64M and so on, so I'll get things working.
But one developer at my side show me that is possible to get same 100000 records shown in about 2 minutes just with default values for Xmx and Xms.
Well, I needed to put my mind to work, and adapted my ReportBuilder to accept a Collection returned by OJB or a ResultSet, and now I need to obtain:
1) A Connection from OJB, and the formed query (the SELECT that OJB is generating to execute), so I can execute and pass the ResultSet to the report builder; OR
2) A ResultSet obtained after execution by OJB, and before OJB build the objects (to me, it's the ideal because I don't need to worry about statements and so on).
Some one has tips on how to do this?
Thanks,
Edson Richter
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.507 / Virus Database: 304 - Release Date: 4/8/2003
Problem storing a collection.
Posted by Michael Becke <be...@u.washington.edu>.
I am experiencing a problem when I try to store an object that contains
a collection. It seems that I am only able to create and add one object
to the collection at a time. Here are the details of my setup:
OJB cvs snapshot from yesterday (Aug 11)
WebSphere 4.0.5
DB2 7.2.6
The repository for the classes in question look like the following, with
unnecessary details removed.
<class-descriptor
class="Child"
table="SCHEMA.CHILD">
<field-descriptor
name="id"
column="ID"
jdbc-type="INTEGER"
primarykey="true"
autoincrement="true"
access="readonly"
/>
<field-descriptor
name="parentId"
column="PARENT_ID"
jdbc-type="INTEGER"
/>
</class-descriptor>
<class-descriptor
class="Parent"
table="SCHEMA.PARENT">
<field-descriptor
name="id"
column="ID"
jdbc-type="INTEGER"
primarykey="true"
autoincrement="true"
access="readonly"
/>
<collection-descriptor
name="children"
auto-retrieve="true"
auto-update="false"
auto-delete="false"
element-class-ref="Child">
<inverse-foreignkey field-ref="parentId"/>
</collection-descriptor>
</class-descriptor>
I am using DB2 identity fields for the object IDs for both of these
classes. Yes, I know this is not popular, but such is life. To support
this I am using the SequenceManagerNativeImpl (modded to remove
setReferenceFKs() as this does not seem to work properly).
My code looks like the following:
// the parent has already been saved and has a valid ID
Parent parent = someparent;
Transaction transaction = odmg.currentTransaction();
transaction.lock(parent, Transaction.WRITE);
Child child1 = new Child();
child1.setParentId(parent.getId());
parent.addChild(child1);
transaction.lock(child1, Transaction.WRITE);
Child child2 = new Child();
child2.setParentId(parent.getId());
parent.addChild(child2);
transaction.lock(child2, Transaction.WRITE);
After this I commit the transaction but only the first child is stored.
Any thoughts?
Thanks,
Mike
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org