try this :
OObjectDatabasePool pool = new OObjectDatabasePool(getUrl(), getUsername(),
getPassword());
pool.setup(minPoolSize, maxPoolSize);
OObjectDatabaseTx db = pool.acquire();
OObjectDatabasePool is Deprecated
thanks
On Sunday, 27 December 2015 17:47:12 UTC+5:30, Erik Pragt wrote:
>
> Hi,
>
> Thanks for your reply. I know the OObjectDatabaseTx is used for the Object
> API, that's what I'm using, but that doesn't my question on how to use the
> connection pool for the object API.
>
> Cheers, Erik
>
>
> On Sunday, December 27, 2015 at 12:39:46 PM UTC+1, [email protected]
> wrote:
>>
>> Hi Erik,
>>
>> I am not expert but i believe it is not right way to use.
>>
>> OObjectDatabaseTx : it should be use for object API.
>> for Graph API you should use : OrientGraphFactory, OrientGraph
>>
>> Thanks
>>
>>
>>
>> On Sunday, 27 December 2015 06:25:55 UTC+5:30, Erik Pragt wrote:
>>>
>>> Hi /m,
>>>
>>> I tested this, and it doesn't work :-(
>>>
>>> I was using this:
>>> OObjectDatabaseTx acquire = OObjectDatabasePool.global().acquire();,
>>>
>>> but it's deprected. Now I have to use this:
>>>
>>> OPartitionedDatabasePool oPartitionedDatabasePool = new
>>> OPartitionedDatabasePool("x", "x", "y");
>>> ODatabaseDocumentTx acquire1 = oPartitionedDatabasePool.acquire();
>>>
>>>
>>> But that's returning a ODatabaseDocumentTx, while I need an
>>> OObjectDatabaseTx.
>>>
>>>
>>> The only workaround I've found so far, is to use this:
>>>
>>>
>>> OPartitionedDatabasePool oPartitionedDatabasePool = new
>>> OPartitionedDatabasePool("x", "x", "y");
>>> OObjectDatabaseTx acquire1 = new
>>> OObjectDatabaseTx(oPartitionedDatabasePool.acquire());
>>>
>>>
>>> But it looks like a pretty expensive operation, if I look at the
>>> sourcecode. Is this the way to go?
>>>
>>>
>>> Thanks,
>>>
>>> Erik
>>>
>>>
>>>
>>>
>>>
>>> On Saturday, December 26, 2015 at 10:22:05 PM UTC+1, machak wrote:
>>>>
>>>> Hi Eric,
>>>>
>>>>
>>>> On Saturday, December 26, 2015 at 7:58:38 PM UTC+1, Erik Pragt wrote:
>>>>>
>>>>> Btw, even the documentation, as listed here:
>>>>> http://orientdb.com/docs/2.0/orientdb.wiki/Document-Database.html,
>>>>> still recommends using the deprecated ODatabaseDocumentPool.global()
>>>>> code.
>>>>> Is this correct?
>>>>>
>>>>> you could use:
>>>>
>>>> pool = new OPartitionedDatabasePool(getUrl(), getUsername(),
>>>> getPassword(), getMaxPoolSize());
>>>>
>>>>
>>>> public ODatabaseDocumentTx openDatabase() {
>>>> return pool.acquire();
>>>> }
>>>>
>>>>
>>>>
>>>> cheers
>>>> /m
>>>>
>>>> On Saturday, December 26, 2015 at 7:34:28 PM UTC+1, Erik Pragt wrote:
>>>>>>
>>>>>> Hi all,
>>>>>>
>>>>>> I was wondering, what's the correct way of using connections to an
>>>>>> OrientDB from my Java webapp? According to the OrientDB book, it's to
>>>>>> use
>>>>>> ODatabaseDocumentPool.global(), which is deprectated. Currently, I
>>>>>> just create a new connection every time, something like this:
>>>>>>
>>>>>>
>>>>>> public void setUserName(String name) {
>>>>>>
>>>>>> ODatabaseDocumentTx db = new
>>>>>> ODatabaseDocumentTx("remote:localhost/demo").open("demo", "demo")
>>>>>> db.command(new OCommandSQL("update User set name=?")).execute(name);
>>>>>> db.close();
>>>>>>
>>>>>> }
>>>>>>
>>>>>>
>>>>>> But this seems hardly the best way. What's the idiomatic way of handling
>>>>>> connections in OrientDB?
>>>>>>
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>>
>>>>>> Erik
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
--
---
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.