Hi,

You must call close() to return connection to the pool.
Class registration is not required for each connection. Do it just once.
I suppose ORecordId in the example above is not your class. 
Don't register orient classes - orient will do it for you. Nothing bad will 
happen, it's simply useless.

If you work with remote connection you may need to call 
db.getMetadata().getSchema().synchronizeSchema() to force schema update on 
server 
(not required, just remember in case if you will have problems with schema).


воскресенье, 21 июня 2015 г., 15:30:31 UTC+6 пользователь Chaitanya Reddy 
написал:
>
> Hi
>
> Currently, I am using following code to get the *OObjectDatabaseTx. *I 
> call this in every request, but never call *OObjectDatabaseTx.close().* 
>
> Am I doing it right? Could any one please explain about the pool. How will 
> it manage the connections.
>
> Thanks in advance.
>
> *public static OObjectDatabaseTx getOODb() {*
> *  if (ooPool == null) {*
> *    ooPool = new OObjectDatabasePool("remote:localhost/xxxxx", "xxxxx", 
> "xxxxx!3");*
> *  }*
> *  OObjectDatabaseTx oDb = ooPool.acquire();*
> *  oDb.getEntityManager().registerEntityClasses(*
> *                    "com.xxxx.commons.model");*
> *  oDb.getEntityManager().registerEntityClass(ORecordId.class);*
> *  return oDb;*
> *}*
>
> Thank you
> Chaitanya
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to