Re: Deadlocks mapped to common exception?

2004-12-08 Thread Oliver Zeigermann
Is this just nonsense or is it that no one is interested? How do OJB
users handle deadlocks?

Oliver

On Sun, 5 Dec 2004 01:23:17 +0100, Oliver Zeigermann
<[EMAIL PROTECTED]> wrote:
> Folks,
> 
> can anyone tell me if OJB is able to find out that a certain SQL
> exception really is a deadlock exception and maps it to another common
> one (DeadlockException)? This would be very helpful to repeat a
> deadlocked transaction. I found no code in OJB that might do such a
> job.
> 
> If there is nothing in OBJ the Jakarta Slide project has some initial
> code that does this for some dbs. Maybe this could be integrated in
> OJB?
> 
> Oliver
>

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



Re: Criteria through extent (Was: Circular criteria)

2004-12-08 Thread Jakob Braeuchi
hi daniel,
when resolving the path meeting.pdp.createdBy ojb looks for a collection- or 
reference-descriptor called 'meeting' and it uses the referenced class to reolve 
further path-segements 'pdp'. so if the class referenced by 'meeting' does 
not have a reference-descriptor named 'pdp' ojb is not able to resolve this 
reference.

there a two solutions right now:
1.) define a reference-descriptor named 'pdp' in your top-class (meeting)
2.) use Criteri#addPathClass('pdp',Appraisal.class) as a hint
hth
jakob
Daniel Perry schrieb:
It apprears that ojb doesnt like criteria at depths that go beyond an
extent.
My criteria is:
crit.addEqualTo("behaviourId", new Integer(id));
crit.addLessThan("rating", new Integer(1));
crit.addEqualTo("meeting.pdp.createdBy", new Integer(mid));
And this generates the following sql (shortened!):
SELECT ... FROM behaviourrating A0 INNER JOIN appraisal A1 ON
A0.meetingId=A1.id WHERE ((A0.behaviourId = '21') AND A0.rating < '1') AND
createdBy = '7'
As you can see, it generates the rating and behaviourId where clauses
properly.  But the third clause doesnt work.
The table appraisal is an extent of meeting.
behaviourRating.meeting points to a Meeting, not an appraisal.  At the
moment there is only one extent of meeting, but that will change in future,
so ditching meeting isnt an option.
Meeting doesnt have a reference to pdp, but appraisal does.
Should ojb handle this criteria? or should it say that as meeting doesnt
have a 'pdp.createdBy' defined, it will ignore it, even though all the
instanciable subclasses (Appraisal) do have!  This would seem fair enough,
although a little annoying!
Could i add a reference (and associated id) for pdp, and employee to
Meeting, but still keep all subclasses in separate tables?
Thanks,
Daniel.
-
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: FEATURE REQUEST : specify foreign-key-attribute to use with colle ction descriptors instead of using primary of container class

2004-12-08 Thread Jakob Braeuchi
hi roger,
imo this feature could be useful in some real life scenarios; even without an 
intermediate class like Acl in your example.

but i'd prefer to extend the inverse-foreignkey (called "referencing" in the 
following snippet, but this is just a temp name). if the referencing attribute 
is missing we assume the pk of the element-class-ref is used.




jakob
Janssen, Roger schrieb:
Hi guys, i've got a question.
 
I am using 1.0-rc6.
 
Currently, using a collection descriptor, you specify the inverse-foreignkey
attribute on the items of the collection, and these attributes are matched
with the value of the primary key of the object that contains the
collection.
 
However, consider the following (simplified) situation:
 
 
Document   Acl  Permission
id --->  id   <---|id
...|   ...   |...
...| |  aclId
aclId   -| ...
...
 
 
I have an class document, containing a foreignkey reference to a class Acl,
and i have a class permission containing a foreignkey reference to an acl.
The class document has an attribute acl populated by OJB by using a
reference descriptor.
The class Acl has an collection attribute permissions collected by OJB using
a collection descriptor.
 
When a query for documents, using permission criteria, the query becomes
complex, OJB joins document, acl and permission, using nested objects in
criteria like "acl.permission.value" on a document instances. 
 
In plain sql, we could query joining document and permission on
document.aclid = permission.aclid. 
Using OJB, this currently is not possible, because i am not able to define a
collection descriptor on document mapping permissions.
 
This would become possible, if we were able to specify a
foreignkey-attribute on a collection descriptor. Example:
 

.
.

element-class-ref="ibanx.security.Permission" 
   auto-retrieve="false" 
   auto-update="false" 
   auto-delete="false">




 
This collection descriptor defines a collection of Permissions on the
document class, using aclId of document as foreignkey, matching
it with aclid of Permission. I can use this descriptor for querying
purposes, and now OJB only can to join the document and permission tables
using nested objects in criteria like "permission.value" on a document
instance.
 
Within our app, this kind of join pattern appears several times, sometimes
even several times within one query, needless to say that we are
experiencing some performance issues when the rather more complex queries
are being executed, to a point were the application becomes not usable.
 
I tried to look what i had to change within OJB source code myself, so i
could deliver a patch, but i noticed the complexity of the interaction
between CollectionDescriptor, XMLHandlers and SQL statement generators. So i
do not really know were to start.
 
So my question is, do you think this would be a usefull feature, and might
it be implemented in the future.
If it is obvious what needs to be changed, can onyone point me in the right
direction, so i can patch the 1.0-rc6 version we are still using.
 
thanx,
 
Roger Janssen
iBanx

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


Re: PBKey

2004-12-08 Thread Thomas Franke
[EMAIL PROTECTED] wrote:
The xml files are in the resources folder wihich is under classes. I tried 
also to out the files directly in the folder classes - with the same 
result.
Have you removed the old work directory before you restarted? That's 
sometimes the reason for an error. The changed xml files couldn't be 
compiled.

--
Mit freundlichen Grüßen
Thomas Franke
Geschäftsführer
Leiter Entwicklung

The energy for a better world

softEnergy GmbH
Platz der Freundschaft 1
18059 Rostock

fon: +49 381 40 587 535
fax: +49 381 40 587 555
mobil: +49 1715222015
http://www.softenergy.de
mail: [EMAIL PROTECTED]

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


Re: PBKey

2004-12-08 Thread Michael . Sack
The xml files are in the resources folder wihich is under classes. I tried 
also to out the files directly in the folder classes - with the same 
result.

[JDO] DEBUG: OjbStoreConnector.begin: connectionReadyForRelease=false
org.apache.ojb.broker.PBFactoryException: There was no default-PBKey 
specified
at 
org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.defaultPersistenceBroker(Unknown
 
Source)
at 
org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unknown 
Source)
at org.apache.ojb.jdori.sql.OjbStoreConnector.begin(Unknown 
Source)
at com.sun.jdori.common.TransactionImpl.beginInternal(Unknown 
Source)
at com.sun.jdori.common.TransactionImpl.begin(Unknown Source)
at org.myProject.appli.Demo.storing(Demo.java:97)
at org.myProject.appli.Demo.main(Demo.java:110)
Exception in thread "main" 


There  must be another mistake.

regards

Re: PBKey

2004-12-08 Thread Thomas Franke
[EMAIL PROTECTED] wrote:
Hello,
I want to start the damo.class from the destination folder of this class. 
My repository.xml files are in target \classes\resources. How can i set it 
that he finds this files
I remember at first we had this problem too.
Put it under \classes. That's all.
We have exported our application into a jar file and the repository.xml 
is in the root in this jar file. It's the same as under \classes.

regards
Thomas
--
Mit freundlichen Grüßen
Thomas Franke
Geschäftsführer
Leiter Entwicklung

The energy for a better world

softEnergy GmbH
Platz der Freundschaft 1
18059 Rostock

fon: +49 381 40 587 535
fax: +49 381 40 587 555
mobil: +49 1715222015
http://www.softenergy.de
mail: [EMAIL PROTECTED]

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


RE: PBKey

2004-12-08 Thread Michael . Sack
 If you mean this part of my repository_database.xml, then "yes" i have set 
it. But it can be possible that there is something wrong in my setting. I 
use the MySQL 4.1 Server and Java 1.4.2.

   


regards

Michael

Re: PBKey

2004-12-08 Thread Michael . Sack
Hello,

I want to start the damo.class from the destination folder of this class. 
My repository.xml files are in target \classes\resources. How can i set it 
that he finds this files?


regards

Michael

RE: PBKey

2004-12-08 Thread Daniel Perry
Have you got a default connection-descriptor set up in
repository_database.xml properly?

Are OJB.properties/repository***.xml (x4) all in classpath?

Daniel.

> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> Sent: 08 December 2004 10:50
> To: [EMAIL PROTECTED]
> Subject: PBKey
>
>
> Hello,
> i got setup the database and all Tables. I tried to start my Demo
> application bu there is an error:
>
> org.apache.ojb.broker.PBFactoryException: There was no default-PBKey
> specified
> at
> org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.defaul
> tPersistenceBroker(Unknown
> Source)
> at
> org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceB
> roker(Unknown
> Source)
> at org.apache.ojb.jdori.sql.OjbStoreConnector.begin(Unknown
> Source)
> at com.sun.jdori.common.TransactionImpl.beginInternal(Unknown
> Source)
> at com.sun.jdori.common.TransactionImpl.begin(Unknown Source)
> at org.myProject.appli.Demo.storing(Demo.java:97)
> at org.myProject.appli.Demo.main(Demo.java:110)
> Exception in thread "main"
>
> Do u know what is ment with this massege? What do i have to do to solve
> this problem?
>
>
> regards
>
> Michael


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



Re: PBKey

2004-12-08 Thread Thomas Dudziak
[EMAIL PROTECTED] wrote:
Hello,
i got setup the database and all Tables. I tried to start my Demo 
application bu there is an error:

org.apache.ojb.broker.PBFactoryException: There was no default-PBKey 
specified
   at 
org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.defaultPersistenceBroker(Unknown 
Source)
   at 
org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unknown 
Source)
   at org.apache.ojb.jdori.sql.OjbStoreConnector.begin(Unknown 
Source)
   at com.sun.jdori.common.TransactionImpl.beginInternal(Unknown 
Source)
   at com.sun.jdori.common.TransactionImpl.begin(Unknown Source)
   at org.myProject.appli.Demo.storing(Demo.java:97)
   at org.myProject.appli.Demo.main(Demo.java:110)
Exception in thread "main" 

Do u know what is ment with this massege? What do i have to do to solve 
this problem?
 

The usual reasons for this error are either that OJB couldn't find the 
repository.xml (per default it should be in the directory where you 
start the app; if you're using the ojb-blank then you should start the 
app in build/resources), or that none of you jdbc-connection-descriptor 
entries in repository_database.xml has a default-connection="true" setting.

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


Criteria through extent (Was: Circular criteria)

2004-12-08 Thread Daniel Perry
It apprears that ojb doesnt like criteria at depths that go beyond an
extent.

My criteria is:
crit.addEqualTo("behaviourId", new Integer(id));
crit.addLessThan("rating", new Integer(1));
crit.addEqualTo("meeting.pdp.createdBy", new Integer(mid));

And this generates the following sql (shortened!):

SELECT ... FROM behaviourrating A0 INNER JOIN appraisal A1 ON
A0.meetingId=A1.id WHERE ((A0.behaviourId = '21') AND A0.rating < '1') AND
createdBy = '7'

As you can see, it generates the rating and behaviourId where clauses
properly.  But the third clause doesnt work.

The table appraisal is an extent of meeting.
behaviourRating.meeting points to a Meeting, not an appraisal.  At the
moment there is only one extent of meeting, but that will change in future,
so ditching meeting isnt an option.

Meeting doesnt have a reference to pdp, but appraisal does.

Should ojb handle this criteria? or should it say that as meeting doesnt
have a 'pdp.createdBy' defined, it will ignore it, even though all the
instanciable subclasses (Appraisal) do have!  This would seem fair enough,
although a little annoying!

Could i add a reference (and associated id) for pdp, and employee to
Meeting, but still keep all subclasses in separate tables?

Thanks,

Daniel.


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



PBKey

2004-12-08 Thread Michael . Sack
Hello,
i got setup the database and all Tables. I tried to start my Demo 
application bu there is an error:

org.apache.ojb.broker.PBFactoryException: There was no default-PBKey 
specified
at 
org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.defaultPersistenceBroker(Unknown
 
Source)
at 
org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unknown 
Source)
at org.apache.ojb.jdori.sql.OjbStoreConnector.begin(Unknown 
Source)
at com.sun.jdori.common.TransactionImpl.beginInternal(Unknown 
Source)
at com.sun.jdori.common.TransactionImpl.begin(Unknown Source)
at org.myProject.appli.Demo.storing(Demo.java:97)
at org.myProject.appli.Demo.main(Demo.java:110)
Exception in thread "main" 

Do u know what is ment with this massege? What do i have to do to solve 
this problem?


regards

Michael

RE: p6spy

2004-12-08 Thread Daniel Perry
Well, i added:
com.mysql.jdbc.Driver a = new com.mysql.jdbc.Driver();
com.p6spy.engine.spy.P6SpyDriver b = new com.p6spy.engine.spy.P6SpyDriver();

Just to verify that it was all there, and it came up with a different
error - couldnt find spy.properties in the classpath!

Copied that accross, and it seems to be working.  In the faq i found it
doesnt mention that you need to copy this file into the classpath!

Daniel.



> -Original Message-
> From: Armin Waibel [mailto:[EMAIL PROTECTED]
> Sent: 07 December 2004 19:28
> To: OJB Users List
> Subject: Re: p6spy
>
>
> Daniel Perry wrote:
> > Simple question - how do i use p6spy?
> >
> > I've recompiiled ojb with p6spy, and set mysql as the 'real'
> driver.  I've
> > copied the jar file and p6spy's jar.
> >
>
> p6spy, mysql driver jar really in classpath, typo in realdriver property?
> Sorry, that's all cross my my mind ;-)
>
> Armin
>
>
> > I've changed my repository to use p6spy (see below), and added
> the driver:
> >
> >  > jcd-alias="default"
> > default-connection="true"
> > platform="MySQL"
> > jdbc-level="2.0"
> > driver="com.p6spy.engine.spy.P6SpyDriver"
> > protocol="jdbc"
> > subprotocol="mysql"
> > dbalias="//localhost/lecrossingpdp"
> > username=""
> > password=""
> > batch-mode="false"
> >>
> >
> > But i get the error:
> > [org.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractImpl] ERROR:
> > Error getting Connection from DriverManager with url
> > (jdbc:mysql://localhost/lecrossingpdp) and driver
> > (com.p6spy.engine.spy.P6SpyDriver)
> > No suitable driver
> > java.sql.SQLException: No suitable driver
> > at java.sql.DriverManager.getConnection(Unknown Source)
> > at java.sql.DriverManager.getConnection(Unknown Source)
> > at
> >
> org.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractImpl.ne
> wConnectio
> > nFromDriverManager(ConnectionFactoryAbstractImpl.java:253)
> > at
> >
> org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl$ConP
> oolFactory
> > .makeObject(ConnectionFactoryPooledImpl.java:231)
> > at
> >
> org.apache.commons.pool.impl.GenericObjectPool.borrowObject(Generi
> cObjectPoo
> > l.java:816)
> > ...
> >
> >
> > Any ideas?
> > What have i missd?
> >
> > Thanks,
> > Daniel.
> >
> >
> > -
> > 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]



FEATURE REQUEST : specify foreign-key-attribute to use with colle ction descriptors instead of using primary of container class

2004-12-08 Thread Janssen, Roger
Hi guys, i've got a question.
 
I am using 1.0-rc6.
 
Currently, using a collection descriptor, you specify the inverse-foreignkey
attribute on the items of the collection, and these attributes are matched
with the value of the primary key of the object that contains the
collection.
 
However, consider the following (simplified) situation:
 
 
Document   Acl  Permission
id --->  id   <---|id
...|   ...   |...
...| |  aclId
aclId   -| ...
...
 
 
I have an class document, containing a foreignkey reference to a class Acl,
and i have a class permission containing a foreignkey reference to an acl.
The class document has an attribute acl populated by OJB by using a
reference descriptor.
The class Acl has an collection attribute permissions collected by OJB using
a collection descriptor.
 
When a query for documents, using permission criteria, the query becomes
complex, OJB joins document, acl and permission, using nested objects in
criteria like "acl.permission.value" on a document instances. 
 
In plain sql, we could query joining document and permission on
document.aclid = permission.aclid. 
Using OJB, this currently is not possible, because i am not able to define a
collection descriptor on document mapping permissions.
 
This would become possible, if we were able to specify a
foreignkey-attribute on a collection descriptor. Example:
 





 
This collection descriptor defines a collection of Permissions on the
document class, using aclId of document as foreignkey, matching
it with aclid of Permission. I can use this descriptor for querying
purposes, and now OJB only can to join the document and permission tables
using nested objects in criteria like "permission.value" on a document
instance.
 
Within our app, this kind of join pattern appears several times, sometimes
even several times within one query, needless to say that we are
experiencing some performance issues when the rather more complex queries
are being executed, to a point were the application becomes not usable.
 
I tried to look what i had to change within OJB source code myself, so i
could deliver a patch, but i noticed the complexity of the interaction
between CollectionDescriptor, XMLHandlers and SQL statement generators. So i
do not really know were to start.
 
So my question is, do you think this would be a usefull feature, and might
it be implemented in the future.
If it is obvious what needs to be changed, can onyone point me in the right
direction, so i can patch the 1.0-rc6 version we are still using.
 
thanx,
 
Roger Janssen
iBanx