Hi Francis,
When open database (acquire from pool) property
ODatabaseRecordThreadLocal.INSTANCE
is automatically set.
Acquiring connection from poo is cheap operation, so you can do something
like:
OObjectDatabaseTx db = OObjectDatabasePool.global().acquire(dbURL,dbUser,
dbPwd);
try {
} finally {
db.close();
}

In your methods without performance loss.


On Mon, Jan 27, 2014 at 12:00 AM, Francis West <[email protected]> wrote:

> Hello I am trying to use OObjectDatabaseTx with a webapp, i thought i
> might follow the example in the documentation but just use the
> OObjectDatabasePool to get a OObjectDatabaseTx,
>
> so something like:
>
> OObjectDatabaseTx db = OObjectDatabasePool.global().acquire(dbURL,dbUser,
> dbPwd);
> ODatabaseRecordThreadLocal.INSTANCE.set(db.getUnderlying());
>
> it seems I can't put the OObjectDatabaseTx db object in the ThreadLocal so
> i have to use the getUnderlying() method,
>
> where I am stuck is creating myself an OObjectDatabaseTx outside of my
> servlet filter:
>
>
> ODatabaseDocument localdbthread = (ODatabaseDocument)
> ODatabaseRecordThreadLocal.INSTANCE.get();
>
> i assume i need to do something more to turn localdbthread back into a
> OObjectDatabaseTx  or create an instance of OObjectDatabaseTx using
> ODatabaseDocument?
>
> Thanks in advance
> Francis
>
>
>  --
>
> ---
> 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/groups/opt_out.
>



-- 
Best regards,
Andrey Lomakin.

Orient Technologies
the Company behind OrientDB

-- 

--- 
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/groups/opt_out.

Reply via email to