The problem was reported two times in the last few weeks. I didn't have
chance to look at it until today.
But, thank for the report.
Thomas
-----Original Message-----
>From: Jon Barber [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, September 20, 2001 12:07 PM
>To: [EMAIL PROTECTED]
>Subject: [castor-dev] Newbie question about 1 to many auto loading problems
>
>Dear All,
>
>This is driving me nuts - I must be doing somethin wrong surely ? I'm just
>trying to load some objects previously stored to a database, but I'm
finding
>that the rows in the second table representing the Vecto elements are
>deleted in a most odd way. Surely these rows should be left alone ?
Please
>help...
>
>Attached is the database & mapping xml files, which are adapted from the
>examples, and below is the relevant methods from VectorTest with sample
>output - the behaviour is seen after the second execution, but it happens
>with a more complex program I'm doing with the same behaviour.
>
>
> void populateDB( PrintWriter writer )
> throws Exception
> {
> Database db;
> Product product;
> ProductDetail detail;
>
> db = _jdo.getDatabase();
>
> db.begin();
> writer.println( "Begin transaction" );
>
> product = new Product();
> product.setName( "Greenhouse" );
> writer.println( "Creating new product: " + product );
>
> detail = new ProductDetail();
> detail.setName("Glass");
> product.addDetail(detail);
>
> detail = new ProductDetail();
> detail.setName("Door");
> product.addDetail(detail);
>
>
> db.create( product );
>
>
> product = new Product();
> product.setName( "Vegetable" );
> writer.println( "Creating new product: " + product );
>
> detail = new ProductDetail();
> detail.setName("colour");
> product.addDetail(detail);
>
> detail = new ProductDetail();
> detail.setName("shape");
> product.addDetail(detail);
>
> db.create( product );
>
> writer.println( "Commit transaction" );
> db.commit();
>
> db.close();
> }
>
>
>
> void queryDB( PrintWriter writer )
> throws Exception
> {
> Database db;
> Product product;
> ProductDetail detail;
> OQLQuery productOql;
> QueryResults results;
>
> db = _jdo.getDatabase();
>
> db.begin();
>
> writer.println( "Begin transaction" );
>
> // Look up the product and if found in the database,
> // delete this object from the database
> productOql = db.getOQLQuery( "SELECT p FROM test.Product p " );
> results = productOql.execute();
> while ( results.hasMore() ) {
> product = (Product) results.next();
> writer.println( "Found this product : " + product );
> writer.println(product.getDetails());
> }
>
>
> db.commit();
>
> db.close();
> }
>
>
>
>
>
>F:\JBuilder4\jdk1.3\bin\javaw -classpath
>"F:\work\castor\CastorTest\classes;F:\castor-0.9.3src\castor-0.9.3\lib\serv
l
>et.jar;F:\castor-0.9.3src\castor-0.9.3\lib\jndi_1.2.1.jar;F:\castor-0.9.3sr
c
>\castor-0.9.3\lib\ant1_3.jar;F:\castor-0.9.3src\castor-0.9.3\lib\jakarta-re
g
>exp-1.1.jar;F:\castor-0.9.3src\castor-0.9.3\lib\xslp_1.1d.jar;F:\castor-0.9