Re: I got message "can't looking for object..." when I restart ozone

Ozone Apirak <[email protected]>
Newsgroups gmane.comp.java.ozone.user
Message-ID <[email protected]>
Thank you for your reply :)

I am sorry, that I did not put this in the first time. This is full 
source code of init and main method. I attach full source in 
testozone.tar.gz with this mail already.

You can check MetBroker Project from "http://www.agmodel.net/MetBroker/"
this is project for connect world weather database together. I working 
to change matadata  from commercial oodb to ozone. and move MetBroker 
to Grid Infrastructure.

     public void init(OzoneInterface database){
         db = database;

         String name = MetCollectionImpl.class.getName();

         Object obj = null;

         try{
           System.out.println("looking Object name "+ObjName+" from db");
           obj = db.objectForName(ObjName);
           metc = (MetCollection)obj;
           System.out.println("get "+metc.getName()+" read ");          
testRead();
           testReadComplicate();          testDelete();

         }catch(Exception e){
           try { //Create new DB
               System.out.println("can't looking for object because: 
"+e);
               obj = db.createObject(name, 0,ObjName);
               System.out.println("create obj name:"+ obj);

               metc = (MetCollection) obj;

               metc.setName("OzoneMetBroker2");
               System.out.println("ObjectDB name: "+metc.getName()+" was 
created by me");

               testCreate();
           } catch(Exception e2) {
               System.out.println("Can't create DB: "+ e2);
           }
         }
     }

public static void main(String[] args) throws Exception{

       System.out.println("Start Local");

       String dbDir = "/java/testozone/ozon";
       System.out.println("Opening database at "+ dbDir);
       LocalDatabase database = new LocalDatabase();      if 
(!database.exists(dbDir)){
            database.create(dbDir);
       }
       database.open(dbDir, OzoneDebugLevel.ERROR_STR);

       database.reloadClasses();
       System.out.println("connect to ozone complete: "+database);

       MetTest msi = new MetTest();
       msi.init(database);
       System.out.println("end test");
     }



Thank you very much.

Apirak Panatkool

e-mail [email protected]
phone 01-4033320
On Mar 27, 2004, at 4:49 AM, Per Nyfelt wrote:

> Hi,
> I guess you are not creating the object right.
>
> How is the MetCollection created in the first place?
>
> What is the metBroker project?
>
> Regards,
> Per
>
> fredagen den 26 mars 2004 08.19 skrev [email protected]:
>> Hi
>>
>> I working on metBroker project. I use metBroker to store all metadata.
>>
>> I can shutdown my application and reconnect database. It work very 
>> well
>> until I shutdown ozone by control+c
>>
>> I got message "can't looking for object..." when I restart ozone and 
>> try to
>> connect it again.
>>
>> what's wrong?
>>
>> this is my connecting code
>>
>>       String dbDir = "/java/testozone/ozon";
>>       System.out.println("Opening database at "+ dbDir);
>>
>>       LocalDatabase database = new LocalDatabase();
>>       if (!database.exists(dbDir)){
>>         database.create(dbDir);
>>       }
>>       database.open(dbDir, OzoneDebugLevel.ERROR_STR);
>>
>>       database.reloadClasses();
>>
>>       obj = database.objectForName("met50");
>>       metc = (MetCollection)obj;
>>
>> it return null to me :(
>>
>> Thank you.
>>
>> Apirak Pantkool
>>
>> http://hpcc.nectec.or.th/‾bank
>>
>> -------------------------------------------------
>> This mail sent through IMP: http://horde.org/imp/
>>
>>
>> -------------------------------------------------------
>> This SF.Net email is sponsored by: IBM Linux Tutorials
>> Free Linux tutorial presented by Daniel Robbins, President and CEO of
>> GenToo technologies. Learn everything from fundamentals to system
>> administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
>> _______________________________________________
>> Ozone-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/ozone-users
testozone.tar.gz (application/x-gzip, 41.4 KB) - not displayed
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.