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 Gunnar Hilling <ne...@hilling.de> on 2003/10/10 00:55:06 UTC

odmg/caching problem?

Hello,
 
I got the following small program (snippet):

	Customer customer=new Customer("no", "one", "here", "0", "", 2, null);
	tx = odmg.newTransaction();
	tx.begin();
	db.makePersistent(new Certificate("Z1\n", customer));
	db.makePersistent(customer);
	tx.commit();

	DList allProducts = (DList) query.execute();
	Iterator iter = allProducts.iterator();
	while (iter.hasNext())
	{
		customer=(Customer)iter.next();
		System.out.println(customer.getBenutzername() + ": " +
		customer.getCertificates().size());
	}

I think the Details don't matter: One Customer can have many Certificates
(1:n relationsship, navigatable in both directions here).

Now the Problem:

The Certificate created for the Customer is NOT listed in the first run of
the program, output:

1065740029439: 0
done!

When running the program for a second time, the records created in the
first run are read correctly, output this time:

1065740029439: 1
1065740078144: 0
done!

... and so on.
Anyone any clues?

Thanks a lot,

-Gunnar



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: odmg/caching problem?

Posted by Gunnar Hilling <ne...@hilling.de>.
Additional Detail:

Bothe the customer and the certificate are available when being created,
only the relation (Collection) of the newly created customer is not
updated when querying ...

> Hello,
>  
> I got the following small program (snippet):
> 
> 	Customer customer=new Customer("no", "one", "here", "0", "", 2, null);
> 	tx = odmg.newTransaction();
> 	tx.begin();
> 	db.makePersistent(new Certificate("Z1\n", customer));
> 	db.makePersistent(customer);
> 	tx.commit();
> 
> 	DList allProducts = (DList) query.execute();
> 	Iterator iter = allProducts.iterator();
> 	while (iter.hasNext())
> 	{
> 		customer=(Customer)iter.next();
> 		System.out.println(customer.getBenutzername() + ": " +
> 		customer.getCertificates().size());
> 	}
> 
> I think the Details don't matter: One Customer can have many Certificates
> (1:n relationsship, navigatable in both directions here).
> 
> Now the Problem:
> 
> The Certificate created for the Customer is NOT listed in the first run of
> the program, output:
> 
> 1065740029439: 0
> done!
> 
> When running the program for a second time, the records created in the
> first run are read correctly, output this time:
> 
> 1065740029439: 1
> 1065740078144: 0
> done!
> 
> ... and so on.
> Anyone any clues?
> 
> Thanks a lot,
> 
> -Gunnar



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org