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 Frédéric Trifiro <li...@trifiro.net> on 2003/08/28 18:20:32 UTC

Pbl with OQLQuery and persistent store...

Hi everyone,

It seems that i have a problem, a very strange behaviour of my application 
using OJB. I have a list that comes from the database. The first time i load it 
and print into the JSP, all works fine. But, when i have to reload the list, it 
seems that the list now comes from memory and not from the database anymore... 
As some columns of my list have to be formatted, the result on the screen 
becomes absolutely incoherent... What am i doing wrong ? 

I'm using ODMG API and my query is an OQLQuery...

Please help...

Frederic

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


Re: Identity Problems.

Posted by Stefan Schlösser <ss...@intermediate.de>.
Armin Waibel wrote:

> If you have a PB-leak, make sure that after use all PB instances
> were closed (broker.close() call).

Hi,

I had the same problem/error message and sure enough there was a leak. I 
implemented a counter of instances each time I borrowed a connection and 
monitored that regularly using an extra thread ... it gave the clue ....

With each borrow I always include

finally{
             releaseBroker(broker);
         }

Which calls my own method to release it and update the counter. This 
ensures close even if an exception occurs.

Never had any problems since (we have something like 20-30 concurrent 
users).

Cheers,
  Stefan





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


Re: Identity Problems.

Posted by Armin Waibel <ar...@code-au-lait.de>.
Please, can you post the whole stack trace
to make things clearer?

Armin
----- Original Message -----
From: "Armin Waibel" <ar...@code-au-lait.de>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Monday, September 01, 2003 3:14 PM
Subject: Re: Identity Problems.


> Hi Onno,
>
> seems like a PB leak or a to small PB-pool
> (OJB.properties maxActive=xxx, default was 100).
>
> If you set log-level for org...broker.PersistenceBrokerFactoryImpl
> to 'info', OJB prints a message when does create a new PB instance
> (rc4, earlier versions give it a try).
> If you have a PB-leak, make sure that after use all PB instances
> were closed (broker.close() call).
>
> > suggested a problem with the Sequence Manager.
> >
> which SequenceManager implementation do you use?
>
> regards,
> Armin
>
> ----- Original Message -----
> From: "onno" <on...@onnos.com>
> To: "OJB Users List" <oj...@db.apache.org>
> Sent: Monday, September 01, 2003 12:55 PM
> Subject: Identity Problems.
>
>
> > Hiya!
> >
> > We've been using OJB for quite some time now, and had no problems ,
> but
> > recently the amount of people using it has increased and we get this
> error:
> >
> > "Could not init Identity for given object class
> > x.form.CompanyPresentationBooking: Borrow broker from
> > pool failed"
> >
> > I should tell you that the website running Tomcat shares the (mySQL)
> > database with
> > 2 or more directly connected Java Clients.  My fellow developper has
> > suggested a problem with the Sequence Manager.
> >
> > Maybe one of youz has encountered this message and knows where the
> problem
> > is likely to be - if we restart the website (Tomcat) the problem
> dissappear
> > for a bit but then returns after...
> >
> > Onno
> >
> >
> >
> >
>
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> > For additional commands, e-mail: ojb-user-help@db.apache.org
> >
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
>



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


Re: Identity Problems.

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

seems like a PB leak or a to small PB-pool
(OJB.properties maxActive=xxx, default was 100).

If you set log-level for org...broker.PersistenceBrokerFactoryImpl
to 'info', OJB prints a message when does create a new PB instance
(rc4, earlier versions give it a try).
If you have a PB-leak, make sure that after use all PB instances
were closed (broker.close() call).

> suggested a problem with the Sequence Manager.
>
which SequenceManager implementation do you use?

regards,
Armin

----- Original Message -----
From: "onno" <on...@onnos.com>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Monday, September 01, 2003 12:55 PM
Subject: Identity Problems.


> Hiya!
>
> We've been using OJB for quite some time now, and had no problems ,
but
> recently the amount of people using it has increased and we get this
error:
>
> "Could not init Identity for given object class
> x.form.CompanyPresentationBooking: Borrow broker from
> pool failed"
>
> I should tell you that the website running Tomcat shares the (mySQL)
> database with
> 2 or more directly connected Java Clients.  My fellow developper has
> suggested a problem with the Sequence Manager.
>
> Maybe one of youz has encountered this message and knows where the
problem
> is likely to be - if we restart the website (Tomcat) the problem
dissappear
> for a bit but then returns after...
>
> Onno
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
>



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


Identity Problems.

Posted by onno <on...@onnos.com>.
Hiya!

We've been using OJB for quite some time now, and had no problems , but
recently the amount of people using it has increased and we get this error:

"Could not init Identity for given object class
x.form.CompanyPresentationBooking: Borrow broker from
pool failed"

I should tell you that the website running Tomcat shares the (mySQL)
database with
2 or more directly connected Java Clients.  My fellow developper has
suggested a problem with the Sequence Manager.

Maybe one of youz has encountered this message and knows where the problem
is likely to be - if we restart the website (Tomcat) the problem dissappear
for a bit but then returns after...

Onno




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


Re: updating using SQL ansi & udfs

Posted by Jason Pyeron <ja...@pyeron.com>.
On Mon, 1 Sep 2003, Roland Carlsson wrote:

> Why should you use sql when OJB handles the situation without any problem? 
> http://db.apache.org/ojb/tutorial1.html scroll down to "Updating Objects".
> 
> From: "Jason Pyeron" <ja...@pyeron.com>
> Sent: Sunday, August 31, 2003 10:31 PM
> 
> >  UPDATE table_name SET date_col=NOW() WHERE id=###;
> > 
> > How should this be done under OJB?


my question was how can I use UDF's and other functions which the results 
are not able to be generated by the VM or any code running on it.


IE:


 obj.setName("bob smith");
 obj.setSpecialField(new SQLInline("MyUDF()"));


does anyone even know how to do this through update-able result-sets?

-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-                                                               -
- Jason Pyeron                   http://www.pyerotechnics.com   -
- Partner & Sr. Manager         Pyerotechnics Development, Inc. -
-                               500 West University Parkway #1S -
- +1 (410) 808-6646             Baltimore, Maryland  21210-3253 -
-                                                               -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

This message is for the designated recipient only and may contain 
privileged, proprietary, or otherwise private information. If you 
have received it in error, purge the message from your system and 
notify the sender immediately.  Any other use of the email by you 
is prohibited.




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


Re: updating using SQL ansi & udfs

Posted by Roland Carlsson <ma...@javalia.se>.
Why should you use sql when OJB handles the situation without any problem? 
http://db.apache.org/ojb/tutorial1.html scroll down to "Updating Objects".

Regards
Roland Carlsson

----- Original Message ----- 
From: "Jason Pyeron" <ja...@pyeron.com>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Sunday, August 31, 2003 10:31 PM
Subject: updating using SQL ansi & udfs


> To the list:
> 
> If I could do a SQL update of the like:
> 
>  UPDATE table_name SET date_col=NOW() WHERE id=###;
> 
> How should this be done under OJB?
> 
> 
> Sincerely,
> 
> Jason Pyeron
> 
> -- 
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> -                                                               -
> - Jason Pyeron                   http://www.pyerotechnics.com   -
> - Partner & Sr. Manager         Pyerotechnics Development, Inc. -
> -                               500 West University Parkway #1S -
> - +1 (410) 808-6646             Baltimore, Maryland  21210-3253 -
> -                                                               -
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> 
> This message is for the designated recipient only and may contain 
> privileged, proprietary, or otherwise private information. If you 
> have received it in error, purge the message from your system and 
> notify the sender immediately.  Any other use of the email by you 
> is prohibited.
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 


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


updating using SQL ansi & udfs

Posted by Jason Pyeron <ja...@pyeron.com>.
To the list:

If I could do a SQL update of the like:

 UPDATE table_name SET date_col=NOW() WHERE id=###;

How should this be done under OJB?


Sincerely,

Jason Pyeron

-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-                                                               -
- Jason Pyeron                   http://www.pyerotechnics.com   -
- Partner & Sr. Manager         Pyerotechnics Development, Inc. -
-                               500 West University Parkway #1S -
- +1 (410) 808-6646             Baltimore, Maryland  21210-3253 -
-                                                               -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

This message is for the designated recipient only and may contain 
privileged, proprietary, or otherwise private information. If you 
have received it in error, purge the message from your system and 
notify the sender immediately.  Any other use of the email by you 
is prohibited.




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


Re: Pbl with OQLQuery and persistent store...

Posted by Roland Carlsson <ma...@javalia.se>.
I don't know what solotion that is the best one. I guess that unless the
arcives have something to offer you have to try to find out by your own.
Please share you findings

Regards
Roland

----- Original Message ----- 
From: "Frédéric Trifiro" <li...@trifiro.net>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Thursday, August 28, 2003 11:15 PM
Subject: Re: Pbl with OQLQuery and persistent store...


> Hi Roland (and others) !
>
> Oh, thank you, it has to be the good way to solve my problem !!
>
> I think about 3 solutions :
> 1/  specify that i don't use a cache in the ojb.properties
> 2/  create a new class for describing my list. Doing so, there won't be
> interaction between objects from the database and objects formatted for my
list.
> 3/ remove manually objects from the cache ? Is it possible with ODMG API ?
>
> Which solution is the best ? The easiest also ?
>
> Thanks again, your help has already been very useful :)
>
> Good night !
>
> Fred
>
> En réponse à Roland Carlsson <ma...@javalia.se>:
>
> > Hi!
> >
> > You need to look at:
> > http://db.apache.org/ojb/objectcache.html
> > and read a little. Perhaps the text about isolation in
> > http://db.apache.org/ojb/repository.html
> > can get you a little bit further.
> >
> > Regards
> > Roland Carlsson
> >
> > ----- Original Message ----- 
> > From: "Frédéric Trifiro" <li...@trifiro.net>
> > To: <oj...@db.apache.org>
> > Sent: Thursday, August 28, 2003 6:20 PM
> > Subject: Pbl with OQLQuery and persistent store...
> >
> >
> > > Hi everyone,
> > >
> > > It seems that i have a problem, a very strange behaviour of my
> > application
> > > using OJB. I have a list that comes from the database. The first time
> > i
> > load it
> > > and print into the JSP, all works fine. But, when i have to reload
> > the
> > list, it
> > > seems that the list now comes from memory and not from the database
> > anymore...
> > > As some columns of my list have to be formatted, the result on the
> > screen
> > > becomes absolutely incoherent... What am i doing wrong ?
> > >
> > > I'm using ODMG API and my query is an OQLQuery...
> > >
> > > Please help...
> > >
> > > Frederic
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> > > For additional commands, e-mail: ojb-user-help@db.apache.org
> > >
> > >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> > For additional commands, e-mail: ojb-user-help@db.apache.org
> >
> >
>
>
>
> ---------------------------------------------
> Résonance > http://www.resonance-online.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>



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


Re: Pbl with OQLQuery and persistent store...

Posted by Frédéric Trifiro <li...@trifiro.net>.
Hi Roland (and others) !

Oh, thank you, it has to be the good way to solve my problem !! 

I think about 3 solutions :
1/  specify that i don't use a cache in the ojb.properties
2/  create a new class for describing my list. Doing so, there won't be 
interaction between objects from the database and objects formatted for my list.
3/ remove manually objects from the cache ? Is it possible with ODMG API ?

Which solution is the best ? The easiest also ?

Thanks again, your help has already been very useful :)

Good night !

Fred

En réponse à Roland Carlsson <ma...@javalia.se>:

> Hi!
> 
> You need to look at:
> http://db.apache.org/ojb/objectcache.html
> and read a little. Perhaps the text about isolation in
> http://db.apache.org/ojb/repository.html
> can get you a little bit further.
> 
> Regards
> Roland Carlsson
> 
> ----- Original Message ----- 
> From: "Frédéric Trifiro" <li...@trifiro.net>
> To: <oj...@db.apache.org>
> Sent: Thursday, August 28, 2003 6:20 PM
> Subject: Pbl with OQLQuery and persistent store...
> 
> 
> > Hi everyone,
> >
> > It seems that i have a problem, a very strange behaviour of my
> application
> > using OJB. I have a list that comes from the database. The first time
> i
> load it
> > and print into the JSP, all works fine. But, when i have to reload
> the
> list, it
> > seems that the list now comes from memory and not from the database
> anymore...
> > As some columns of my list have to be formatted, the result on the
> screen
> > becomes absolutely incoherent... What am i doing wrong ?
> >
> > I'm using ODMG API and my query is an OQLQuery...
> >
> > Please help...
> >
> > Frederic
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> > For additional commands, e-mail: ojb-user-help@db.apache.org
> >
> >
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 



---------------------------------------------
Résonance > http://www.resonance-online.com

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


Re: Pbl with OQLQuery and persistent store...

Posted by Roland Carlsson <ma...@javalia.se>.
Hi!

You need to look at:
http://db.apache.org/ojb/objectcache.html
and read a little. Perhaps the text about isolation in
http://db.apache.org/ojb/repository.html
can get you a little bit further.

Regards
Roland Carlsson

----- Original Message ----- 
From: "Frédéric Trifiro" <li...@trifiro.net>
To: <oj...@db.apache.org>
Sent: Thursday, August 28, 2003 6:20 PM
Subject: Pbl with OQLQuery and persistent store...


> Hi everyone,
>
> It seems that i have a problem, a very strange behaviour of my application
> using OJB. I have a list that comes from the database. The first time i
load it
> and print into the JSP, all works fine. But, when i have to reload the
list, it
> seems that the list now comes from memory and not from the database
anymore...
> As some columns of my list have to be formatted, the result on the screen
> becomes absolutely incoherent... What am i doing wrong ?
>
> I'm using ODMG API and my query is an OQLQuery...
>
> Please help...
>
> Frederic
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>



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