Error : Can not init Identity for given object

2004-02-23 Thread Fernando Queiroz Fonseca
Hi.
I made download of ojb and I installed, I create the archives of repositories and I 
configured following tables in the archive repository_user.xml 





  







  

  


  

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 


  



e the archive repository_database.xml this of the following skill: 


 
 
 







however when trying to insert without set the primary key (id) that I declared as 
auto-increment occurs the following error: 
br.com.fernandoqueiroz.exceptions.ParameterException: 
org.apache.ojb.broker.metadata.ClassNotPersistenceCapableException: Can not init 
Identity for given object [EMAIL PROTECTED]
at 
br.com.fernandoqueiroz.sgbd.persistencia.OJBDaoFactory.insere(OJBDaoFactory.java:152)
at br.com.fernandoqueiroz.Teste.main(Teste.java:48)
please they help me?

---
Fernando Queiroz Fonseca
Analista e Programador Java/J2EE
Uberlândia - MG - Brasil
+55-0xx34-8801-9072
www.fernandoqueiroz.com.br
[EMAIL PROTECTED]
---

Re: single quotes in query

2004-02-23 Thread Charles N. Harvey III
Nevermind.  Its because my fields are CHAR and not INTEGER.  Can't compare
on a CHAR.  So I have to do a CONVERT(int,total_undergrad_enrollment) to get
the right results.
Sorry to bother everyone.

Charlie

Charles N. Harvey III wrote:

 The only difference in these two queries is the single quote around 
the number
in the WHERE clause.  The first one returns over 900 results and the 
second one
returns only 1.  Why such a difference?  I clearly want to be using 
the second
query, but OJB adds the single quote around WHERE parameters.  Should 
it be doing
that?  Usually it should.  Is there any way to turn it off on a 
per-query basis?

SELECT COUNT( A0.total_undergrad_enrollment )
FROM UNDERGRAD_PROFILE A0
WHERE ( A0.total_undergrad_enrollment > 1 ) AND 
A0.total_undergrad_enrollment < 1000

SELECT COUNT( A0.total_undergrad_enrollment )
FROM UNDERGRAD_PROFILE A0
WHERE ( A0.total_undergrad_enrollment > '1' ) AND 
A0.total_undergrad_enrollment < '1000'

Thanks a lot.

Charlie



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


single quotes in query

2004-02-23 Thread Charles N. Harvey III
 The only difference in these two queries is the single quote around 
the number
in the WHERE clause.  The first one returns over 900 results and the 
second one
returns only 1.  Why such a difference?  I clearly want to be using the 
second
query, but OJB adds the single quote around WHERE parameters.  Should it 
be doing
that?  Usually it should.  Is there any way to turn it off on a 
per-query basis?

SELECT COUNT( A0.total_undergrad_enrollment )
FROM UNDERGRAD_PROFILE A0
WHERE ( A0.total_undergrad_enrollment > 1 ) AND 
A0.total_undergrad_enrollment < 1000

SELECT COUNT( A0.total_undergrad_enrollment )
FROM UNDERGRAD_PROFILE A0
WHERE ( A0.total_undergrad_enrollment > '1' ) AND 
A0.total_undergrad_enrollment < '1000'

Thanks a lot.

Charlie



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Progress ?

2004-02-23 Thread Mark Berry
There are no free ones that I am aware of.
V9.1 Ships with one that works very well with OJB.
Unfortunatly you will have to generate the schema from Progress.

Regards

Mark

- Original Message - 
From: "eric barbe" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
Sent: Tuesday, February 24, 2004 6:23 AM
Subject: RE: Progress ?


> JDBC driver exists, but is there a free version ?
> And does it work with OJB ?
>
> Thanks
>
> Éric
>
> -Message d'origine-
> De : eric barbe [mailto:[EMAIL PROTECTED]
> Envoyé : lundi 23 février 2004 17:52
> À : OJB
> Objet : Progress ?
>
>
> Hi,
>
> I want to know if somebody has worked with OJB and Progress V 8.
> If yes, can this persons give me where to found the jdbc driver and mail
us
> the repository.
>
> Thanks,
>
> Éric
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: standart SQL query??

2004-02-23 Thread Gelhar, Wallace Joseph
Hi Remi,

It seems you are asking two separate questions.  

The first is asking to perform a query on a non-persistent field.  Since all 
non-identity based queries are executed on the database and the database doesn't know 
about the field, it cannot be part of an OJB query.

The second part of you question seems a little more vague.  Possibly it looks like you 
are looking for a report query.  Check out http://db.apache.org/ojb/query.html for 
more details.

Wally

-Original Message-
From: Rémi Bars [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 23, 2004 11:46 AM
To: OJB Users List
Subject: standart SQL query??


hi all

i repost my question with the good subject :)

>
> i have to do a request on non persistent field, how can i do that? 
> where
can
> i find some info?
>
> a query like standart SQL (select table.att1, table.att2, table2.att 
> from table, table1 where table.att1>0 etc)
>
> thanks for ur help
>
> Remi
> - Original Message -
> From: "eric barbe" <[EMAIL PROTECTED]>
> To: "OJB Users List" <[EMAIL PROTECTED]>
> Sent: Monday, February 23, 2004 6:23 PM
> Subject: RE: Progress ?
>
>
> > JDBC driver exists, but is there a free version ?
> > And does it work with OJB ?
> >
> > Thanks
> >
> > Éric
> >
> > -Message d'origine-
> > De : eric barbe [mailto:[EMAIL PROTECTED]
> > Envoyé : lundi 23 février 2004 17:52
> > À : OJB
> > Objet : Progress ?
> >
> >
> > Hi,
> >
> > I want to know if somebody has worked with OJB and Progress V 8. If 
> > yes, can this persons give me where to found the jdbc driver and 
> > mail
> us
> > the repository.
> >
> > Thanks,
> >
> > Éric
> >
> >
> > 
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> >
> > 
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



standart SQL query??

2004-02-23 Thread Rémi Bars
hi all

i repost my question with the good subject :)

>
> i have to do a request on non persistent field, how can i do that? where
can
> i find some info?
>
> a query like standart SQL (select table.att1, table.att2, table2.att from
> table, table1 where table.att1>0 etc)
>
> thanks for ur help
>
> Remi
> - Original Message - 
> From: "eric barbe" <[EMAIL PROTECTED]>
> To: "OJB Users List" <[EMAIL PROTECTED]>
> Sent: Monday, February 23, 2004 6:23 PM
> Subject: RE: Progress ?
>
>
> > JDBC driver exists, but is there a free version ?
> > And does it work with OJB ?
> >
> > Thanks
> >
> > Éric
> >
> > -Message d'origine-
> > De : eric barbe [mailto:[EMAIL PROTECTED]
> > Envoyé : lundi 23 février 2004 17:52
> > À : OJB
> > Objet : Progress ?
> >
> >
> > Hi,
> >
> > I want to know if somebody has worked with OJB and Progress V 8.
> > If yes, can this persons give me where to found the jdbc driver and mail
> us
> > the repository.
> >
> > Thanks,
> >
> > Éric
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Progress ?

2004-02-23 Thread Rémi Bars
hi all,

i have to do a request on non persistent field, how can i do that? where can
i find some info?

a query like standart SQL (select table.att1, table.att2, table2.att from
table, table1 where table.att1>0 etc)

thanks for ur help

Remi
- Original Message - 
From: "eric barbe" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
Sent: Monday, February 23, 2004 6:23 PM
Subject: RE: Progress ?


> JDBC driver exists, but is there a free version ?
> And does it work with OJB ?
>
> Thanks
>
> Éric
>
> -Message d'origine-
> De : eric barbe [mailto:[EMAIL PROTECTED]
> Envoyé : lundi 23 février 2004 17:52
> À : OJB
> Objet : Progress ?
>
>
> Hi,
>
> I want to know if somebody has worked with OJB and Progress V 8.
> If yes, can this persons give me where to found the jdbc driver and mail
us
> the repository.
>
> Thanks,
>
> Éric
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: deploy OJB with web application

2004-02-23 Thread marc salvetti
Robert S. Sfeir  codepuccino.com> writes:

> Actually you can put it in resin-web.xml, inside the WEB-INF along with 
> web.xml and resin will merge both on startup, so that might be a place 
> to try it.
> 
> R
> 

looks like that's solved the problem :)
here is the resin-web.xml



http://java.sun.com/j2ee/dtds/web-app_2_3.dtd";>








along with xalan.jar, xml-apis.jar and xercesImpl.jar


thanks very much to all of you, i'm back to work !

marc


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Progress ?

2004-02-23 Thread eric barbe
JDBC driver exists, but is there a free version ?
And does it work with OJB ?

Thanks

Éric

-Message d'origine-
De : eric barbe [mailto:[EMAIL PROTECTED]
Envoyé : lundi 23 février 2004 17:52
À : OJB
Objet : Progress ?


Hi,

I want to know if somebody has worked with OJB and Progress V 8.
If yes, can this persons give me where to found the jdbc driver and mail us
the repository.

Thanks,

Éric


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Progress ?

2004-02-23 Thread eric barbe
Hi,

I want to know if somebody has worked with OJB and Progress V 8.
If yes, can this persons give me where to found the jdbc driver and mail us
the repository.

Thanks,

Éric


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: deploy OJB with web application

2004-02-23 Thread Robert S. Sfeir
Thomas Dudziak wrote:

On Mon, 23 Feb 2004, marc salvetti wrote:

 

Thank you very much for this info,
i will try to install resin on my local computer to check if it works with 
theses properties. 
But for now, i'm still stuck because i can't ask my isp to change the resin 
config, as i guess it could make problems with other people app.
   

I'm not so sure about that. AFAIK, Resin allows you to put some 
non-standard (proprietary) config properties in the web.xml of your
webapp. You should definitly check the doc about that.

BTW it is always better to develop/debug a webapp using a local servlet
container first (if possible) as it gives you much more freedom for
experimentation and debugging.
 

Actually you can put it in resin-web.xml, inside the WEB-INF along with 
web.xml and resin will merge both on startup, so that might be a place 
to try it.

R

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Query with criteria - like using '%' or '_'

2004-02-23 Thread Nase, Paul R.
Jakob,

This seems to work for me.

Thanks much!!!

Paul 

-Original Message-
From: Jakob Braeuchi [mailto:[EMAIL PROTECTED] 
Sent: Saturday, February 21, 2004 3:50 PM
To: OJB Users List
Subject: Re: Query with criteria - like using '%' or '_'

hi paul,

i commited support for escaping based on your solution and additional LikeCriteria.

jakob

Nase, Paul R. wrote:

> Jakob,
> 
> Perhaps I am misunderstanding your question.  When you say "why can't 
> we add the ESCAPE to the search argument?", do you mean add it like the following?
>   criteria.addLike("*\\%* ESCAPE '\\'") // to search for any text containing
> // the '%' character.
> 
> If this is not what you mean, then I will need some clarification.
> 
> If this 'is' the case, it will not work because the desired sql statement is:
>select * from mytable where desc like ? ESCAPE '\'
>? Is a replacement var that will be replace with "%\\%%" after the
>statement is prepared.
> What adding to the search argument using the addLike as shown above, 
> it would actually produce:
>select * from mytable where desc like ?
>? Is replaced with "%\\%% ESCAPE '\\' ".  Which isn't what we want to search
>for.
> 
> Does this help?
> 
> Paul
> 
> -Original Message-
> From: Jakob Braeuchi [mailto:[EMAIL PROTECTED]
> Sent: Friday, February 20, 2004 2:49 PM
> To: OJB Users List
> Subject: Re: Query with criteria - like using '%' or '_'
> 
> hi paul,
> 
> Nase, Paul R. wrote:
> 
>>Jakob,
>>
>>
>>
>>>i just don't see why we can't construct the whole string in criteria.
>>>in appendSelectionCriteria you simply append " ESCAPE '\\' ". why 
>>>can't this be done in criteria#generateSQLSearchPattern ?
>>
>>We cannot just append this to the search pattern, because when the sql 
>>is actually generated, it is generated with replacement variables (i.e.
>>" MYCOLUMN LIKE ? ", so if we do it as part of the
>>generateSQLSearchPattern() it will then be included as part of the 
>>text to search for.  We would need the sql statement to look like " MYCOLUMN LIKE ? 
>>ESCAPE '\\' ".
> 
> 
> why can't we add the ESCAPE to the search argument ?
> 
> jakob
> 
> 
>>
>>>in this case i would transfer the pattern handling to the new LikeCriteria.
>>
>>Very good idea!
>>
>>Paul
>>
>>-Original Message-
>>From: Jakob Braeuchi [mailto:[EMAIL PROTECTED]
>>Sent: Friday, February 20, 2004 1:48 PM
>>To: OJB Users List
>>Subject: Re: Query with criteria - like using '%' or '_'
>>
>>hi paul,
>>
>>Nase, Paul R. wrote:
>>
>>
>>
>>>I don't think there are any platform issues, we aren't talking about 
>>>path names to look for files or anything like this.  We are simply 
>>>Talking about an SQL92/SQL98 feature that is not being utilized.
>>>This character could have been anything, I just so happened to pick 
>>>the '\' character because this is the most common character used for 
>>>such a thing.
>>
>>
>>well, we can try it.
>>
>>
>>>Anyways, I don't think you'll be able to fix this in one place.
>>>The string is parsed in one place, and the statement is generated in 
>>>another.  And I don't think there is a way to generate any text - 
>>>escaping or otherwise - that gives the desired results.
>>
>>
>>i just don't see why we can't construct the whole string in criteria.
>>in appendSelectionCriteria you simply append " ESCAPE '\\' ". why can't this be done 
>>in criteria#generateSQLSearchPattern ?
>>
>>
>>
>>>I admit there is probably a better way to implement this, but the 
>>>bottom line is - the like feature on the Criteria has a bug.  It will 
>>>not let you build a query to search for a '%' or a '_'.
>>>
>>>Another way you could implement this is to add another class called 
>>>LikeCriteria(All the other Criteria have one of these - why not 
>>>like?).  Then add the method SqlQueryStatement.appendLikeCriteria().
>>
>>
>>this is no problem. until now there was no need to treat like separately.
>>
>>
>>
>>>Call the new method in SqlQueryStatement.appendCriteria() when this 
>>>new LikeCriteria is encountered.  But of course, you'd still have to 
>>>parse the original string appropriately somewhere.  So in this case 
>>>you have 3 files to change - Criteria, a new LikeCriteria, and 
>>>SqlQueryStatement - instead of 2.
>>
>>
>>in this case i would transfer the pattern handling to the new LikeCriteria.
>>
>>jakob
>>
>>
>>>Paul
>>>
>>>-Original Message-
>>>From: Jakob Braeuchi [mailto:[EMAIL PROTECTED]
>>>Sent: Friday, February 20, 2004 11:45 AM
>>>To: OJB Users List
>>>Subject: Re: Query with criteria - like using '%' or '_'
>>>
>>>hi paul,
>>>
>>>i'd prefer to have the whole escape handling in one place, in critria.
>>>also i do not know if the escape handling is platform independent.
>>>
>>>jakob
>>>
>>>Nase, Paul R. wrote:
>>>
>>>
>>>
>>>
It shouldn't matter what db is being used, I should be able to find 
any fields containing a '%' or a '_' regardless.  The SQL 
specification allows for th

Re: deploy OJB with web application

2004-02-23 Thread Thomas Dudziak
On Mon, 23 Feb 2004, marc salvetti wrote:

> 
> Thank you very much for this info,
> i will try to install resin on my local computer to check if it works with 
> theses properties. 
> But for now, i'm still stuck because i can't ask my isp to change the resin 
> config, as i guess it could make problems with other people app.

I'm not so sure about that. AFAIK, Resin allows you to put some 
non-standard (proprietary) config properties in the web.xml of your
webapp. You should definitly check the doc about that.

BTW it is always better to develop/debug a webapp using a local servlet
container first (if possible) as it gives you much more freedom for
experimentation and debugging.
 
Tom


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reference Descriptor

2004-02-23 Thread Ziv Yankowitz
Folks,

assuming I have a "super" reference descriptor between Class b and Class a does class 
B need to have a public constructor?

where Class A:

public class A{

int id;
String name;
}

and Class B:

public class B extends A{
int id2;
String name2;
}

thanks.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: deploy OJB with web application

2004-02-23 Thread Robert S. Sfeir
marc salvetti wrote:

Thank you very much for this info,
i will try to install resin on my local computer to check if it works with 
theses properties. 
But for now, i'm still stuck because i can't ask my isp to change the resin 
config, as i guess it could make problems with other people app.

 

Honestly your ISP shouldn't have updated to the latest resin for no real 
good reason.  R3.0.6 has not even been out a month!

R

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: deploy OJB with web application

2004-02-23 Thread marc salvetti

Thank you very much for this info,
i will try to install resin on my local computer to check if it works with 
theses properties. 
But for now, i'm still stuck because i can't ask my isp to change the resin 
config, as i guess it could make problems with other people app.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Proxy in rc5 - little issues

2004-02-23 Thread edson . richter
Hi!

I'm still working on upgrade from rc4 to rc5 (with very high degree of success, I need 
to
say). But I'm working on a patched version of OJB due the following issues (not bugs, 
just
workarounds):

1) Lack of RemovalAwareList (ok, I already sent code to Thma - thanks, I'll be happy 
not
needing to patch my sources on this!);

2) The rc5 introduced a "Unmaterialized proxy for..." when calling toString avoiding
materialization due "logging" (se comments inside code)??? This is annoying, because 
all my
objects lacks on toString when being shown in JLists, JCombos and sometimes in JTables 
too.
Also, all my custom Swing components depends on toString to show contents. I've 
patched, but
I think there is no high gains avoiding materialization when calling toString 
(production
servers should avoid logging, right?). I'm patching OJB source locally.

3) I'm using a some time ago discussed (with Armin, as far as I remember) feature for
"virtual" mappings for queries (adding references/collections to object dinamically 
used
only for queryies, but that will not be inserted, updated nor deleted anytime). I 
would like
to expand a little the discussion, because I think it can be a very usefull feature to
others.

Thanks by your attention (and patience),

Edson Richter


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: deploy OJB with web application

2004-02-23 Thread Thomas Dudziak
On Mon, 23 Feb 2004, marc salvetti wrote:

> i use the latest ojb version (rc5) 
> See the answer from armin, this message seems not to be related with the current 
> pb, it is apparently for sequence generation

>From what I gather, it seems as if there was a problem with the Resin
build-in xml parser and xslt processor (at least in versions 2.1.6/7, but 
may still be present). These did not resolve entities correctly.
Even if that is not your actual problem, you might want to try the
solution: replace the xml parser (and xslt processor) that resin uses.
Somewhere in the resin config (webapp config ?), you specify these
system-properties:





(these are for xerces/xalan). You also have to put the corresponding
libraries into the lib folder of your webapp.

Tom


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Decomposed N:M-Problem

2004-02-23 Thread Tino Schöllhorn
Sorry,

it was a stupid error on myside: I forgot to state the inverse-foreignkey.

Tino Schöllhorn wrote:

Hi,

I have a quite simple problem: I have a table company, a table team and 
a table company_team which stores the relations.

Now I have to introduce a position-attribute in my company_team - table. 
I mapped this to the ojb-repository.xml file - but now it behaves quite 
strange: When I select 1 company and want to know what links it has to 
other teams the link result (i.e. classes of type CompanyTeam 
representing instances of table company_team) is always the complete 
extent of CompanyTeam, which is definitely not what I want. :-( I 
already have such a relationship from Team->Team and this works.

Here is an excerpt form my repository.xml:



.



name="companyTeams"
 
collection-class="org.apache.ojb.broker.util.collections.ManageableArrayList" 

element-class-ref="kos.intranet2.om.CompanyTeam"
auto-retrieve="true"
auto-update="true"
auto-delete="false"
proxy="true">   



















   





.



name="companyTeams"
 
collection-class="org.apache.ojb.broker.util.collections.ManageableArrayList" 

element-class-ref="kos.intranet2.om.CompanyTeam"
auto-retrieve="true"
auto-update="true"
auto-delete="false"
proxy="true">







-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: JOIN and aliases...is this a bug?

2004-02-23 Thread Alessandro Villamaina
Hi Jackob,
this is the class descriptor I currently use.
Thanks for help!

Alessandro


   

  
   

  

  
   


   


   

   
   

   
   

   


> Da: Jakob Braeuchi <[EMAIL PROTECTED]>
> Data: Fri, 20 Feb 2004 21:57:23 +0100
> A: OJB Users List <[EMAIL PROTECTED]>
> Oggetto: Re: JOIN and aliases...is this a bug?
>
> hi alessandro,
> 
> could you please post the class-descriptors ?
> 
> jakob
> 
> Alessandro Villamaina wrote:
> 
> > Hi all,
> > 
> > I have the following class declaration (pseudo code):
> > 
> > class DBObject
> >   private String name
> >   private Collection attributes
> > 
> > class DBAttribute
> >   private String name
> >   private String value
> > 
> > when I execute a query like the following (with PB API):
> > 
> > Criteria c = new Criteria();
> > c.addEqualsTo("attributes.name", "Ale");
> > Query q = QueryFactory.newQuery(DBObject.class, c);
> > 
> > the generated SQL statement is
> > 
> > SELECT A0.NAME FROM DBOBJECT A0 JOIN DBATTRIBUTE A1 ON A0.NAME=A1.OWNER WHERE name 
> > =  'Ale';
> > 
> > where OWNER is the column used by OJB to maintain references between an object and 
> > its attributes as specified in the repository_user.xml.
> > 
> > It seems OJB "forgets" to use the alias A1 to qualify the attribute name in the 
> > WHERE clause; since both tables have such attribute, the query fails (using name 
> > instead of A1.name is ambiguous).
> > 
> > Is this a bug in OJB or am I doing something wrong?
> > Thanks,
> > 
> > Alessandro
> > 
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Auto delete and anonymous fields

2004-02-23 Thread Alessandro Villamaina
:-)
Anyway, could this possibly be a bug in OJB?

Thanks!
Alessandro

> Da: Armin Waibel <[EMAIL PROTECTED]>
> Data: Mon, 23 Feb 2004 12:21:32 +0100
> A: OJB Users List <[EMAIL PROTECTED]>
> Oggetto: Re: Auto delete and anonymous fields
>
> Hi,
> 
> Alessandro Villamaina wrote:
> 
> > Armin,
> > 
> > I don't understand why I have to declare DBAttribute's "name" field as a foreign 
> > key
> beside "owner" in DBObject.
> > 
> 
> oh, sorry for the confusion, I made a mistake. You are right, in 
> DBObject only one PK is defined, so in DBAttribute one FK field 'owner' 
> is needed.
> 
> regards,
> Armin
> 
> > I would like to allow a single DBAttribute with a given name per object, so I think
> DBAttribute's PK is .
> > 
> > DBObject has no knowledge of the fact that DBAttribute has a "name" attribute. 
> > Besides,
> while "owner" refers to DBObject's PK "name", what would a second 
> inverse foreign key point to?
> > 
> > Alessandro
> > 
> > 
> >>Da: Armin Waibel <[EMAIL PROTECTED]>
> >>Data: Sat, 21 Feb 2004 11:24:11 +0100
> >>A: OJB Users List <[EMAIL PROTECTED]>
> >>Oggetto: Re: Auto delete and anonymous fields
> >>
> >>Hi Alessandro,
> >>
> >>in db.DBAttribute you declare two PK fields, thus in 
> >>collection-descriptor of db.DBObject you have to declare both fields as 
> >>inverse-foreignkey to match correctly.
> >>
> >>I don't know if there is an additional side-effect when declaring 
> >>PK/reference fields (e.g. 'owner') anonymous.
> >>As I said in previous mails, I don't recommend to use anonymous fields 
> >>beyond 1:1 references.
> >>
> >>regards,
> >>Armin
> >>
> >>
> >>Alessandro Villamaina wrote:
> >>
> >>>Hi all,
> >>>
> >>>I have a problem using the auto-delete optiion in conjunction with anonymous 
> >>>fields.
> >>>
> >>>The classes I have to be made persistent in the DB (I'm using PostgreSQL) are 
> >>>(pseudo code):
> >>>
> >>>class DBObject
> >>>  private String name
> >>>  private Collection attributes
> >>>
> >>>class DBAttribute
> >>>  private String name
> >>>  private String value
> >>>
> >>>I want to set things up in order to get the DBAttributes belonging to a DBObject 
> >>>deleted when the DBObject itself gets deleted.
> >>>
> >>>The repository_user.xml file looks like
> >>>
> >>>
> >>>  
> >>> 
> >>>   >>>name="name"
> >>>column="NAME"
> >>>jdbc-type="VARCHAR"
> >>>primarykey="true"
> >>>  />
> >>>  
> >>> 
> >>>   >>>name="_attributes"
> >>>auto-delete="true"
> >>>auto-update="true"
> >>>element-class-ref = "db.DBAttribute">
> >>>
> >>>  
> >>>  
> >>>  
> >>>
> >>>  
> >>> 
> >>> >>>   class="db.DBAttribute"
> >>>   table="DBATTRIBUTE">
> >>>  
> >>> 
> >>>>>> name="name"
> >>> column="NAME"
> >>> primarykey="true"
> >>> jdbc-type="VARCHAR"
> >>>   />
> >>>  
> >>> 
> >>>>>> name="value"
> >>> column="VALUE"
> >>> jdbc-type="VARCHAR"
> >>>   />
> >>>  
> >>> 
> >>>>>> name="owner"
> >>> column="OWNER"
> >>> jdbc-type="VARCHAR"
> >>> primarykey="true"
> >>> access="anonymous"
> >>>   />
> >>>
> >>>
> >>>As you can see, the OWNER column in the DBATTRIBUTE table keeps the link between 
> >>>an object and its attributes. There is no such attribute in the DBAttribute 
> >>>class, so I decided to make it an "anonymous" field, letting OJB handle it for me.
> >>>
> >>>The primary key of a DBATTRIBUTE record is the couple , since I want 
> >>>to allow a single attribute name for each object.
> >>>
> >>>When I save the DBObjects, everything works fine, and DBAttributes are made 
> >>>persistent along with their DBObjects. Peering into the DB tables, I can check 
> >>>that, for each record, the OWNER column contains the right reference to the owner 
> >>>object, and that is OK.
> >>>
> >>>When I delete one of the DBObjects, its attributes are NOT deleted. 
> >>>
> >>>I tried to set the log4j logging level to DEBUG, and it turned out that the 
> >>>DELETE sql statements where, for each of the DBATTRIBUTE to be deleted:
> >>>
> >>>

Re: Auto delete and anonymous fields

2004-02-23 Thread Armin Waibel
Hi,

Alessandro Villamaina wrote:

Armin,

I don't understand why I have to declare DBAttribute's "name" field as a foreign key
beside "owner" in DBObject.

oh, sorry for the confusion, I made a mistake. You are right, in 
DBObject only one PK is defined, so in DBAttribute one FK field 'owner' 
is needed.

regards,
Armin
I would like to allow a single DBAttribute with a given name per object, so I think
DBAttribute's PK is .
DBObject has no knowledge of the fact that DBAttribute has a "name" attribute. Besides,
while "owner" refers to DBObject's PK "name", what would a second 
inverse foreign key point to?
Alessandro


Da: Armin Waibel <[EMAIL PROTECTED]>
Data: Sat, 21 Feb 2004 11:24:11 +0100
A: OJB Users List <[EMAIL PROTECTED]>
Oggetto: Re: Auto delete and anonymous fields
Hi Alessandro,

in db.DBAttribute you declare two PK fields, thus in 
collection-descriptor of db.DBObject you have to declare both fields as 
inverse-foreignkey to match correctly.

I don't know if there is an additional side-effect when declaring 
PK/reference fields (e.g. 'owner') anonymous.
As I said in previous mails, I don't recommend to use anonymous fields 
beyond 1:1 references.

regards,
Armin
Alessandro Villamaina wrote:

Hi all,

I have a problem using the auto-delete optiion in conjunction with anonymous fields.

The classes I have to be made persistent in the DB (I'm using PostgreSQL) are (pseudo code):

class DBObject
 private String name
 private Collection attributes
class DBAttribute
 private String name
 private String value
I want to set things up in order to get the DBAttributes belonging to a DBObject deleted when the DBObject itself gets deleted.

The repository_user.xml file looks like


 
 
   name="name"
   column="NAME"
   jdbc-type="VARCHAR"
   primarykey="true"
 />
 
 
   name="_attributes"
   auto-delete="true"
   auto-update="true"
   element-class-ref = "db.DBAttribute">
   
   

 

  class="db.DBAttribute"
  table="DBATTRIBUTE">
 
  
name="name"
column="NAME"
primarykey="true"
jdbc-type="VARCHAR"
  />
 
  
name="value"
column="VALUE"
jdbc-type="VARCHAR"
  />
 
  
name="owner"
column="OWNER"
jdbc-type="VARCHAR"
primarykey="true"
access="anonymous"
  />


As you can see, the OWNER column in the DBATTRIBUTE table keeps the link between an object and its attributes. There is no such attribute in the DBAttribute class, so I decided to make it an "anonymous" field, letting OJB handle it for me.

The primary key of a DBATTRIBUTE record is the couple , since I want to allow a single attribute name for each object.

When I save the DBObjects, everything works fine, and DBAttributes are made persistent along with their DBObjects. Peering into the DB tables, I can check that, for each record, the OWNER column contains the right reference to the owner object, and that is OK.

When I delete one of the DBObjects, its attributes are NOT deleted. 

I tried to set the log4j logging level to DEBUG, and it turned out that the DELETE sql statements where, for each of the DBATTRIBUTE to be deleted:

DELETE FROM DBATTRIBUTE WHERE name="name1" AND owner = NULL

Obviously nothing is deleted from DBATTRIBUTE, since no owner is null in the table.
The funny thing is that such DELETE statements are generated ONLY for the attributes that should 
be deleted, not for all attributes. This means that OJB "knows" (looking at the owner 
field, I guess)  which attributes belong to the DBOBJECT and have to be deleted, but fails in 
assigning the right value to owner in the DELETE statement.
Does anyone know how to solve this? 
Is this a bug or am I doing something wrong?

Thanks a lot!

Alessandro

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-

Re: Auto delete and anonymous fields

2004-02-23 Thread Alessandro Villamaina
Just a note: in my example both DBObject and DBAttribute have a "name" attribute, but 
they are completely unrelated!

Sorry for the misleading attribute names!
8-)
Alessandro

> Da: "Alessandro Villamaina" <[EMAIL PROTECTED]>
> Data: Mon, 23 Feb 2004 11:07:59 +
> A: "OJB Users List" <[EMAIL PROTECTED]>
> Oggetto: Re: Auto delete and anonymous fields
>
> Armin,
> 
> I don't understand why I have to declare DBAttribute's "name" field as a foreign key 
> beside "owner" in DBObject.
> 
> I would like to allow a single DBAttribute with a given name per object, so I think 
> DBAttribute's PK is .
> 
> DBObject has no knowledge of the fact that DBAttribute has a "name" attribute. 
> Besides, while "owner" refers to DBObject's PK "name", what would a second inverse 
> foreign key point to?
> 
> Alessandro
> 
> > Da: Armin Waibel <[EMAIL PROTECTED]>
> > Data: Sat, 21 Feb 2004 11:24:11 +0100
> > A: OJB Users List <[EMAIL PROTECTED]>
> > Oggetto: Re: Auto delete and anonymous fields
> >
> > Hi Alessandro,
> > 
> > in db.DBAttribute you declare two PK fields, thus in 
> > collection-descriptor of db.DBObject you have to declare both fields as 
> > inverse-foreignkey to match correctly.
> > 
> > I don't know if there is an additional side-effect when declaring 
> > PK/reference fields (e.g. 'owner') anonymous.
> > As I said in previous mails, I don't recommend to use anonymous fields 
> > beyond 1:1 references.
> > 
> > regards,
> > Armin
> > 
> > 
> > Alessandro Villamaina wrote:
> > > Hi all,
> > > 
> > > I have a problem using the auto-delete optiion in conjunction with anonymous 
> > > fields.
> > > 
> > > The classes I have to be made persistent in the DB (I'm using PostgreSQL) are 
> > > (pseudo code):
> > > 
> > > class DBObject
> > >   private String name
> > >   private Collection attributes
> > > 
> > > class DBAttribute
> > >   private String name
> > >   private String value
> > > 
> > > I want to set things up in order to get the DBAttributes belonging to a DBObject 
> > > deleted when the DBObject itself gets deleted.
> > > 
> > > The repository_user.xml file looks like
> > > 
> > > 
> > >  
> > >  
> > >> > name="name"
> > > column="NAME"
> > > jdbc-type="VARCHAR"
> > > primarykey="true"
> > >   />
> > >  
> > >  
> > >> > name="_attributes"
> > > auto-delete="true"
> > > auto-update="true"
> > > element-class-ref = "db.DBAttribute">
> > > 
> > >  
> > >  
> > >   
> > > 
> > >  
> > >  
> > >  > >class="db.DBAttribute"
> > >table="DBATTRIBUTE">
> > >  
> > >  
> > > > >  name="name"
> > >  column="NAME"
> > >  primarykey="true"
> > >  jdbc-type="VARCHAR"
> > >/>
> > >  
> > >  
> > > > >  name="value"
> > >  column="VALUE"
> > >  jdbc-type="VARCHAR"
> > >/>
> > >  
> > >  
> > > > >  name="owner"
> > >  column="OWNER"
> > >  jdbc-type="VARCHAR"
> > >  primarykey="true"
> > >  access="anonymous"
> > >/>
> > > 
> > > 
> > > As you can see, the OWNER column in the DBATTRIBUTE table keeps the link between 
> > > an object and its attributes. There is no such attribute in the DBAttribute 
> > > class, so I decided to make it an "anonymous" field, letting OJB handle it for 
> > > me.
> > > 
> > > The primary key of a DBATTRIBUTE record is the couple , since I 
> > > want to allow a single attribute name for each object.
> > > 
> > > When I save the DBObjects, everything works fine, and DBAttributes are made 
> > > persistent along with their DBObjects. Peering into the DB tables, I can check 
> > > that, for each record, the OWNER column contains the right reference to the 
> > > owner object, and that is OK.
> > > 
> > > When I delete one of the DBObjects, its attributes are NOT deleted. 
> > > 
> > > I tried to set the log4j logging level to DEBUG, and it turned out that the 
> > > DELETE sql statements where, for each of the DBATTRIBUTE to be deleted:
> > > 
> > > DELETE FROM DBATTRIBUTE WHERE name="name1" AND owner = 

Re: Auto delete and anonymous fields

2004-02-23 Thread Alessandro Villamaina
Armin,

I don't understand why I have to declare DBAttribute's "name" field as a foreign key 
beside "owner" in DBObject.

I would like to allow a single DBAttribute with a given name per object, so I think 
DBAttribute's PK is .

DBObject has no knowledge of the fact that DBAttribute has a "name" attribute. 
Besides, while "owner" refers to DBObject's PK "name", what would a second inverse 
foreign key point to?

Alessandro

> Da: Armin Waibel <[EMAIL PROTECTED]>
> Data: Sat, 21 Feb 2004 11:24:11 +0100
> A: OJB Users List <[EMAIL PROTECTED]>
> Oggetto: Re: Auto delete and anonymous fields
>
> Hi Alessandro,
> 
> in db.DBAttribute you declare two PK fields, thus in 
> collection-descriptor of db.DBObject you have to declare both fields as 
> inverse-foreignkey to match correctly.
> 
> I don't know if there is an additional side-effect when declaring 
> PK/reference fields (e.g. 'owner') anonymous.
> As I said in previous mails, I don't recommend to use anonymous fields 
> beyond 1:1 references.
> 
> regards,
> Armin
> 
> 
> Alessandro Villamaina wrote:
> > Hi all,
> > 
> > I have a problem using the auto-delete optiion in conjunction with anonymous 
> > fields.
> > 
> > The classes I have to be made persistent in the DB (I'm using PostgreSQL) are 
> > (pseudo code):
> > 
> > class DBObject
> >   private String name
> >   private Collection attributes
> > 
> > class DBAttribute
> >   private String name
> >   private String value
> > 
> > I want to set things up in order to get the DBAttributes belonging to a DBObject 
> > deleted when the DBObject itself gets deleted.
> > 
> > The repository_user.xml file looks like
> > 
> > 
> >
> >
> >> name="name"
> > column="NAME"
> > jdbc-type="VARCHAR"
> > primarykey="true"
> >   />
> >
> >
> >> name="_attributes"
> > auto-delete="true"
> > auto-update="true"
> > element-class-ref = "db.DBAttribute">
> > 
> >
> >
> >   
> > 
> >
> >
> >  >class="db.DBAttribute"
> >table="DBATTRIBUTE">
> >
> >
> > >  name="name"
> >  column="NAME"
> >  primarykey="true"
> >  jdbc-type="VARCHAR"
> >/>
> >
> >
> > >  name="value"
> >  column="VALUE"
> >  jdbc-type="VARCHAR"
> >/>
> >
> >
> > >  name="owner"
> >  column="OWNER"
> >  jdbc-type="VARCHAR"
> >  primarykey="true"
> >  access="anonymous"
> >/>
> > 
> > 
> > As you can see, the OWNER column in the DBATTRIBUTE table keeps the link between 
> > an object and its attributes. There is no such attribute in the DBAttribute class, 
> > so I decided to make it an "anonymous" field, letting OJB handle it for me.
> > 
> > The primary key of a DBATTRIBUTE record is the couple , since I want 
> > to allow a single attribute name for each object.
> > 
> > When I save the DBObjects, everything works fine, and DBAttributes are made 
> > persistent along with their DBObjects. Peering into the DB tables, I can check 
> > that, for each record, the OWNER column contains the right reference to the owner 
> > object, and that is OK.
> > 
> > When I delete one of the DBObjects, its attributes are NOT deleted. 
> > 
> > I tried to set the log4j logging level to DEBUG, and it turned out that the DELETE 
> > sql statements where, for each of the DBATTRIBUTE to be deleted:
> > 
> > DELETE FROM DBATTRIBUTE WHERE name="name1" AND owner = NULL
> > 
> > Obviously nothing is deleted from DBATTRIBUTE, since no owner is null in the table.
> > The funny thing is that such DELETE statements are generated ONLY for the 
> > attributes that should be deleted, not for all attributes. This means that OJB 
> > "knows" (looking at the owner field, I guess)  which attributes belong to the 
> > DBOBJECT and have to be deleted, but fails in assigning the right value to owner 
> > in the DELETE statement.
> > 
> > Does anyone know how to solve this? 
> > Is this a bug or am I doing something wrong?
> > 
> > Thanks a lot!
> > 
> > Alessandro
> > 
> > 
> > ---

Decomposed N:M-Problem

2004-02-23 Thread Tino Schöllhorn
Hi,

I have a quite simple problem: I have a table company, a table team and 
a table company_team which stores the relations.

Now I have to introduce a position-attribute in my company_team - table. 
I mapped this to the ojb-repository.xml file - but now it behaves quite 
strange: When I select 1 company and want to know what links it has to 
other teams the link result (i.e. classes of type CompanyTeam 
representing instances of table company_team) is always the complete 
extent of CompanyTeam, which is definitely not what I want. :-( I 
already have such a relationship from Team->Team and this works.

Here is an excerpt form my repository.xml:



	.
	
	
	
		name="companyTeams"
		 
collection-class="org.apache.ojb.broker.util.collections.ManageableArrayList"
		element-class-ref="kos.intranet2.om.CompanyTeam"
		auto-retrieve="true"
		auto-update="true"
		auto-delete="false"
		proxy="true">			
	
	
	
	




	
	
	
	







   




	.
	
	
	
		name="companyTeams"
	 
collection-class="org.apache.ojb.broker.util.collections.ManageableArrayList"
		element-class-ref="kos.intranet2.om.CompanyTeam"
		auto-retrieve="true"
		auto-update="true"
		auto-delete="false"
		proxy="true">
	
	
	
	








-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: debugging info about cache

2004-02-23 Thread Armin Waibel
Hi,

Tino Schöllhorn wrote:

Hi Armin,

I am using the ObjectCachePerBrokerImpl so I added:

org.apache.ojb.broker.cache.ObjectCachePerBrokerImpl.LogLevel=DEBUG

to my OJB.properties file.

But there is no debugging-output. :-(

This implementation does not use logging (add your own logging 
entries?). Have a look at the source.

By the way, this implementation use SoftReference too for object 
caching. Thus the memory problem shouldn't caused by this class.
Maybe your JVM doesn't have enough memory to solve your query.

regards,
Armin
Tino

Armin Waibel wrote:

Hi,

Tino Schöllhorn wrote:

Hi,

I am frequently encountering OutOfMemory-Errors in my application. Is 
there a way to debug information about the used cache of OJB?




set logging level to debug for the used ObjectCache implementation 
(e.g. if using OJB default logging api, add an entry to OJB.properties).

The default cache implementation (ObjectCacheDefaultImpl) use 
SoftReferences to cache objects, thus this shouldn't cause the memory 
problem.

regards,
Armin
Tino



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: AW: PersistenceBrokerException: Error reading class type

2004-02-23 Thread Armin Waibel


Just Fun 4 You wrote:
Hello Armin,

unfortunately no. The error did not pop up again. As I said it comes once a
while so I suspect some misconfiguration in my settings!? I do not even know
what this message "error reading class type" is all about. Maybe you have an
idea? 

only says that an error occur while reading field values from the 
ResultSet. As I said in my previous mail, the nested exception stack 
trace was missed, so we can only speculate what's the underlying 
problem. Maybe you set a wrong column name in one field of 
de.person.entity.Person.

regards,
Armin
Sven
  

-Ursprüngliche Nachricht-
Von: Armin Waibel [mailto:[EMAIL PROTECTED] 
Gesendet: Samstag, 21. Februar 2004 11:24
An: OJB Users List
Betreff: Re: PersistenceBrokerException: Error reading class type

Hi Sven,

sorry, this snip of the stack trace doesn't help much.

Could you please post the whole stack trace. The problem pop up in
RowReaderDefaultImpl, but the stack trace ends here.
Do you use a field-conversion class for one or more fields of
de.person.entity.Person?
regads,
Armin
Just Fun 4 You wrote:


Hi,

every now and then I get the following exception message:

[org.apache.ojb.broker.accesslayer.RsIterator] ERROR: Error while 
iterate Result Set for query 
org.apache.ojb.broker.accesslayer.RsQueryObject[query: Query from 
class de.person.entity.Person where [PERSON_ALIAS = LEBE88  ], class
descriptor: de.person.entity.Person]

Error reading class type: de.person.entity.Person from result set
org.apache.ojb.broker.PersistenceBrokerException: Error reading class
type:

de.person.entity.Person from result set
   at
org.apache.ojb.broker.accesslayer.RowReaderDefaultImpl.readObjectArray
From(U
nknown Source)
   at
org.apache.ojb.broker.accesslayer.RsIterator.getObjectFromResultSet(U
nknown Source)
   at org.apache.ojb.broker.accesslayer.RsIterator.next(Unknown
Source)

   at
org.apache.ojb.broker.core.PersistenceBrokerImpl.getObjectByQuery(Unkn
own
Source)
   at
org.apache.ojb.broker.core.DelegatingPersistenceBroker.getObjectByQuer
y(Unkn
own Source)
   at
org.apache.ojb.broker.core.DelegatingPersistenceBroker.getObjectByQuer
y(Unkn
own Source)
I use OJB PB on a DB2 database and declared the 
SequenceManagerNativeImpl in the connection-descriptor. The error pops 
up once a while. I wonder what happens here. Any idea?

Sven

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: deploy OJB with web application

2004-02-23 Thread marc salvetti
Thomas Dudziak  first.gmd.de> writes:

> 
> This is interesting. First, what OJB version do you use (this debugging
> message is not generated in latest from CVS) ? Second, the message means
> that an attribute tag has been found ( attribute-name="autoNaming" attribute-value="true"/>) but OJB was unable
> to associate it to an element (class descriptor etc.). I don't know of
> such an attribute, what is it for ?
> 
> Tom
> 

i use the latest ojb version (rc5) 
See the answer from armin, this message seems not to be related with the current 
pb, it is apparently for sequence generation

marc



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: deploy OJB with web application

2004-02-23 Thread Thomas Dudziak
On Mon, 23 Feb 2004, marc salvetti wrote:

> Tom, 
> at least, the same config is working great with tomcat, but this don't help to 
> debug the issue :(

But it means that you don't have a config issue at hand (except for
resin-specific stuff).
 
> i'll try to install resin 3.0.6 on my computer but i'm afraid i will encounter 
> the same debugging problem : i can't even locate the error in the logs !

I'd try resin with one of my ojb webapps, but the website seems to be down
...
 
> 
> here is the only suspect message from the stdout.log
> 
> 
> (metadata.RepositoryPersistor?   ) OJB Descriptor Repository: file:/home
> /marc/public_html/WEB-INF/classes/conf/ojb/repository.xml
> (metadata.RepositoryXmlHandler   ?   ) Found attribute (name=autoNaming, val
> ue=true) but I can not assign them to a descriptor

This is interesting. First, what OJB version do you use (this debugging
message is not generated in latest from CVS) ? Second, the message means
that an attribute tag has been found () but OJB was unable
to associate it to an element (class descriptor etc.). I don't know of
such an attribute, what is it for ?
 
Tom



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: deploy OJB with web application

2004-02-23 Thread Armin Waibel
Hi Marc,

> (metadata.RepositoryPersistor?   ) OJB Descriptor Repository: 
file:/home
> /marc/public_html/WEB-INF/classes/conf/ojb/repository.xml
> (metadata.RepositoryXmlHandler   ?   ) Found attribute 
(name=autoNaming, val
> ue=true) but I can not assign them to a descriptor
>
>
> there is nothing suspect in the stderr.log
>
>
> do you know what theses attributes stands for ?

these attribute used by some SequenceManager implementations. If the 
RepositoryXmlHandler found such an entry, but can't assign the 
attributes to an appropriate descriptor a info message was logged. 
Normally this shouldn't cause problems.

regards,
Armin
marc salvetti wrote:
Thomas Dudziak  first.gmd.de> writes:


There seems to be some trouble with parsing the class descriptor (and
probably other parts of the configuration) which is likely to be some
problem with the combo resin + ojb. Are there other messages from ojb like
'... not found, using default values' or somesuch ?
If you can, then you should try this with a local installation of resin
3.0.6 (should be no problem as you're allowed to use resin free of charge
for development) or if you do not use specific features of resin, another
servlet container like jetty or tomcat might do. This will enable you to
debug this issue, and you can see where the problem is located (path
issues, xml parsing problems etc.).
Tom



Tom, 
at least, the same config is working great with tomcat, but this don't help to 
debug the issue :(

i'll try to install resin 3.0.6 on my computer but i'm afraid i will encounter 
the same debugging problem : i can't even locate the error in the logs !

here is the only suspect message from the stdout.log

(metadata.RepositoryPersistor?   ) OJB Descriptor Repository: file:/home
/marc/public_html/WEB-INF/classes/conf/ojb/repository.xml
(metadata.RepositoryXmlHandler   ?   ) Found attribute (name=autoNaming, val
ue=true) but I can not assign them to a descriptor
there is nothing suspect in the stderr.log

do you know what theses attributes stands for ?

thanks in advance,

marc

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Out of memory error (3)

2004-02-23 Thread Thomas Mahler
Hi Edson,

I'd like to integrate your RemovalAwareArrayList!
Please post it to my email address.
Thomas

Edson Carlos Ericksson Richter wrote:
I don't know if help, but analizing Vector I've seen that when need more
space, it double allocated space. ArrayList, at other side, does a less
agressive approach (but is slower), and ojb has support for
ManageableArrayList for collections (set collection-class).
Of course, you should use Proxy for references and collections. If you need
to show large lists, or mount complex reports, you should use ReportQueries.
I had serious memory trouble using OJB with tables with 66 records, and
solved using report queryies.
OJB has no native support for RemovalAware of type List, and if OJB team
wish, I can send my private RemovalAwareArrayList I'm using for more than a
year now.
Best regards,

Edson Richter
- Original Message - 
From: Glauber Andrade
To: OJB Users List
Sent: Friday, February 20, 2004 10:19 AM
Subject: Res: Re: Out of memory error (3)

It has 1051 registers.

---Mensagem original---

De: OJB Users List
Data: 02/20/04 04:15:22
Para: OJB Users List
Assunto: Re: Out of memory error
Hi,

Glauber Andrade wrote:

My system doesn't work anymore. I got this error when I try to get the
object Prestador (+- 600 registers).
What should I do ?


Without knowing more about your system this is hard to answer.
If there are no problems with your repository.xml it could be that you
simply should start your server with more heap memory.
But if there are problems in the mapping, this won't help.
So you should start by checking your repository.
what can be problematic? Loading 1 root object with 600 dependend
objects shoul not be a problem (we are loading 1 objects and more in
our testcases).
But if the registers objects have references to objects, and those
objects to yet another layer of objects, you are in trouble as OJB must
load a very large Object graph in one go.
The solution can be to set proxy="true" for those reference- and
collection-descriptors. In that way you avoid loading in one go and
defer the loading of dependend objects.
Thomas


[org.apache.ojb.broker.accesslayer.JdbcAccessImpl] ERROR: SQLException
during the execution of the query (for a
com.maximas.sinret.data.Prestador): Memory allocation failure,  message
from server: "Out of memory. Restart daemon and try again (needed 65528
bytes)"
Memory allocation failure,  message from server: "Out of memory. Restart
daemon and try again (needed 65528 bytes)"
java.sql.SQLException: Memory allocation failure,  message from server:
"Out of memory. Restart daemon and try again (needed 65528 bytes)"



  /IncrediMail/
- *O mundo do correio eletrônico finalmente desenvolveu-se* - *_Clique
aqui_* 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



  IncrediMail - O mundo do correio eletrônico finalmente desenvolveu-se -
Clique aqui
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.592 / Virus Database: 375 - Release Date: 18/2/2004
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: deploy OJB with web application

2004-02-23 Thread marc salvetti
Thomas Dudziak  first.gmd.de> writes:

> There seems to be some trouble with parsing the class descriptor (and
> probably other parts of the configuration) which is likely to be some
> problem with the combo resin + ojb. Are there other messages from ojb like
> '... not found, using default values' or somesuch ?
> If you can, then you should try this with a local installation of resin
> 3.0.6 (should be no problem as you're allowed to use resin free of charge
> for development) or if you do not use specific features of resin, another
> servlet container like jetty or tomcat might do. This will enable you to
> debug this issue, and you can see where the problem is located (path
> issues, xml parsing problems etc.).
> 
> Tom
> 

Tom, 
at least, the same config is working great with tomcat, but this don't help to 
debug the issue :(


i'll try to install resin 3.0.6 on my computer but i'm afraid i will encounter 
the same debugging problem : i can't even locate the error in the logs !


here is the only suspect message from the stdout.log


(metadata.RepositoryPersistor?   ) OJB Descriptor Repository: file:/home
/marc/public_html/WEB-INF/classes/conf/ojb/repository.xml
(metadata.RepositoryXmlHandler   ?   ) Found attribute (name=autoNaming, val
ue=true) but I can not assign them to a descriptor


there is nothing suspect in the stderr.log


do you know what theses attributes stands for ?

thanks in advance,

marc


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: deploy OJB with web application

2004-02-23 Thread marc salvetti
Robert S. Sfeir  codepuccino.com> writes:

> 
> I told you guys there was problems with resin 3.0.6 and parsin the 
> repository class 
> 
> Scott Ferguson at caucho fixed it for the next build, but that's not out 
> yet.  It works fine in 3.0.4.
> 
> R
> 
Robert, i've seen your answer on the post, but since don't have the choice of 
the resin version, and since the issue seems not to be on the isolation-level 
attribute but on other attributes in the repository, it is likely that maybe the 
next ojb release will fix the pb, but maybe not :)
so i'm still lookin for a workaround.
I've even rewrite the whole class that depends on ojb and replaced it with a 
class that depends on hibernate !! (lots of works) but it seems that i do 
something wrong with hibernate setup because it's awfully slow !
btw, do you have an idea of when this new resin version will be released ?

regards, 

marc






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



AW: PersistenceBrokerException: Error reading class type

2004-02-23 Thread Just Fun 4 You
Hello Armin,

unfortunately no. The error did not pop up again. As I said it comes once a
while so I suspect some misconfiguration in my settings!? I do not even know
what this message "error reading class type" is all about. Maybe you have an
idea? 

Sven
  

-Ursprüngliche Nachricht-
Von: Armin Waibel [mailto:[EMAIL PROTECTED] 
Gesendet: Samstag, 21. Februar 2004 11:24
An: OJB Users List
Betreff: Re: PersistenceBrokerException: Error reading class type

Hi Sven,

sorry, this snip of the stack trace doesn't help much.

Could you please post the whole stack trace. The problem pop up in
RowReaderDefaultImpl, but the stack trace ends here.
Do you use a field-conversion class for one or more fields of
de.person.entity.Person?

regads,
Armin

Just Fun 4 You wrote:

> Hi,
> 
> every now and then I get the following exception message:
> 
> [org.apache.ojb.broker.accesslayer.RsIterator] ERROR: Error while 
> iterate Result Set for query 
> org.apache.ojb.broker.accesslayer.RsQueryObject[query: Query from 
> class de.person.entity.Person where [PERSON_ALIAS = LEBE88  ], class
> descriptor: de.person.entity.Person]
> 
> Error reading class type: de.person.entity.Person from result set
> org.apache.ojb.broker.PersistenceBrokerException: Error reading class
type:
> de.person.entity.Person from result set
> at
> org.apache.ojb.broker.accesslayer.RowReaderDefaultImpl.readObjectArray
> From(U
> nknown Source)
> at
> org.apache.ojb.broker.accesslayer.RsIterator.getObjectFromResultSet(U
> nknown Source)
> at org.apache.ojb.broker.accesslayer.RsIterator.next(Unknown
Source)
> at
> org.apache.ojb.broker.core.PersistenceBrokerImpl.getObjectByQuery(Unkn
> own
> Source)
> at
> org.apache.ojb.broker.core.DelegatingPersistenceBroker.getObjectByQuer
> y(Unkn
> own Source)
> at
> org.apache.ojb.broker.core.DelegatingPersistenceBroker.getObjectByQuer
> y(Unkn
> own Source)
> 
> I use OJB PB on a DB2 database and declared the 
> SequenceManagerNativeImpl in the connection-descriptor. The error pops 
> up once a while. I wonder what happens here. Any idea?
> 
> Sven
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



(OT?) Re: Oracle date tip

2004-02-23 Thread John L. Webber
At the risk of wandering off-topic here, we discovered that when we 
store a java.util.Date to an Oracle database using an Oracle "date", we 
lost the millisecond precision of our Java data; switching the column to 
an Oracle "timestamp" solved the problem. We noticed this because 
various unit tests that made assumptions about a retrieved date being 
before or after a reference date were failing mysteriously. BTW, we're 
pretty much Oracle novices here...

John

Joe Germuska wrote:

At 6:37 PM -0700 2/19/04, Brad Matlack wrote:

 > > Oracle doesn't have a TIMESTAMP type; its "DATE" encompasses SQL 
TIME,

 > TIMESTAMP, and DATE.

 No I think you misunderstood the meaning of TIMESTAMP with Oracle in
 this case.  With MySQL for example Timestamp column is just that a
 timestamp from the DB, nothing you can insert into, like an auto date
 column.  In Oracle timestamp contains the date AND time in the field,
 where as the date field contains just the date.

I may well have...  I always figured that since you can't make a 
column in an Oracle table of type "timestamp" that it was just an 
Oracle quirk.  Or, to avoid sticking my neck out too far again, 
whenever I tried using "timestamp" as a column type in my Oracle 
databases, I've gotten an error.

In any case, it seems like everyone who is used to writing Oracle SQL 
is used to using the "to_date" function to make sure that their String 
representations use correct date formats, and it seems like one 
shouldn't have to change a database-level setting to make OJB work.  
There should be an application-layer place to make it work.

Joe

--
-
Jentro Technologies GmbH
John L. Webber, Software Development
-
Rosenheimer Str. 145e	81671 München
Tel. +49 89 189 169 80 mailto:[EMAIL PROTECTED] 
Fax  +49 89 189 169 99 http://www.jentro.com
-
NOTICE: The information contained in this e-mail is confidential or may otherwise be legally privileged. It is intended for the named recipient only. If you have received it in error, please notify us immediately by reply or by calling the telephone number above and delete this message and all its attachments without any use or further distribution of its contents. Please note that any unauthorised review, copying, disclosing or otherwise making use of the information is strictly prohibited. Thank you. 
-



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: FunctionSequenceError and MSAccess

2004-02-23 Thread Tino Schöllhorn
Hello Armin,

here is the stacktrace:

org.apache.ojb.broker.PersistenceBrokerSQLException: 
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver]Fehler 
in der Funktionsreihenfolge.
org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeUpdate(JdbcAccessImpl.java: 
551)
org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(PersistenceBrokerImpl.java: 
1441)
org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImpl.java: 
1341)
org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImpl.java: 
700)
org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(DelegatingPersistenceBroker.java: 
165)
org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(DelegatingPersistenceBroker.java: 
165)
kos.generator.DataObject.storeInstance(DataObject.java: 68)
kos.wnetz.modules.fs2.FileSystem.saveFileProperties(FileSystem.java: 
231)
sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java: 
no source available)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java: 
39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java: 
25)
java.lang.reflect.Method.invoke(Method.java: 324)
kos.wnetz.system.Action.invoke(Action.java: 234)
kos.wnetz.system.ActionHandler.invoke(ActionHandler.java: 42)
kos.wnetz.servlets.WNetz.doRequest(WNetz.java: 98)
kos.wnetz.servlets.WNetz.doPost(WNetz.java: 74)
javax.servlet.http.HttpServlet.service(HttpServlet.java: 763)
javax.servlet.http.HttpServlet.service(HttpServlet.java: 856)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java: 
284)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java: 
204)
... 22 weitere Elemente...

Tino



Armin Waibel wrote:

Hi Tino,

Tino Schöllhorn wrote:

Hi,

I am using OJBrc5 (rebuild from CVS head) and I have some troubles 
with my database: sometimes (not always) when I want to insert or 
update an object via ojb the JdbcOdbcBridge throws an function 
sequence error.

 From my previous experiences this error occurs when a resultset r is 
read and the statement which produced the resultset r is already closed.

Could you post the stack trace?

regards,
Armin


I already tried to switch off connection-pooling. But now I am helpless.

Any ideas?
Tino


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: debugging info about cache

2004-02-23 Thread Tino Schöllhorn
Hi Armin,

I am using the ObjectCachePerBrokerImpl so I added:

org.apache.ojb.broker.cache.ObjectCachePerBrokerImpl.LogLevel=DEBUG

to my OJB.properties file.

But there is no debugging-output. :-(

Tino

Armin Waibel wrote:
Hi,

Tino Schöllhorn wrote:

Hi,

I am frequently encountering OutOfMemory-Errors in my application. Is 
there a way to debug information about the used cache of OJB?



set logging level to debug for the used ObjectCache implementation (e.g. 
if using OJB default logging api, add an entry to OJB.properties).

The default cache implementation (ObjectCacheDefaultImpl) use 
SoftReferences to cache objects, thus this shouldn't cause the memory 
problem.

regards,
Armin
Tino



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Query on collection descriptors

2004-02-23 Thread Armin Waibel
Hi Raghavan,

Kollivakkam R. Raghavan wrote:

If I have a 1-n relationship between two entities represented as a
collection-descriptor in OJB, how can I use the PB Query API to retrieve
items in the collections based on some constraint on the n side of the
relationship.  In other words I don't want to get all the entries in the
collection but only the ones that satisfy the constraint.
you can try to implement a QueryCustomizer
http://db.apache.org/ojb/tutorial3.html#Customizing collection queries
regards,
Armin
For example:
If I had a classroom table and a student table which has a 1-n
relationship (each classroom has n students male or female), I want to
write a PB query that returns me all male (or female) students in a
given classroom (assume that gender is an attribute in the student
table).  Is this possible?
Thanks in advance
Raghavan
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: AW: Delete object in a 1:N assoc only with RemovalAwareCollection?

2004-02-23 Thread Armin Waibel
Hi Rainer,

Rainer Klute wrote:
...
hmm, you can use non-distributed ObjectCache implementation, e.g. 
ObjectCachePerBrokerImpl. This supports circular references and avoid 
concurrent object modification by other threads/broker instances.
But you will loose all cached objects when broker was closed/rolled back.
Nevertheless, if you have a fast DB and a fast network between OJB and 
DB this should be ok.


I tried the ObjectCachePerBrokerImpl but unfortunately lost the circular references.

hmm, this implementation does support circular references. Think there 
is something going wrong in your app, e.g. different threads using same 
PB instance.

Okay, folks, thanks for your time and effort and good luck with
forthcoming OJB versions! I'll keep an eye on its development - but just 
not now.

Thanks for give it a try.

regards,
Armin
Best regards
Rainer Klute
   Rainer Klute IT-Consulting GmbH
  Dipl.-Inform.
  Rainer Klute E-Mail:  [EMAIL PROTECTED]
  Körner Grund 24  Telefon: +49 172 2324824
D-44143 Dortmund   Telefax: +49 231 5349423
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: debugging info about cache

2004-02-23 Thread Armin Waibel
Hi,

Tino Schöllhorn wrote:
Hi,

I am frequently encountering OutOfMemory-Errors in my application. Is 
there a way to debug information about the used cache of OJB?

set logging level to debug for the used ObjectCache implementation (e.g. 
if using OJB default logging api, add an entry to OJB.properties).

The default cache implementation (ObjectCacheDefaultImpl) use 
SoftReferences to cache objects, thus this shouldn't cause the memory 
problem.

regards,
Armin
Tino



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: FunctionSequenceError and MSAccess

2004-02-23 Thread Armin Waibel
Hi Tino,

Tino Schöllhorn wrote:
Hi,

I am using OJBrc5 (rebuild from CVS head) and I have some troubles with 
my database: sometimes (not always) when I want to insert or update an 
object via ojb the JdbcOdbcBridge throws an function sequence error.

 From my previous experiences this error occurs when a resultset r is 
read and the statement which produced the resultset r is already closed.

Could you post the stack trace?

regards,
Armin


I already tried to switch off connection-pooling. But now I am helpless.

Any ideas?
Tino


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]