You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Alexander Prozor <ap...@isd.dp.ua> on 2003/06/05 09:45:15 UTC

Re[2]: ODMG intialization.

Hello Armin,
Ok, but I still have problem with Active connections.
Try to take example,
when I set activeconnections = 10.
I can open my page for a 3 times before server crashed ( it contains
some db call ).
when I set activeconnections = 40 I can do it for 10 times :).
and so on.
so I am think that I should release connection somewhere.
but where?

>>   connections. ( I also call db.close() after each operations ).
AW> is not necessary. Close the database only before open another.

>> > Or I just call db.open(...) the first time?
AW> yep, that's recommended

>> > It's is possible to share db among the different threads?
AW> yep!

>> > Should I close something at any time, apart committing/aborting
>> > transactions?
AW> no

AW> Using in multithreaded environment this could be
AW> done only once:

AW> Implementation odmg = OJB.getInstance();
AW> Database db = odmg.newDatabase();
AW> db.open(dbName, Database.OPEN_READ_WRITE);

AW> Implementation class is threadsafe.

AW> HTH
AW> regards,
AW> Armin

AW> ----- Original Message -----
AW> From: "Alexander Prozor" <ap...@isd.dp.ua>
AW> To: "OJB Users List" <oj...@db.apache.org>
AW> Sent: Thursday, June 05, 2003 8:52 AM
AW> Subject: ODMG intialization.


>> Hello ,
>>   I can't find answer for this question...
>>   But I have a some strange trouble and it looks like I didn't close
>>   connections. ( I also call db.close() after each operations ).
>>   Should I call another finalized methods?
>>
>>   thank you.
>>
>>
>> > From: Mauricio CASTRO <mc...@hotmail.com>
>> > To: ojb-user@db.apache.org
>> > Date: Saturday, May 24, 2003, 10:30:52 PM
>>
>> > If I am using ODMG in a multithreaded application. Should I call for
AW> each
>> > thread the following code?
>> >
>> >     Implementation instance = OJB.getInstance();
>> >     Database db = instance.newDatabase();
>> >     file://open database
>> >     db.open(dbName, Database.OPEN_READ_WRITE);
>> >     odmg.set(instance);
>> >
>> > Or I just call db.open(...) the first time?
>> > It's is possible to share db among the different threads?
>> > Should I close something at any time, apart committing/aborting
>> > transactions?
>>
>>
>>
>> --
>> Best regards,
>>  Alexander                          mailto:apro@isd.dp.ua
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>> For additional commands, e-mail: ojb-user-help@db.apache.org
>>
>>
>>



AW> ---------------------------------------------------------------------
AW> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
AW> For additional commands, e-mail: ojb-user-help@db.apache.org



-- 
Best regards,
 Alexander                            mailto:apro@isd.dp.ua


Re[5]: ODMG intialization.

Posted by Alexander Prozor <ap...@isd.dp.ua>.
I got such log...
[org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl] INFO: Destroy object was called, try to close connection: oracle.jdbc.driver.OracleConnection@77e9d2fb
[org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl] INFO: OptimisticLockException was thrown, will try again to store sequence. Sequence was org.apache.ojb.broker.util.sequence.HighLowSequence@7b28d2fb[tableName=SEQ_OJB_DLIST_ENTRIES,fieldName=ID,grabSize=20,version=12186,maxKey=243720,currentKey=243700]
[org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl] INFO: Destroy object was called, try to close connection: oracle.jdbc.driver.OracleConnection@9f412f7
[org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl] INFO: Destroy object was called, try to close connection: oracle.jdbc.driver.OracleConnection@272652f7
[org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl] INFO: OptimisticLockException was thrown, will try again to store sequence. Sequence was org.apache.ojb.broker.util.sequence.HighLowSequence@183b12f7[tableName=SEQ_OJB_DLIST_ENTRIES,fieldName=ID,grabSize=20,version=12188,maxKey=243760,currentKey=243740]
[org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl] INFO: Destroy object was called, try to close connection: oracle.jdbc.driver.OracleConnection@192292f5
[org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl] INFO: Destroy object was called, try to close connection: oracle.jdbc.driver.OracleConnection@3a0812f5


-- 
Best regards,
 Alexander                            mailto:apro@isd.dp.ua


Re[4]: ODMG intialization.

Posted by Alexander Prozor <ap...@isd.dp.ua>.
Hello Armin,
OJB 1 Rc3,
I use Oracle, and I've tried both driver ( thin and oci8 ).
result the same,
when I set repository_database.xml
        <connection-pool
            maxActive="10"
            maxIdle="-1"
            maxWait="3"
            minEvictableIdleTimeMillis="4"
            numTestsPerEvictionRun="5"
            testOnBorrow="true"
            testOnReturn="true"
            testWhileIdle="true"
            timeBetweenEvictionRunsMillis="6"
            whenExhaustedAction="2"
            logAbandoned="true"

whenExhaustedAction = 2, it's works...not completely but works, so I
think that problem with non closed connection.

AW> sounds strange! Could you give some more information.
AW> Code snip, OJB version, repository_database.xml
AW> file.

-- 
Best regards,
 Alexander                            mailto:apro@isd.dp.ua


Re: Re[2]: ODMG intialization.

Posted by Armin Waibel <ar...@code-au-lait.de>.
Hi,

sounds strange! Could you give some more information.
Code snip, OJB version, repository_database.xml
file.

regards,
Armin

----- Original Message -----
From: "Alexander Prozor" <ap...@isd.dp.ua>
To: "OJB Users List" <oj...@db.apache.org>; "Armin Waibel"
<ar...@code-au-lait.de>
Sent: Thursday, June 05, 2003 9:45 AM
Subject: Re[2]: ODMG intialization.


> Hello Armin,
> Ok, but I still have problem with Active connections.
> Try to take example,
> when I set activeconnections = 10.
> I can open my page for a 3 times before server crashed ( it contains
> some db call ).
> when I set activeconnections = 40 I can do it for 10 times :).
> and so on.
> so I am think that I should release connection somewhere.
> but where?
>
> >>   connections. ( I also call db.close() after each operations ).
> AW> is not necessary. Close the database only before open another.
>
> >> > Or I just call db.open(...) the first time?
> AW> yep, that's recommended
>
> >> > It's is possible to share db among the different threads?
> AW> yep!
>
> >> > Should I close something at any time, apart committing/aborting
> >> > transactions?
> AW> no
>
> AW> Using in multithreaded environment this could be
> AW> done only once:
>
> AW> Implementation odmg = OJB.getInstance();
> AW> Database db = odmg.newDatabase();
> AW> db.open(dbName, Database.OPEN_READ_WRITE);
>
> AW> Implementation class is threadsafe.
>
> AW> HTH
> AW> regards,
> AW> Armin
>
> AW> ----- Original Message -----
> AW> From: "Alexander Prozor" <ap...@isd.dp.ua>
> AW> To: "OJB Users List" <oj...@db.apache.org>
> AW> Sent: Thursday, June 05, 2003 8:52 AM
> AW> Subject: ODMG intialization.
>
>
> >> Hello ,
> >>   I can't find answer for this question...
> >>   But I have a some strange trouble and it looks like I didn't
close
> >>   connections. ( I also call db.close() after each operations ).
> >>   Should I call another finalized methods?
> >>
> >>   thank you.
> >>
> >>
> >> > From: Mauricio CASTRO <mc...@hotmail.com>
> >> > To: ojb-user@db.apache.org
> >> > Date: Saturday, May 24, 2003, 10:30:52 PM
> >>
> >> > If I am using ODMG in a multithreaded application. Should I call
for
> AW> each
> >> > thread the following code?
> >> >
> >> >     Implementation instance = OJB.getInstance();
> >> >     Database db = instance.newDatabase();
> >> >     file://open database
> >> >     db.open(dbName, Database.OPEN_READ_WRITE);
> >> >     odmg.set(instance);
> >> >
> >> > Or I just call db.open(...) the first time?
> >> > It's is possible to share db among the different threads?
> >> > Should I close something at any time, apart committing/aborting
> >> > transactions?
> >>
> >>
> >>
> >> --
> >> Best regards,
> >>  Alexander                          mailto:apro@isd.dp.ua
> >>
> >>
>
>> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> >> For additional commands, e-mail: ojb-user-help@db.apache.org
> >>
> >>
> >>
>
>
>
>
AW> --------------------------------------------------------------------
-
> AW> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> AW> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
>
> --
> Best regards,
>  Alexander                            mailto:apro@isd.dp.ua
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
>