Re: Object is not (yet) associated to a database container

Leo Mekenkamp <[email protected]>
Newsgroups gmane.comp.java.ozone.user
Message-ID <1078234246.27121.13.camel@mars>
On Tue, 2004-03-02 at 14:10, Sunil Goyal wrote:
> Hello Leo,
> 
> I was getting the error because I was constructing
> ozone objects just using a constructor.
> 
> public class FooImpl extends OzoneObject implements OzoneRemote {
> 
>      private Object o;
>      public FooImpl() {
>         o = new Object();
>      }
> }
> 
> This doesn't gave me error.
> 
> Even when I try to create an object
> new FooImpl() , this is ok .

No, it's not :-)

You cannot create an ozone object and then try to store it in the
database; you can only create an object in the database.

In the real world this means that you should never construct an ozone
object yourself (by calling the constructor); you should always go
through database() or the factory method on a proxy or a factory class'
create() method.

Cheers,
Leo




-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.