Re: JDO

2003-02-25 Thread Hiran Chaudhuri
Hi, Robert.

Be aware that Sun just built a reference implementation to show off the
functionality. They access a filesystem, which has no indexes for optimized
queries except the filename. They simply hit their goal (it works), and had
no ambitions to overfulfil it.

Hiran

- Original Message -
From: "Robert S. Sfeir" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
Sent: Tuesday, February 25, 2003 9:09 PM
Subject: Re: JDO


>
> On Tuesday, Feb 25, 2003, at 14:59 US/Eastern, Thomas Mahler wrote:
>
> > SO any queries that do a (non-primary key based) criteria lookup, will
> > result in loading the complete extent (all instances of a given class)
> > into memory an then filter all matching instances.
> > This is even worse than an full table scan in the DBMS!
>
> WOA!  instant cartesian product!  Scan all rows of all tables you're
> selecting... Geez!  Nice going Sun!
>
>


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



long transactions

2003-02-25 Thread Phil Warrick
Hi Thomas,

A while ago, you mentioned that although long transactions are not 
currently supported, there are a few possible approaches:

>If you want to use the ODMG in your SessionBean scenario you have to
> implement your own simple long transaction mechanism.
> (In the OTM package we will have such a feature implemented.)
> On the other hand ODMG is not the most natural fit for such a scenario.
> I recommemd to use the PersistenceBroker API for such cases!
Can you outline what the ODMG long transaction would look like in a 
SessionBean scenario?  And how PB is perhaps a better approach?  What 
will the OTM approach look like?

Over the last few months, I have been trying several avenues for 
modifying persistent objects on remote clients and then updating them on 
the server, and I still haven't arrived at a satisfactory approach.

Any thoughts and experiences in this area would be most appreciated.

Thanks,

Phil

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


Re: Generate table definitions?

2003-02-25 Thread Thomas Mahler
http://db.apache.org/ojb/platforms.html

http://db.apache.org/torque

Gabriel Bauman wrote:
Hi there!

I'm sure this has been asked many times here, but I'm wondering what the 
steps are to generate SQL tables from my repository.xml files. I've been 
puzzling over Torque for a few hours now. I'm missing something somewhere.

Any help or pointers to relevant documentation would be appreciated.

Gabe

-
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: Design Questions

2003-02-25 Thread Thomas Mahler
Hi Lucy,

Lucy Zhao wrote:
I am new to OJB and my previouse experience with TopLink 3 years ago was
quite bad. Basically I'm worried about the performance and the flxibility of
an Object relational mapping tool. In my application, 80% of transaction are
"Select" queries while the rest are "create, delete and updates". So I plan
to have two components for the data access layer, DAO to handle complicated
"select" and OJB to handle "create, delete, update and very simple select" .
A stateless session bean will call either a DAO or a OJB.  Questions: 1) Is
"OJB" in good use in the design 
yes, no problem with it.

2) Should I use "OJB" for all queries?

Yes, that can be beneficial for several reasons:
- OJB provides a connection pool or can be used to interfaced with it.
- OJB can be used to generate basic SQL statements, to maintain table 
and column names in a clear way.
- It can also be used to perform arbitrary SQL code
- and to materialize objects from arbitrary SQL code and still maintain 
a full integration with code that uses the O/R and tx management APIs.

Please have a look at PerformanceJdbcReferenceTest in 
src/test/org/apache/ojb/broker it contains some idioms demonstrating how 
native JDBC and OJB can be used together.

cheers,
Thomas
Thank you in advance for your reply. 
 
Lucy Zhao



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


Re: Generate table definitions?

2003-02-25 Thread Jeffrey Gilbert
I just figured it out myself.  It works and its pretty slick.  If you want I 
can put the steps in an email and send it your way.  Someone really needs to 
help project out with something like a getting started guide.

Just let me know if you still need assistance,

Jeff

On Tuesday 25 February 2003 05:47 pm, you wrote:
> Hi there!
>
> I'm sure this has been asked many times here, but I'm wondering what the
> steps are to generate SQL tables from my repository.xml files. I've been
> puzzling over Torque for a few hours now. I'm missing something somewhere.
>
> Any help or pointers to relevant documentation would be appreciated.
>
> Gabe
>
>
> -
> 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]



More on bug when PK field name != column name

2003-02-25 Thread Scott Howlett
I traced my problem further and found (I think) another place
where getAttributeName is being used incorrectly. Inside
PersistenceBrokerImpl.getMtoNQuery are the following lines:

for (int i = 0; i < itemClassFks.length; i++)
{
criteria.addEqualToColumn(
cod.getIndirectionTable() + "." + itemClassFks[i].toString(),
refCld.getPkFields()[i].getAttributeName());
}


I believe getAttributeName should be changed to getColumnName since
the data is being stuffed into a column-equality Criteria.

Regards,
Scott Howlett

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



Bug in PersistenceBroker.getCount() ?

2003-02-25 Thread Scott Howlett
I just changed my database schema such that one of my tables now has a
primary key field whose name is different than the column name in the
database.

Things worked OK in general until I referenced the table from another
table via an M:N association. I then got an SQL exception complaining
that I was trying to access the table using the field name, not the
column name.

I think I've traced the problem to PersistenceBrokerImpl.getCount(Query)
- in this routine a report query is made, but it's being populated with
attribute names, not column names. The offending lines of code:

for (int i = 0; i < pkFields.length; i++)
{
if (query.isDistinct())
{
columns[i] = "count(distinct " + pkFields[i].getAttributeName()
+ ")";
}
else
{
columns[i] = "count(" + pkFields[i].getAttributeName() + ")";
}
}

Should the above getAttributeName() calls should be replaced with
getColumnName() instead?

Regards,
Scott Howlett

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



Intersection queries and subquery attributes

2003-02-25 Thread Scott Howlett
Hello,

Is it possible in OJB to do these two things?

1. Create a Query representing the intersection of two other
Queries (intersection to be executed in the database)

2. Use Criteria.addEqualToField() within a subquery where the named
field actually comes from an object in a parent or grandparent query.

Thanks,
Scott Howlett


PS - To explain a bit more, here's a simplified version of what
I'm trying to do.

Represent access privileges between users and documents:

- Users can be in groups, documents can also be in groups
- Entitlement is specified either directly (user_id <-> document_id)
  or indirectly (via user or group id).
- id values are globally unique.

tables are like this (just showing the primary key columns):

user { id }
user_group { id }
user_group_membership { user_id, user_group_id }

doc { id }
doc_group { id }
doc_group_membership { doc_id, doc_group_id }

entitlement { user_or_user_group_id, doc_or_doc_group_id }

Given a particular user with id , accessible documents are
those with a non-null intersection of (user / user group entitlements)
and (doc / doc group entitlements) (pseudo-SQL):

select * from doc where

(select count (*) from (
(select * from entitlement where
(user_or_user_group_id = ) or
(user_or_user_group_id in
(select user_group_id from user_group_membership where
 user_id = )))

intersect

(select * from entitlement where
(doc_or_doc_group_id = id) or
(doc_or_doc_group_id in
   (select doc_group_id from doc_group_membership where
doc_id = id)))
)) > 0

My question #1 is because of the 'intersect' statement.

My question #2 is because in the second sub-sub-query, I'm
twice referring to the document field 'id' which comes
from the top-level query 'select * from doc'.

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



Generate table definitions?

2003-02-25 Thread Gabriel Bauman
Hi there!

I'm sure this has been asked many times here, but I'm wondering what the 
steps are to generate SQL tables from my repository.xml files. I've been 
puzzling over Torque for a few hours now. I'm missing something somewhere.

Any help or pointers to relevant documentation would be appreciated.

Gabe

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


Design Questions

2003-02-25 Thread Lucy Zhao
I am new to OJB and my previouse experience with TopLink 3 years ago was
quite bad. Basically I'm worried about the performance and the flxibility of
an Object relational mapping tool. In my application, 80% of transaction are
"Select" queries while the rest are "create, delete and updates". So I plan
to have two components for the data access layer, DAO to handle complicated
"select" and OJB to handle "create, delete, update and very simple select" .
A stateless session bean will call either a DAO or a OJB.  Questions: 1) Is
"OJB" in good use in the design 2) Should I use "OJB" for all queries?
 
Thank you in advance for your reply. 
 
Lucy Zhao


Re: JDO

2003-02-25 Thread Robert S. Sfeir
point taken.  Fair enough :-)

On Tuesday, Feb 25, 2003, at 15:25 US/Eastern, Thomas Mahler wrote:

Hi again Robert,

Robert S. Sfeir wrote:
On Tuesday, Feb 25, 2003, at 14:59 US/Eastern, Thomas Mahler wrote:
SO any queries that do a (non-primary key based) criteria lookup, 
will result in loading the complete extent (all instances of a given 
class) into memory an then filter all matching instances.
This is even worse than an full table scan in the DBMS!
WOA!  instant cartesian product!  Scan all rows of all tables you're 
selecting... Geez!  Nice going Sun!
to be fair:
SUN did not write the JDORI to provide performant access to any real 
database, but as a proof of concept of the JDO specification.
It's not meant for production.
They designed these interfaces for a simple OODBMS (called FoStore).
I think we can be very happy that they designed their JDORI in such a 
flexible way that allows to plug in the OjbStore adaptor at all.

cheers,
Thomas
-
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: OJB-0.9.9 + MySQL ODMG Startup Problem

2003-02-25 Thread Thomas B. Holdren
That did the trick, fellas.

Thanks so much.  Now to dig back in ^_^

--
Thomas Brian Holdren, Systems Programmer
Health Design Plus
"It's not what you know that is important,  it's knowing how to find 
what you
don't know.'

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


RE: auditing mapped classes

2003-02-25 Thread Ebersole, Steven
I think ideally this fits as low on the persistence mechanism as possible
(i.e., the DB).  However, the thought of implementing this as a web of
triggers, when I have a nice Object layer directly above, just seems silly.

I impetus behind this is that I am writing a thin interface layer over (and
hiding) the particular O/R implementation; much like you have spoken about
on this list quite a few times.  Currently Castor is built and OJB is a work
in progress and TopLink is on the horizon.  Castor has no such concept,
although they too have the callback mechanism.  This is what lead me to the
InvocationHandler/Map/Journaler approach.  Basically the domain objects
extend a base, which instantiates a InvocationHandler-wrapped Map and
listens for persistence callbacks.  The Map also has an attached
"Journaller" responsible for maintaining changes state of the object
(similiar to the DB concept).  At transaction start, it initiailizes the
Journaler and begins recording changes.  At commit, it notifies an EventHub
which is responsible for in turn notifying the integration and audting
gateways.

Then, on doing some advanced scouting on the TopLink stuff, I noticed the
changeset stuff and thought it would be really, really nice to have this
refactored out of the domain classes theselves.  I guess, I wasn't thinking
of the processing integrated into the O/R layer, just a callback-level
interface so that parallel systems could basically register interest in
changes.

With the OJB persistence wrapping, I was hoping to utilize the PB approach.
But it sounds like this will not be possible.



|-Original Message-
|From: Thomas Mahler [mailto:[EMAIL PROTECTED]
|Sent: Tuesday, February 25, 2003 2:16 PM
|To: OJB Users List
|Subject: Re: auditing mapped classes
|
|
|Hi STeven,
|
|Ebersole, Steven wrote:
|> I'll take silence as a no...
|
|In my case silence just means "tom did not find the time to answer 
|yet... or even worse he did miss the original posting..."
|
|> 
|> |-Original Message-
|> |From: Ebersole, Steven [mailto:[EMAIL PROTECTED]
|> |Sent: Monday, February 24, 2003 10:35 AM
|> |To: OJB Users List (E-mail)
|> |Subject: auditing mapped classes
|> |
|> |
|> |I was wondering if OJB has built-in support for auditing 
|> |state changes in
|> |the classes which are mapped under its control.  What I am 
|> |thinking of is
|> |something along the lines of TopLink's changeset concept.
|
|depends on the API we are talking about:
|- For OJB-PersistenceBroker it's a clear no.
|- For OJB-JDO it's a clear yes. The JDO spec does require JDO 
|implementations to do this. The required code is injected into the 
|persistent classes by bytecode  enhancement.
|- For OJB-ODMG it's a clear "partially":
|in our ODMG implementation all instances managed by a 
|transaction are 
|inserted into so called ObjectEnvelope objects. The ObjectEnvelope 
|implements the contract between a persistent instance and 
|the ODMG ty 
|management. It contains a snapshot of the persistent 
|instance of the 
|point in time when it was registered.
|This Envelope is use on TX commit to detect all changes to the 
|persistent instance.
|But as we do no bytecode enhancement in ODMG, we don't get 
|triggered, 
|when user code modifies an instance under ODMG control.
|
|
|> |Currently I have a base domain class which is responsible 
|> |for tracking these
|> |property changes, and then publishing notification to an 
|> |event manager which
|> |brokers those notifications to auditing and 
|integration gateways.
|> |
|> |In TopLink, I could utilize its EventManager and 
|DescriptorEvent to
|> |externalize this whole process (basically refactoring it 
|> |out of the domain
|> |classes).  And basically, I was just wondering if 
|> |something similiar already
|> |exists in OJB.
|
|No there is nothing that maps directly to this concepts. 
|We only provide 
|simple instance callback mechanisms to inform instances about 
|persistence operations going on.
|
|But (apart from the bytecode enhanced JDO) we do not 
|interfere with user 
|code accessing attributes.
|
|
|Do you think this is an important functionality for an O/R layer?
|Where (which OJB layer) could you imagine to fit it in?
|Would a generalized bytecode-enhancement or an aspect 
|weaving mechanism 
|be a possible solution?
|
|cheers,
|Thomas
|
|
|
|> |
|> |
|> |
|> |
|> |Steve Ebersole
|> |IT Integration Engineer
|> |Vignette Corporation 
|> |Office: 512.741.4195
|> |Mobile: 512.297.5438

Re: OJB-0.9.9 + MySQL ODMG Startup Problem

2003-02-25 Thread Armin Waibel
Hi,

known bug in 0.9.9

- Original Message -
From: "Armin Waibel" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
Sent: Monday, February 24, 2003 8:57 PM
Subject: Re: OMDG Tutorial2 won't run as written


> Hi Joerg,
>
> I have checked in a fix for tutorial2. Please replace the
> Application.java file of tutorial2 with the new version
> you could get here:
>
http://cvs.apache.org/viewcvs.cgi/db-ojb/src/test/org/apache/ojb/tutoria
l2/
>
> With this fix and the out of box configuration files the tutorial
> runs without problem (I used current CVS, but I think with
> 0.9.9 it should run too).
>
> HTH
> regards,
> Armin


regards,
Armin
- Original Message -
From: "Thomas B. Holdren" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 25, 2003 7:50 PM
Subject: OJB-0.9.9 + MySQL ODMG Startup Problem


> Greetings,
>
> I'm trying to do my first OJB project, and I'm not getting very far.
I
> was able to get tutorial1 to work, and I was able to use the
Persistence
> Broker functionality in my own test app just fine by basically copying
> tutorial1 code into a test app and modifying it a bit.  So PB API
works
> good.
>
> Now I'm trying to use the tutorial2, ODMG API, and I get the same
error
> trying to run the tutorial2 program as I do when I copy its code into
my
> test application.  I have heard no changes need to be made to the
> repository.xml files to switch API's, correct me if I'm wrong.
>
> As I said, the PB API works fine for me, but using the same xml files
> and when I try to db.open(databaseName, Database.OPEN_READ_WRITE) I
get
> the following stack trace:
>
> ===
> [org.apache.ojb.broker.metadata.ConnectionRepository] INFO: Could not
> found org.apache.ojb.broker.metadata.JdbcConnectionDescriptor for
PBKey
> org.apache.ojb.broker.PBKey: repository=repository.xml, user=null,
> password=null
> java.lang.reflect.InvocationTargetException
>  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
> [org.apache.ojb.broker.accesslayer.ConnectionManagerFactory] ERROR:
> ConfigurableFactory instantiation failed for class class
> org.apache.ojb.broker.accesslayer.ConnectionManagerImpl
> * Factory types:
> 1 - Type: org.apache.ojb.broker.PersistenceBroker
>  at
>
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorA
ccessorImpl.java:39)
> * Factory arguments:
> 1 - Argument:
[EMAIL PROTECTED]
> null
>  at
>
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCons
tructorAccessorImpl.java:27)
>  at
java.lang.reflect.Constructor.newInstance(Constructor.java:274)
> [org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl] ERROR:
> Creation of a new PB instance failed
> null
>  at org.apache.ojb.broker.util.ClassHelper.newInstance(Unknown
Source)
>  at
>
org.apache.ojb.broker.util.factory.ConfigurableFactory.createNewInstance
(Unknown
> Source)
>  at
>
org.apache.ojb.broker.util.factory.ConfigurableFactory.createNewInstance
(Unknown
> Source)
>  at
>
org.apache.ojb.broker.accesslayer.ConnectionManagerFactory.createConnect
ionManager(Unknown
> Source)
> [org.apache.ojb.odmg.DatabaseImpl] ERROR: Open database failed: Borrow
> broker from pool failed: Creation of a new PB instance failed
> Borrow broker from pool failed: Creation of a new PB instance failed
>  at
> org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.(Unknown
Source)
>  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
>  at
>
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorA
ccessorImpl.java:39)
>  at
>
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCons
tructorAccessorImpl.java:27)
>  at
java.lang.reflect.Constructor.newInstance(Constructor.java:274)
>  at org.apache.ojb.broker.util.ClassHelper.newInstance(Unknown
Source)
>  at
>
org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl.createNewBr
okerInstance(Unknown
> Source)
>  at
>
org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl$PBKeyedPool
ableObjectFactory.makeObject(Unknown
> Source)
>  at
>
org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(Generic
KeyedObjectPool.java:748)
>  at
>
org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl.createPersi
stenceBroker(Unknown
> Source)
>  at
>
org.apache.ojb.broker.PersistenceBrokerFactory.createPersistenceBroker(U
nknown
> Source)
>  at org.apache.ojb.odmg.DatabaseImpl.open(Unknown Source)
>  at org.bswt.gabriel.test.UserTest2.(Unknown Source)
>  at org.bswt.gabriel.test.UserTest2.main(Unknown Source)
> Caused by: java.lang.NullPointerException
>  at
> org.apache.ojb.broker.platforms.PlatformFactory.getPlatformFor(Unknown
> Source)
>  at
> org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.(Unknown
> Source)
>  ... 22 more
> java.lang.reflect.InvocationTargetException
>  at sun.reflect.NativeConstructorAcces

RE: OJB-0.9.9 + MySQL ODMG Startup Problem

2003-02-25 Thread REN,ZHANGLING (HP-Boise,ex1)
I got mine working by opening database with 'jcd-alias' instead of
databaseName:

  db.open(, Database.OPEN_READ_WRITE)

where  is defined in repository_database.xml. 

Zhangling Ren

-Original Message-
From: Thomas B. Holdren [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 25, 2003 11:51 AM
To: [EMAIL PROTECTED]
Subject: OJB-0.9.9 + MySQL ODMG Startup Problem


Greetings,

I'm trying to do my first OJB project, and I'm not getting very far.  I 
was able to get tutorial1 to work, and I was able to use the Persistence 
Broker functionality in my own test app just fine by basically copying 
tutorial1 code into a test app and modifying it a bit.  So PB API works 
good.

Now I'm trying to use the tutorial2, ODMG API, and I get the same error 
trying to run the tutorial2 program as I do when I copy its code into my 
test application.  I have heard no changes need to be made to the 
repository.xml files to switch API's, correct me if I'm wrong.

As I said, the PB API works fine for me, but using the same xml files 
and when I try to db.open(databaseName, Database.OPEN_READ_WRITE) I get 
the following stack trace:

===
[org.apache.ojb.broker.metadata.ConnectionRepository] INFO: Could not 
found org.apache.ojb.broker.metadata.JdbcConnectionDescriptor for PBKey 
org.apache.ojb.broker.PBKey: repository=repository.xml, user=null, 
password=null
java.lang.reflect.InvocationTargetException
 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
Method)
[org.apache.ojb.broker.accesslayer.ConnectionManagerFactory] ERROR: 
ConfigurableFactory instantiation failed for class class 
org.apache.ojb.broker.accesslayer.ConnectionManagerImpl
* Factory types:
1 - Type: org.apache.ojb.broker.PersistenceBroker
 at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAcces
sorImpl.java:39)
* Factory arguments:
1 - Argument: [EMAIL PROTECTED]
null
 at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstruc
torAccessorImpl.java:27)
 at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
[org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl] ERROR: 
Creation of a new PB instance failed
null
 at org.apache.ojb.broker.util.ClassHelper.newInstance(Unknown Source)
 at 
org.apache.ojb.broker.util.factory.ConfigurableFactory.createNewInstance(Unk
nown 
Source)
 at 
org.apache.ojb.broker.util.factory.ConfigurableFactory.createNewInstance(Unk
nown 
Source)
 at 
org.apache.ojb.broker.accesslayer.ConnectionManagerFactory.createConnectionM
anager(Unknown 
Source)
[org.apache.ojb.odmg.DatabaseImpl] ERROR: Open database failed: Borrow 
broker from pool failed: Creation of a new PB instance failed
Borrow broker from pool failed: Creation of a new PB instance failed
 at 
org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.(Unknown Source)
 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
Method)
 at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAcces
sorImpl.java:39)
 at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstruc
torAccessorImpl.java:27)
 at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
 at org.apache.ojb.broker.util.ClassHelper.newInstance(Unknown Source)
 at 
org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl.createNewBroker
Instance(Unknown 
Source)
 at 
org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl$PBKeyedPoolable
ObjectFactory.makeObject(Unknown 
Source)
 at 
org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeye
dObjectPool.java:748)
 at 
org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl.createPersisten
ceBroker(Unknown 
Source)
 at 
org.apache.ojb.broker.PersistenceBrokerFactory.createPersistenceBroker(Unkno
wn 
Source)
 at org.apache.ojb.odmg.DatabaseImpl.open(Unknown Source)
 at org.bswt.gabriel.test.UserTest2.(Unknown Source)
 at org.bswt.gabriel.test.UserTest2.main(Unknown Source)
Caused by: java.lang.NullPointerException
 at 
org.apache.ojb.broker.platforms.PlatformFactory.getPlatformFor(Unknown 
Source)
 at 
org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.(Unknown 
Source)
 ... 22 more
java.lang.reflect.InvocationTargetException
 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
Method)
 at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAcces
sorImpl.java:39)
 at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstruc
torAccessorImpl.java:27)
 at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
 at org.apache.ojb.broker.util.ClassHelper.newInstance(Unknown Source)
 at 
org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl.createNewBroker
Instance(Unknown 
Source)
 at 
org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl$PBKeyedPoolable
ObjectFactory.mak

Re: JDO

2003-02-25 Thread Thomas Mahler
Hi again Robert,

Robert S. Sfeir wrote:
On Tuesday, Feb 25, 2003, at 14:59 US/Eastern, Thomas Mahler wrote:

SO any queries that do a (non-primary key based) criteria lookup, will 
result in loading the complete extent (all instances of a given class) 
into memory an then filter all matching instances.
This is even worse than an full table scan in the DBMS!


WOA!  instant cartesian product!  Scan all rows of all tables you're 
selecting... Geez!  Nice going Sun!

to be fair:
SUN did not write the JDORI to provide performant access to any real 
database, but as a proof of concept of the JDO specification.
It's not meant for production.
They designed these interfaces for a simple OODBMS (called FoStore).
I think we can be very happy that they designed their JDORI in such a 
flexible way that allows to plug in the OjbStore adaptor at all.

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


RE: JDO

2003-02-25 Thread Andrew Gilbert
Wouldn't put this on Sun. Sounds more like an artificat of using the RI implementation 
to provide API support until a native solution is developed.


> -Original Message-
> From: Robert S. Sfeir [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, February 25, 2003 3:10 PM
> To: OJB Users List
> Subject: Re: JDO
> 
> 
> 
> On Tuesday, Feb 25, 2003, at 14:59 US/Eastern, Thomas Mahler wrote:
> 
> > SO any queries that do a (non-primary key based) criteria 
> lookup, will 
> > result in loading the complete extent (all instances of a 
> given class) 
> > into memory an then filter all matching instances.
> > This is even worse than an full table scan in the DBMS!
> 
> WOA!  instant cartesian product!  Scan all rows of all tables you're 
> selecting... Geez!  Nice going Sun!
> 
> 

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



Re: auditing mapped classes

2003-02-25 Thread Thomas Mahler
Hi STeven,

Ebersole, Steven wrote:
I'll take silence as a no...
In my case silence just means "tom did not find the time to answer 
yet... or even worse he did miss the original posting..."

|-Original Message-
|From: Ebersole, Steven [mailto:[EMAIL PROTECTED]
|Sent: Monday, February 24, 2003 10:35 AM
|To: OJB Users List (E-mail)
|Subject: auditing mapped classes
|
|
|I was wondering if OJB has built-in support for auditing 
|state changes in
|the classes which are mapped under its control.  What I am 
|thinking of is
|something along the lines of TopLink's changeset concept.
depends on the API we are talking about:
- For OJB-PersistenceBroker it's a clear no.
- For OJB-JDO it's a clear yes. The JDO spec does require JDO 
implementations to do this. The required code is injected into the 
persistent classes by bytecode  enhancement.
- For OJB-ODMG it's a clear "partially":
in our ODMG implementation all instances managed by a transaction are 
inserted into so called ObjectEnvelope objects. The ObjectEnvelope 
implements the contract between a persistent instance and the ODMG ty 
management. It contains a snapshot of the persistent instance of the 
point in time when it was registered.
This Envelope is use on TX commit to detect all changes to the 
persistent instance.
But as we do no bytecode enhancement in ODMG, we don't get triggered, 
when user code modifies an instance under ODMG control.


|Currently I have a base domain class which is responsible 
|for tracking these
|property changes, and then publishing notification to an 
|event manager which
|brokers those notifications to auditing and integration gateways.
|
|In TopLink, I could utilize its EventManager and DescriptorEvent to
|externalize this whole process (basically refactoring it 
|out of the domain
|classes).  And basically, I was just wondering if 
|something similiar already
|exists in OJB.
No there is nothing that maps directly to this concepts. We only provide 
simple instance callback mechanisms to inform instances about 
persistence operations going on.

But (apart from the bytecode enhanced JDO) we do not interfere with user 
code accessing attributes.

Do you think this is an important functionality for an O/R layer?
Where (which OJB layer) could you imagine to fit it in?
Would a generalized bytecode-enhancement or an aspect weaving mechanism 
be a possible solution?

cheers,
Thomas


|
|
|
|
|Steve Ebersole
|IT Integration Engineer
|Vignette Corporation 
|Office: 512.741.4195
|Mobile: 512.297.5438
|
|Visit http://www.vignette.com
|
|---
|--
|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: JDO

2003-02-25 Thread Robert S. Sfeir
On Tuesday, Feb 25, 2003, at 14:59 US/Eastern, Thomas Mahler wrote:

SO any queries that do a (non-primary key based) criteria lookup, will 
result in loading the complete extent (all instances of a given class) 
into memory an then filter all matching instances.
This is even worse than an full table scan in the DBMS!
WOA!  instant cartesian product!  Scan all rows of all tables you're 
selecting... Geez!  Nice going Sun!



Re: JDO

2003-02-25 Thread Thomas Mahler
Hi Hiran,

Hiran Chaudhuri wrote:
Hi, Thomas.

New to OBJ, I'm trying to decide whether to use it within my project as
persistence layer or not. I have concerns since I read on
http://db.apache.org/ojb/features.html that OQL support is incomplete, also
there are some flaws in transaction handling.
Don't be too concerned. We only try to frankly state the truth. I know 
exactly one vendor with an 100% ODMG compliant OODBMS.

I don't know any 100% SQL92 compliant database.

With our oql implementation you can do everything that is needed to 
select persistent entities. Of you need special query functionality you 
may use PersistenceBroker queries inside ODMG applications. There is a 
seamless integration.

I don't know of any transaction handling problems with ODMG.

Now the bad question: Do you estimate the JDO api of OBJ is stable enough to
build a project onto that? 
This is a question of how much risk you can afford. If you are willing 
to have some risks, yes.

Where could be pitfalls? 
1. performance. The current OJB / JDO solution is a plugin to SUNs 
JDORI.  They provide an interface to plugin different persistent store 
solutions. This interface does not provide an optimized query interface 
as the solution you find between OJB-ODMG and the OJB PersistenceBroker 
layer.
SO any queries that do a (non-primary key based) criteria lookup, will 
result in loading the complete extent (all instances of a given class) 
into memory an then filter all matching instances.
This is even worse than an full table scan in the DBMS!

With the current JDORI there are no ways to avoid this.

2. Testing. We have no regression testsuite for the JDO part yet.
Of course all bug that we here of get fixed asap.
Or do you suggest to use
the ODMG or even the PersistenceBroker APIs?
This really depends of the kind of project you want to run:
- For a small, innovatively minded, risk-tolerant project I'd use JDO.
- For a small, performance sensitive, minimum footprint solution I'd use 
PersistenceBroker
- For a big enterprise level, prime time app I'd still use ODMG.

just my 0.02 EUR,

Thomas

Hiran

- Original Message -
From: "Mahler Thomas" <[EMAIL PROTECTED]>
To: "'OJB Users List'" <[EMAIL PROTECTED]>
Sent: Wednesday, February 19, 2003 5:32 PM
Subject: AW: JDO


Hi Lennart,

By using SUNs JDORI and the OJB OjbStore Plugin (See tutorial4.html for
details) you have a fully compliant JDO solution today!
We want to have a full replacement of the upper JDORI layers for OJB 2.0.
This implementation will add no functionality but only have non-functional
improvements (performance, resource consumption).
There is no time schedule for this release yet.
cheers,
Thomas

-Ursprüngliche Nachricht-
Von: Lennart Benoot [mailto:[EMAIL PROTECTED]
Gesendet: Mittwoch, 19. Februar 2003 14:44
An: [EMAIL PROTECTED]
Betreff: JDO
Hey All,

Is there a date set forward when OJB will fully support JDO?

Regards,
Lennart
-
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: easy 1-1, 1-m association and inheritance

2003-02-25 Thread Thomas Mahler
Feel free to post it to the list!
We will review it!
thanks,
Thomas
TINE Houari (OBJECTIVA) wrote:
Hi,

No it's a personnal work. I finish tests and I propose it to anyone...

Houari

 -Message d'origine-
De : 	Rice Yeh [mailto:[EMAIL PROTECTED] 
Envoyé :	lundi 24 février 2003 12:46
À :	OJB Users List
Objet :	Re: easy 1-1, 1-m association and inheritance

Hi,
  Have this modification already checked into cvs
repository?
Regards,
Rice
--- "TINE Houari (OBJECTIVA)"
<[EMAIL PROTECTED]> wrote:
Hi,

I have modied the source code of OJB to enable
mapping 1:1 and 1:m
association without adding variable instance (that
model fk) in business
object. I also adding the possiblity to allow
automatically inheriance
without any effort. For later, the idea is to model
extended classes as 1:1
association with blank name.
Actually, this changes work fine for loading. For
updating and deleting,
tests are under way.
Houari TINE.


-Message d'origine-
De : 	TINE Houari (OBJECTIVA)
[mailto:[EMAIL PROTECTED] 
Envoyé :	mercredi 19 février 2003 14:01
À :	[EMAIL PROTECTED]
Objet :	dirty 1-1 association

Hi,

In the thesis "Javal baseeruv objektide püsivuse
kiht Jakamar" p. 17, there
is a good sentence:
"Adding persistence into the classes themselves is
not always possible -
they might be third 
party components." But OJB violates this principles
by forces introducing a
link modeling foreign
key for 1-1 association and inheritence.

For 1-1 association from A to B, it is necessary to
add a reference (calss
B) in class A to model 
the association: OK. But adding an integer (for
example) to model a database
foreig in the class A
is a very very bad thing. There is any way to avoid
that monstrosity.

Houari TINE


-

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]


__
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/
-
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: some OJB proxy questions

2003-02-25 Thread Thomas Mahler
Hi Maarten,

AFAIK this is not possible today.
But I think it's a feature request that could be beneficial for several 
users. I also believe that is not that difficult to implement.

It won't make it into 1.0, but we can place it on the post 1.0 roadmap.

For the time being you could try to use instance call-backs and use the 
onLoad callback to fill reference and collections attributes with your 
proxy objects.

cheers,
Thomas
Maarten Coene wrote:
Hi,

I have a couple of questions about the proxies.

1. I want to use dynamic proxies, but these proxies may not use the 
PersistenceBroker for querying the database. Instead, they must get the 
real object through an API I defined myself. The idea is to return 
object from my object model to clients, but these clients cannot access 
the database directly, they must use a specific component. This means 
that if I return proxies, these proxies must also use that component.

More concrete: the dynamic proxy wil do something like this to retrieve 
the object:

if (realObject == null) {
realObject = broker.getObjectByIdentity(id);
}
But I want this to be:

if (realObject == null) {
 realObject = myComponent.getObject(id);
}
Is it possible to do this with dynamic proxies? I know I can define my 
own proxy for each class from the object model, but using dynamic 
proxies would save me a lot of work.



2. If the above problem is not possible with dynamic proxies, is it 
possible to define my own proxy-class for proxy for a reference? It 
looks to me that the reference-descriptor element only allows the use of 
dynamic proxies for this purpose?

I want to do something like this:




regards,
Maarten Coene
-
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]


OJB-0.9.9 + MySQL ODMG Startup Problem

2003-02-25 Thread Thomas B. Holdren
Greetings,

I'm trying to do my first OJB project, and I'm not getting very far.  I 
was able to get tutorial1 to work, and I was able to use the Persistence 
Broker functionality in my own test app just fine by basically copying 
tutorial1 code into a test app and modifying it a bit.  So PB API works 
good.

Now I'm trying to use the tutorial2, ODMG API, and I get the same error 
trying to run the tutorial2 program as I do when I copy its code into my 
test application.  I have heard no changes need to be made to the 
repository.xml files to switch API's, correct me if I'm wrong.

As I said, the PB API works fine for me, but using the same xml files 
and when I try to db.open(databaseName, Database.OPEN_READ_WRITE) I get 
the following stack trace:

===
[org.apache.ojb.broker.metadata.ConnectionRepository] INFO: Could not 
found org.apache.ojb.broker.metadata.JdbcConnectionDescriptor for PBKey 
org.apache.ojb.broker.PBKey: repository=repository.xml, user=null, 
password=null
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
Method)
[org.apache.ojb.broker.accesslayer.ConnectionManagerFactory] ERROR: 
ConfigurableFactory instantiation failed for class class 
org.apache.ojb.broker.accesslayer.ConnectionManagerImpl
* Factory types:
1 - Type: org.apache.ojb.broker.PersistenceBroker
at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
* Factory arguments:
1 - Argument: [EMAIL PROTECTED]
null
at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
[org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl] ERROR: 
Creation of a new PB instance failed
null
at org.apache.ojb.broker.util.ClassHelper.newInstance(Unknown Source)
at 
org.apache.ojb.broker.util.factory.ConfigurableFactory.createNewInstance(Unknown 
Source)
at 
org.apache.ojb.broker.util.factory.ConfigurableFactory.createNewInstance(Unknown 
Source)
at 
org.apache.ojb.broker.accesslayer.ConnectionManagerFactory.createConnectionManager(Unknown 
Source)
[org.apache.ojb.odmg.DatabaseImpl] ERROR: Open database failed: Borrow 
broker from pool failed: Creation of a new PB instance failed
Borrow broker from pool failed: Creation of a new PB instance failed
at 
org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.(Unknown Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
Method)
at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at org.apache.ojb.broker.util.ClassHelper.newInstance(Unknown Source)
at 
org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl.createNewBrokerInstance(Unknown 
Source)
at 
org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl$PBKeyedPoolableObjectFactory.makeObject(Unknown 
Source)
at 
org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:748)
at 
org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl.createPersistenceBroker(Unknown 
Source)
at 
org.apache.ojb.broker.PersistenceBrokerFactory.createPersistenceBroker(Unknown 
Source)
at org.apache.ojb.odmg.DatabaseImpl.open(Unknown Source)
at org.bswt.gabriel.test.UserTest2.(Unknown Source)
at org.bswt.gabriel.test.UserTest2.main(Unknown Source)
Caused by: java.lang.NullPointerException
at 
org.apache.ojb.broker.platforms.PlatformFactory.getPlatformFor(Unknown 
Source)
at 
org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.(Unknown 
Source)
... 22 more
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
Method)
at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at org.apache.ojb.broker.util.ClassHelper.newInstance(Unknown Source)
at 
org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl.createNewBrokerInstance(Unknown 
Source)
at 
org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl$PBKeyedPoolableObjectFactory.makeObject(Unknown 
Source)
at 
org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:748)
at 
org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl.createPersistenceBroker(Unknown 
Source)
at 
org.apache.ojb.broker.PersistenceBrokerFactory.createPersistenceBroker(Unknown 
Source)
at org.apache.ojb.odmg.DatabaseImpl.open(Unknown Source)
at org.bswt.gabriel.t

Re: Query returning denormalised view

2003-02-25 Thread Ron Gallagher
John -- 

Use this constructor when you create your query object:

QueryByCriteria(Class,Criteria,boolean)

Passing true for the 3rd argument causes the generated sql to include the DISTINCT 
keyword.

Ron Gallagher
Atlanta, GA
[EMAIL PROTECTED]

> 
> From: O'Reilly John <[EMAIL PROTECTED]>
> Date: 2003/02/25 Tue PM 01:20:25 EST
> To: 'OJB Users List' <[EMAIL PROTECTED]>
> Subject: Query returning denormalised view
> 
> Hi,
> 
> I'm having a problem whereby a query that involves searching for values in a
> contained collection returns the same number of objects as the collection.
> Take, for example the case of a member object that has a collection of
> addresses.  If I do the following query.
> 
> crit.addLike("upper(name)", "%John Smith%" );
> crit.addLike("upper(addresses.addressLine1)", "%1 High Street%" ); //
> addressModel
> 
> Query query = new QueryByCriteria(MemberModel.class, crit);
> listOfMembers = getBroker().getCollectionByQuery(query);
> 
> The returned collection has as many objects as there are addresses (in my
> test case, I have a number of addresses (all the same) linked to the same
> member).  There should only be one member object which in turn contains a
> collection of addresses.
> 
> BTW, I'm using version 0.9.9 with the addition of the patch mentioned below:
> http://www.mail-archive.com/[EMAIL PROTECTED]/msg00447.html
> 
> The problem happens without the patch also.
> 
> Regards,
> John



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



Re: Can PersistenceBroker report queries be used within ODMG?

2003-02-25 Thread Thomas Mahler
Hi Mark,

Mark Neighbors wrote:
I see the new support for projectionAttributes in oql-ojb.g that generates pb report 
queries.
Got an example to work.
I see OQLQueryImpl.execute calling performLockingIfRequired but only for collection queries.

Is there a way to coordinate report queries with odmg locking?

Perhaps by

  (1) getting the LockMap from the LockMapFactory
  (2) retrieving the id in the report query
Only if there is a primary key returned by the report query. (In general 
report-queries need not return any PK columns)

  (3) creating a temp object of the corresponding persistent class with just the id
Only if the query corresponds to a persistent class (report queries 
could just be any SELECT statement)

  (4) caling LockMap.getWriter passing in the temp object
  (5) if null is returned then object is not write locked?
This seems to work.
If my two constraints are fulfilled this is OK. If not we are in trouble.

cheers,
Thomas
Thanks in advance,
Mark


-
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]


Query returning denormalised view

2003-02-25 Thread O'Reilly John
Hi,

I'm having a problem whereby a query that involves searching for values in a
contained collection returns the same number of objects as the collection.
Take, for example the case of a member object that has a collection of
addresses.  If I do the following query.

crit.addLike("upper(name)", "%John Smith%" );
crit.addLike("upper(addresses.addressLine1)", "%1 High Street%" ); //
addressModel

Query query = new QueryByCriteria(MemberModel.class, crit);
listOfMembers = getBroker().getCollectionByQuery(query);

The returned collection has as many objects as there are addresses (in my
test case, I have a number of addresses (all the same) linked to the same
member).  There should only be one member object which in turn contains a
collection of addresses.

BTW, I'm using version 0.9.9 with the addition of the patch mentioned below:
http://www.mail-archive.com/[EMAIL PROTECTED]/msg00447.html

The problem happens without the patch also.

Regards,
John

This e-mail and any files transmitted with it are confidential and may be
privileged and are intended solely for the individual named/ for the use of
the individual or entity to whom they are addressed.If you are not the
intended addressee, you should not disseminate, distribute or copy this
e-mail.Please notify the sender immediately if you have received this e-mail
by mistake and delete this e-mail from your system.If you are not the
intended recipient, you are notified that reviewing, disclosing, copying,
distributing or taking any action in reliance on the contents of this e-mail
is strictly prohibited.Please note that any views or opinions expressed in
this e-mail are solely those of the author and do not necessarily represent
those of Traventec Limited.E-mail transmission cannot be guaranteed to be
secure or error-free as information could be intercepted, corrupted, lost,
destroyed, or arrive late or incomplete.Traventec Limited therefore does not
accept liability for any errors or omissions in the contents of this
message, which arise as a result of e-mail transmission.The recipient should
check this e-mail and any attachments for the presence of viruses.This
e-mail has been swept for computer viruses however Traventec Limited accepts
no liability for any damage caused by any virus transmitted by this e-mail.

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



RE: auditing mapped classes

2003-02-25 Thread Ebersole, Steven
I'll take silence as a no...


|-Original Message-
|From: Ebersole, Steven [mailto:[EMAIL PROTECTED]
|Sent: Monday, February 24, 2003 10:35 AM
|To: OJB Users List (E-mail)
|Subject: auditing mapped classes
|
|
|I was wondering if OJB has built-in support for auditing 
|state changes in
|the classes which are mapped under its control.  What I am 
|thinking of is
|something along the lines of TopLink's changeset concept.
|
|Currently I have a base domain class which is responsible 
|for tracking these
|property changes, and then publishing notification to an 
|event manager which
|brokers those notifications to auditing and integration gateways.
|
|In TopLink, I could utilize its EventManager and DescriptorEvent to
|externalize this whole process (basically refactoring it 
|out of the domain
|classes).  And basically, I was just wondering if 
|something similiar already
|exists in OJB.
|
|
|
|
|Steve Ebersole
|IT Integration Engineer
|Vignette Corporation 
|Office: 512.741.4195
|Mobile: 512.297.5438
|
|Visit http://www.vignette.com
|
|---
|--
|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]



Deleting objects in a collection

2003-02-25 Thread Sander Hofstee
Hi,

I'm trying to delete objects from a collection, it seems to workin the 
code, but when I look in the database the object is still there.

This is what I do:

First I add en element to the collection and save all the objects, by 
putting a lock on ALL.
At this point the application and the database are the same

Then i reload the main object and remove the object (the same that I 
added before) from the collection
and save all objects, that is I save the main object with an empty 
collection.
when I reload the data at this point  the data seems to be saved in the 
application, but when i look in the database
the data I deleted is still there, including the reference to my collection.

I use  auto-retrieve="true" auto-update="true" auto-delete="true"

What am i doing wrong?

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


M:N mappings and User defined collections

2003-02-25 Thread José Manuel Vázquez
I'm trying something similar as defined in:
http://db.apache.org/ojb/tutorial3.html#Support%20for%20non-decomposed%20m:n
%20mappings

Support for non-decomposed m:n mappings, but using a user-defined collection
instead java.util.Collection as in the example with Persons and Projects.

My test example is:
 - Classes A and B have id and name attributes.
 - Class C is a typed collection of B objects and implements
ManageableCollection.
 - Class A has a collection of B objects. (a C attribute)
   In the collection descriptor of A I declare the
indirection-table="AB_Table".


Reading from database is OK, but when saving an A object I got a
ClassCastException.

Has anyone got success with something similar like this?



This is my test repository_user.xml:


  
  
  


  



  
  



---Publicidad
Únete a los miles de sin pareja en Meetic... ¡te vas a enamorar!
http://www.iespana.es/_reloc/email.meetic


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



RE: How to use multiple aliases for one class/table in query

2003-02-25 Thread Janssen, Roger
and of course... this way it becomes an OR relation between the keywords...
i want the issues that have all three keywords... not just one of them,
thats why the multiple aliases are needed

Roger Janssen   mailto:[EMAIL PROTECTED]
  
iBanx B.V   http://www.ibanx.nl   
Kon. Wilhelminaplein 13 tel +31-20-5727900  
P.O. Box 69289  fax +31-20-5727901  
1060 CH Amsterdam   mobile +31-6-505 267 13 
The Netherlands 



-Original Message-
From: Gelhar, Wallace J. [mailto:[EMAIL PROTECTED]
Sent: 25 February 2003 18:01
To: OJB Users List
Subject: RE: How to use multiple aliases for one class/table in query


Why would it not use an IN clause?

SELECT DISTINCT * 
FROM ISSUE A0 INNER JOIN KEYWORD A1 ON A0.ID=A1.OID 
WHERE A1.VALUE IN ('OJB', 'join', 'alias')

Wally

-Original Message-
From: Janssen, Roger [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 25, 2003 10:55 AM
To: OJB Users List (E-mail)
Subject: How to use multiple aliases for one class/table in query


Hi,
 
I posed this question earlier but i haven't seen any response yet. I'll
try it again, a bit different this time.
 
Suppose i have an application registering issues, and in which i can
assign keywords to issues. The keywords are stored in a different table
(with a fk-relation to the related issue).
 
OJB could automatically load the related keywords when fethcing the
issue.
 
So far, so good.
 
Now i would like to retrieve all issues that have the following
keywords; 'OJB', 'join' and 'alias'.
 
The generated query should be something like this:
SELECT DISTINCT * 
FROM ISSUE A0 INNER JOIN KEYWORD A1 ON A0.ID=A1.OID 
  INNER JOIN KEYWORD  A2 ON A0.ID=A2.OID
  INNER JOIN KEYWORD  A3 ON A0.ID=A3.OID
  INNER JOIN KEYWORD  A4 ON A0.ID=A4.OID WHERE (
A1.VALUE= 'OJB' ) AND ( A2.NAME = 'join' ) AND (A3.VALUE = 'alias' )
 
Using the PB API, and the query/criteria classes, how can i get this
query to be generated and executed?
 
I do not think this is some weird use-case? I know the OJB OQL does not
support 'alias'-ing (according to documentation en some experiments i
have
done) so ODMG api is no option (i also don't want to use it). PB api
supports 'alias'-ing but i can not seem to get OJB to generate multiple
aliases in one query for the same objectclass/table.
 
What am i missing?
 
Roger Janssen
mailto:[EMAIL PROTECTED]
iBanx B.V http://www.ibanx.nl 




 



*
The information contained in this communication is confidential and is
intended solely for the use of the individual or entity to  whom it is
addressed.You should not copy, disclose or distribute this communication

without the authority of iBanx bv. iBanx bv is neither liable for 
the proper and complete transmission of the information has been
maintained nor that the communication is free of viruses, interceptions
or interference.

If you are not the intended recipient of this communication please
return the communication to the sender and delete and destroy all
copies.

-
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: How to use multiple aliases for one class/table in query

2003-02-25 Thread Janssen, Roger
Well, that would mean that for 1 and the same keyword record (used in this
join) the field VALUE would have to hold all these three values at the same
time... that can't be 

Roger Janssen   mailto:[EMAIL PROTECTED]
  
iBanx B.V   http://www.ibanx.nl   
Kon. Wilhelminaplein 13 tel +31-20-5727900  
P.O. Box 69289  fax +31-20-5727901  
1060 CH Amsterdam   mobile +31-6-505 267 13 
The Netherlands 



-Original Message-
From: Gelhar, Wallace J. [mailto:[EMAIL PROTECTED]
Sent: 25 February 2003 18:01
To: OJB Users List
Subject: RE: How to use multiple aliases for one class/table in query


Why would it not use an IN clause?

SELECT DISTINCT * 
FROM ISSUE A0 INNER JOIN KEYWORD A1 ON A0.ID=A1.OID 
WHERE A1.VALUE IN ('OJB', 'join', 'alias')

Wally

-Original Message-
From: Janssen, Roger [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 25, 2003 10:55 AM
To: OJB Users List (E-mail)
Subject: How to use multiple aliases for one class/table in query


Hi,
 
I posed this question earlier but i haven't seen any response yet. I'll
try it again, a bit different this time.
 
Suppose i have an application registering issues, and in which i can
assign keywords to issues. The keywords are stored in a different table
(with a fk-relation to the related issue).
 
OJB could automatically load the related keywords when fethcing the
issue.
 
So far, so good.
 
Now i would like to retrieve all issues that have the following
keywords; 'OJB', 'join' and 'alias'.
 
The generated query should be something like this:
SELECT DISTINCT * 
FROM ISSUE A0 INNER JOIN KEYWORD A1 ON A0.ID=A1.OID 
  INNER JOIN KEYWORD  A2 ON A0.ID=A2.OID
  INNER JOIN KEYWORD  A3 ON A0.ID=A3.OID
  INNER JOIN KEYWORD  A4 ON A0.ID=A4.OID WHERE (
A1.VALUE= 'OJB' ) AND ( A2.NAME = 'join' ) AND (A3.VALUE = 'alias' )
 
Using the PB API, and the query/criteria classes, how can i get this
query to be generated and executed?
 
I do not think this is some weird use-case? I know the OJB OQL does not
support 'alias'-ing (according to documentation en some experiments i
have
done) so ODMG api is no option (i also don't want to use it). PB api
supports 'alias'-ing but i can not seem to get OJB to generate multiple
aliases in one query for the same objectclass/table.
 
What am i missing?
 
Roger Janssen
mailto:[EMAIL PROTECTED]
iBanx B.V http://www.ibanx.nl 




 



*
The information contained in this communication is confidential and is
intended solely for the use of the individual or entity to  whom it is
addressed.You should not copy, disclose or distribute this communication

without the authority of iBanx bv. iBanx bv is neither liable for 
the proper and complete transmission of the information has been
maintained nor that the communication is free of viruses, interceptions
or interference.

If you are not the intended recipient of this communication please
return the communication to the sender and delete and destroy all
copies.

-
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: How to use multiple aliases for one class/table in query

2003-02-25 Thread Gelhar, Wallace J.
Why would it not use an IN clause?

SELECT DISTINCT * 
FROM ISSUE A0 INNER JOIN KEYWORD A1 ON A0.ID=A1.OID 
WHERE A1.VALUE IN ('OJB', 'join', 'alias')

Wally

-Original Message-
From: Janssen, Roger [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 25, 2003 10:55 AM
To: OJB Users List (E-mail)
Subject: How to use multiple aliases for one class/table in query


Hi,
 
I posed this question earlier but i haven't seen any response yet. I'll
try it again, a bit different this time.
 
Suppose i have an application registering issues, and in which i can
assign keywords to issues. The keywords are stored in a different table
(with a fk-relation to the related issue).
 
OJB could automatically load the related keywords when fethcing the
issue.
 
So far, so good.
 
Now i would like to retrieve all issues that have the following
keywords; 'OJB', 'join' and 'alias'.
 
The generated query should be something like this:
SELECT DISTINCT * 
FROM ISSUE A0 INNER JOIN KEYWORD A1 ON A0.ID=A1.OID 
  INNER JOIN KEYWORD  A2 ON A0.ID=A2.OID
  INNER JOIN KEYWORD  A3 ON A0.ID=A3.OID
  INNER JOIN KEYWORD  A4 ON A0.ID=A4.OID WHERE (
A1.VALUE= 'OJB' ) AND ( A2.NAME = 'join' ) AND (A3.VALUE = 'alias' )
 
Using the PB API, and the query/criteria classes, how can i get this
query to be generated and executed?
 
I do not think this is some weird use-case? I know the OJB OQL does not
support 'alias'-ing (according to documentation en some experiments i
have
done) so ODMG api is no option (i also don't want to use it). PB api
supports 'alias'-ing but i can not seem to get OJB to generate multiple
aliases in one query for the same objectclass/table.
 
What am i missing?
 
Roger Janssen
mailto:[EMAIL PROTECTED]
iBanx B.V http://www.ibanx.nl 




 



*
The information contained in this communication is confidential and is
intended solely for the use of the individual or entity to  whom it is
addressed.You should not copy, disclose or distribute this communication

without the authority of iBanx bv. iBanx bv is neither liable for 
the proper and complete transmission of the information has been
maintained nor that the communication is free of viruses, interceptions
or interference.

If you are not the intended recipient of this communication please
return the communication to the sender and delete and destroy all
copies.

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



How to use multiple aliases for one class/table in query

2003-02-25 Thread Janssen, Roger
Hi,
 
I posed this question earlier but i haven't seen any response yet. I'll try
it again, a bit different this time.
 
Suppose i have an application registering issues, and in which i can assign
keywords to issues.
The keywords are stored in a different table (with a fk-relation to the
related issue).
 
OJB could automatically load the related keywords when fethcing the issue.
 
So far, so good.
 
Now i would like to retrieve all issues that have the following keywords;
'OJB', 'join' and 'alias'.
 
The generated query should be something like this:
SELECT DISTINCT * 
FROM ISSUE A0 INNER JOIN KEYWORD A1 ON A0.ID=A1.OID 
  INNER JOIN KEYWORD  A2 ON A0.ID=A2.OID
  INNER JOIN KEYWORD  A3 ON A0.ID=A3.OID
  INNER JOIN KEYWORD  A4 ON A0.ID=A4.OID
WHERE ( A1.VALUE= 'OJB' ) AND ( A2.NAME = 'join' ) AND (A3.VALUE = 'alias' )
 
Using the PB API, and the query/criteria classes, how can i get this query
to be generated and executed?
 
I do not think this is some weird use-case? I know the OJB OQL does not
support 'alias'-ing (according to documentation en some experiments i have
done) so ODMG api is no option (i also don't want to use it).
PB api supports 'alias'-ing but i can not seem to get OJB to generate
multiple aliases in one query for the same objectclass/table.
 
What am i missing?
 
Roger Janssen
mailto:[EMAIL PROTECTED]
iBanx B.V http://www.ibanx.nl 




 


*
The information contained in this communication is confidential and is
intended solely for the use of the individual or entity to  whom it is
addressed.You should not copy, disclose or distribute this communication 
without the authority of iBanx bv. iBanx bv is neither liable for 
the proper and complete transmission of the information has been maintained
nor that the communication is free of viruses, interceptions or interference.

If you are not the intended recipient of this communication please return
the communication to the sender and delete and destroy all copies.


Re: JDO

2003-02-25 Thread Hiran Chaudhuri
Hi, Thomas.

New to OBJ, I'm trying to decide whether to use it within my project as
persistence layer or not. I have concerns since I read on
http://db.apache.org/ojb/features.html that OQL support is incomplete, also
there are some flaws in transaction handling.

Now the bad question: Do you estimate the JDO api of OBJ is stable enough to
build a project onto that? Where could be pitfalls? Or do you suggest to use
the ODMG or even the PersistenceBroker APIs?

Hiran


- Original Message -
From: "Mahler Thomas" <[EMAIL PROTECTED]>
To: "'OJB Users List'" <[EMAIL PROTECTED]>
Sent: Wednesday, February 19, 2003 5:32 PM
Subject: AW: JDO


> Hi Lennart,
>
> By using SUNs JDORI and the OJB OjbStore Plugin (See tutorial4.html for
> details) you have a fully compliant JDO solution today!
>
> We want to have a full replacement of the upper JDORI layers for OJB 2.0.
> This implementation will add no functionality but only have non-functional
> improvements (performance, resource consumption).
> There is no time schedule for this release yet.
>
> cheers,
> Thomas
>
> > -Ursprüngliche Nachricht-
> > Von: Lennart Benoot [mailto:[EMAIL PROTECTED]
> > Gesendet: Mittwoch, 19. Februar 2003 14:44
> > An: [EMAIL PROTECTED]
> > Betreff: JDO
> >
> >
> > Hey All,
> >
> > Is there a date set forward when OJB will fully support JDO?
> >
> > Regards,
> > Lennart
> >
> >
> > -
> > 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]



Question re prefetched relationsbips

2003-02-25 Thread Mark Rowell
Hi

Does anyone know if prefetched relationships can reach more than one "layer"
of references/collections from an class being queried?
E.g. If I have a class A that I an querying and it has a 1:m relationship
with some class B, with the relationship defined by the name "allb",
and then each B has 1 1:1 relationsbip with another class C, with the
relationship called "singlec", is the following supposed to work:

Criteria criteria = new Criteria();
  // configure the criteria
  ...

  // add prefetched relationships
criteria.addPrefetchedRelationship("allb");
criteria.addPrefetchedRelationship("allb.singlec");

  Query q = QueryFactory.newQuery( A.class, criteria);

I can get the single layer if indirection (e.g.
criteria.addPrefetchedRelationship("allb")) to work, but when I try the
above I get
an error message from OJB saying that it cant find the relationship
"allb.singlec". One thing to not is that I can specify query criteria
on this 2 level relationship i.e.

criteria.addEqualTo("allb.singlec.somefield", "test value");

where somefield is a field in the class C.

Regards,

Mark Rowell


Mark Rowell
CreditTrade

T: +44 (020) 7400 5078
M: mailto:[EMAIL PROTECTED]

CreditTrade Limited is regulated by the FSA. (c) CreditTrade 2002. All rights 
reserved. The information and data contained in this email is provided for the 
information purposes of the addressee only and should not be reproduced and/or 
distributed to any other person. It is provided without any warranty whatsoever and 
unless stated otherwise consists purely of indicative market prices and other 
information.

Any opinion or comments expressed or assumption made in association with the data or 
information provided in this email is a reflection of CreditTrades judgement at the 
time of compiling the data and is subject to change. CreditTrade hereby makes no 
representation and accepts no responsibility or liability as to the completeness or 
accuracy of this email.

The content of this email is not intended as an offer or solicitation for, or 
recommendation of, the purchase or sale of any financial instrument, or as an official 
confirmation of any transaction, and should not be construed as investment advice.

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



Re: PersistenceBrokerFactoryIF.instantiate(): strange behavior

2003-02-25 Thread Armin Waibel
Hi Joerg,

there is a known bug in 0.9.9
to patch this see

http://archives.apache.org/eyebrowse/[EMAIL PROTECTED]
pache.org&msgNo=5507

or try to use
db.open("default#userName#password", Database.OPEN_READ_WRITE);

regards,
Armin


- Original Message -
From: "Joerg Lensing" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
Sent: Tuesday, February 25, 2003 3:30 PM
Subject: PersistenceBrokerFactoryIF.instantiate(): strange behavior


> Hi all,
> look at this:
>
> Database db = impl.newDatabase();
>
> try {
> --->>   db.open("default", Database.OPEN_READ_WRITE);
> int i = 1;
> } catch (ODMGException ex) {
> ex.printStackTrace();
> }
>
> runs to:
> private static PersistenceBrokerFactoryIF instantiate() {
> if (log.isDebugEnabled())
> log.debug("Instantiate PersistenceBrokerFactory");
> try {
> Configurator configurator = OjbConfigurator.getInstance();
> file://HERE: the code steps  OVER the next two lines! (without being
executed!)
>
>
> Configuration config =
configurator.getConfigurationFor(null);
> Class pbfClass =
> config.getClass("PersistenceBrokerFactoryClass",
> PersistenceBrokerFactoryDefaultImpl.class);
> PersistenceBrokerFactoryIF result =
> (PersistenceBrokerFactoryIF) pbfClass.newInstance();
> configurator.configure(result);
> if (log.isDebugEnabled())
> log.debug("PersistencebrokerFactory class: " +
> pbfClass.getName());
> return result;
> } catch (Exception e) {
> log.error("Fehler joerg222", e);
> log.error("Error in instantiation of
> PersistenceBrokerFactory class", e);
> return new PersistenceBrokerFactoryDefaultImpl();
> }
> }
>
>
> joerg
> ps: until now i didn't get it to work - nothing -:(
>
>
> -
> 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]



query formulation question

2003-02-25 Thread Will Jaynes
I'm wondering how to formulate a query. I'm sure this is s FAQ, but I 
can't find the answer...

Looking at the "Mapping M:N associations" section of the "Advanced O/R" 
doc, I have a situation which is analogous to the  Person, Project, 
PersonProject example of decomposition into two 1:N associations.

I'd like to retrieve all Person objects that do not have a Project with 
title = "XXX". This seems kind of complicated since, if I were to write 
it in psuedo ODMG I would write

select person from Person.class.getName()
where roles[*].project.title != "XXX"
How would this really be formulated in ODMG?
How would this be formulated in just the PB?
Thanks, Will

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


some OJB proxy questions

2003-02-25 Thread Maarten Coene
Hi,

I have a couple of questions about the proxies.

1. I want to use dynamic proxies, but these proxies may not use the 
PersistenceBroker for querying the database. Instead, they must get the 
real object through an API I defined myself. The idea is to return object 
from my object model to clients, but these clients cannot access the 
database directly, they must use a specific component. This means that if I 
return proxies, these proxies must also use that component.

More concrete: the dynamic proxy wil do something like this to retrieve the 
object:

if (realObject == null) {
realObject = broker.getObjectByIdentity(id);
}
But I want this to be:

if (realObject == null) {
 realObject = myComponent.getObject(id);
}
Is it possible to do this with dynamic proxies? I know I can define my own 
proxy for each class from the object model, but using dynamic proxies would 
save me a lot of work.



2. If the above problem is not possible with dynamic proxies, is it 
possible to define my own proxy-class for proxy for a reference? It looks 
to me that the reference-descriptor element only allows the use of dynamic 
proxies for this purpose?

I want to do something like this:




regards,
Maarten Coene 



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


Re: How to map embedded value object?

2003-02-25 Thread Rice Yeh
Hi Thomas,
  Thank you for your answer. But I continue my
question. Is it possible to have this embbeded value
to   refer back the master object. For example, B (as
the Address class) is the embeded object of A (Party
class as example). But B has a field referring to A.
Is this kind of mapping possible? I konw if A and B
are mapped to 2 tables (that is 1-1 relationship),
this is easy. But is B is embeded in the table for A.
Current mapping mechanism seems not support it yet.

Regards,
Rice
  


--- Thomas Mahler <[EMAIL PROTECTED]> wrote:
> You have to tell OJB to use a PersistenField
> implementation supporting 
> this in OJB.properties first, as it is not yet
> implemented in the 
> default implementation:
> 
>
PersistentFieldClass=org.apache.ojb.broker.metadata.fieldaccess.PersistentNestedFieldMaxPerformanceImpl
> 
> if your class has an attribute "address" of type
> Adress,
> the mapping for the "street" attribute of "address"
> would look like follows:
> 
>   name="adress->street"
>   column="ADR_STREET"
>   jdbc-type="VARCHAR"
>/>
> 
> cheers,
> Thomas
> 
> Rice Yeh wrote:
> > Hi,
> >  As stated in Martine Flower's artice
> >
>
(http://martinfowler.com/eaaCatalog/embeddedValue.html)
> > "Many small objects make sense in an OO system
> that
> > don't make sense as tables in a database. Examples
> > include currency-aware money objects and date
> ranges.
> > Although the default thinking is to save an object
> as
> > a table, no sane person would want a table of
> money
> > values.". In OJB, how these small objects are
> mapped
> > to the same table of their master object?
> > 
> > Regards,
> > Rice 
> > 
> > __
> > Do you Yahoo!?
> > Yahoo! Tax Center - forms, calculators, tips, more
> > http://taxes.yahoo.com/
> > 
> >
>
-
> > 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]
> 


__
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/

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



PersistenceBrokerFactoryIF.instantiate(): strange behavior

2003-02-25 Thread Joerg Lensing
Hi all,
look at this:
   Database db = impl.newDatabase();

   try {
--->>   db.open("default", Database.OPEN_READ_WRITE);
   int i = 1;
   } catch (ODMGException ex) {
   ex.printStackTrace();
   }
runs to:
   private static PersistenceBrokerFactoryIF instantiate() {
   if (log.isDebugEnabled())
   log.debug("Instantiate PersistenceBrokerFactory");
   try {
   Configurator configurator = OjbConfigurator.getInstance(); 
//HERE: the code steps  OVER the next two lines! (without being executed!)
   
  
   Configuration config = configurator.getConfigurationFor(null);
   Class pbfClass = 
config.getClass("PersistenceBrokerFactoryClass", 
PersistenceBrokerFactoryDefaultImpl.class);
   PersistenceBrokerFactoryIF result = 
(PersistenceBrokerFactoryIF) pbfClass.newInstance();
   configurator.configure(result);
   if (log.isDebugEnabled())
   log.debug("PersistencebrokerFactory class: " + 
pbfClass.getName());
   return result;
   } catch (Exception e) {
   log.error("Fehler joerg222", e);
   log.error("Error in instantiation of 
PersistenceBrokerFactory class", e);
   return new PersistenceBrokerFactoryDefaultImpl();
   }
   }

joerg
ps: until now i didn't get it to work - nothing -:(
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: How do I dynamically create a new persistent object/table?

2003-02-25 Thread Robert S. Sfeir
Oh PLEASE keep it, but how about doing this way:

On db.open() when you parse the XML document to verify it's structure 
and relationship mapping to the beans, do a check to see if the table 
exists.  If it doesn't exist build it.  Once it's built keep the 
information in a cached file somewhere and allow us to turn the cache 
check on or off, this way if we have it off (for development 
environment) it will always check on db connect and create what ever it 
needs to create.  If it's on, for deployment, it will check once, cache 
the info, and then never worry about it again unless the cache file is 
deleted.  After that the rest is gravy.

It's a great feature especially for new application deployment.  I love 
to be able to have a war file with everything in it, upload the war 
file, it unpacks, connects to the DB, builds the tables and the app is 
installed.  For all the time we spend deploying an application, setting 
up the database is perhaps the most arduous task these days.  This 
solves the problem.

Thanks

On Tuesday, Feb 25, 2003, at 02:21 US/Eastern, Thomas Mahler wrote:

Hi Jeffrey,

Here's at least a piece of a bone:
in src/test/org/apache/ojb/OJB.properties
set the switch autobuild=true.
OJB will then check if the table defined in the ClassDescriptor does 
already exist on each access to the table.

If it does not yet exist the table is generated by create table 
statement. This statement is constructed by the mapping info contained 
in the class-descriptor.

This is an undocumented feature! And it is undocumented because we 
have not decided yet if it is meant to stay. (It's a performance 
killer).

cheers,
Thomas
Jeffrey Gilbert wrote:
Anyone know of any additional instructions on how to dynamically 
create a persistent object/table?
The only thing I have to go on so far is what is in the FAQ:
DescriptorRepository dr = 
MetadataManager.getInstance().getRepository();
ClassDescriptor cld = new ClassDescriptor(dr);
cld.setClassOfObject(A.class);
// other setter
// add the fields of the class
FieldDescriptor fd = new FieldDescriptor(cld, 1);
fd.setPersistentField(A.class, "someAField");
cld.addFieldDescriptor(fd);
// now we add the the class descriptor
dr.setClassDescriptor(cld);
This code above when modified for my application doesn't result in a 
new table with my hypersonic datastore.  Could someone toss me a 
bone?  ;-)
Jeff
-
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]
R

--
Robert S. Sfeir
Senior Java Engineer
Codepuccino, Inc.
[EMAIL PROTECTED]
definition - Codepuccino n:
A Little JSP mixed with lots of Java, usually served with Servlets, a 
Datasource, a sprinkle of XML, and sometimes EJB.  (See Great MVC 
Frameworks)

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


RE: easy 1-1, 1-m association and inheritance

2003-02-25 Thread TINE Houari (OBJECTIVA)

Hi,

No it's a personnal work. I finish tests and I propose it to anyone...

Houari


 -Message d'origine-
De :Rice Yeh [mailto:[EMAIL PROTECTED] 
Envoyé :lundi 24 février 2003 12:46
À : OJB Users List
Objet : Re: easy 1-1, 1-m association and inheritance

Hi,
  Have this modification already checked into cvs
repository?

Regards,
Rice

--- "TINE Houari (OBJECTIVA)"
<[EMAIL PROTECTED]> wrote:
> 
> Hi,
> 
> I have modied the source code of OJB to enable
> mapping 1:1 and 1:m
> association without adding variable instance (that
> model fk) in business
> object. I also adding the possiblity to allow
> automatically inheriance
> without any effort. For later, the idea is to model
> extended classes as 1:1
> association with blank name.
> Actually, this changes work fine for loading. For
> updating and deleting,
> tests are under way.
> Houari TINE.
> 
> 
> 
>  -Message d'origine-
> De :  TINE Houari (OBJECTIVA)
> [mailto:[EMAIL PROTECTED] 
> Envoyé :  mercredi 19 février 2003 14:01
> À :   [EMAIL PROTECTED]
> Objet :   dirty 1-1 association
> 
> Hi,
> 
> In the thesis "Javal baseeruv objektide püsivuse
> kiht Jakamar" p. 17, there
> is a good sentence:
> "Adding persistence into the classes themselves is
> not always possible -
> they might be third 
> party components." But OJB violates this principles
> by forces introducing a
> link modeling foreign
> key for 1-1 association and inheritence.
> 
> For 1-1 association from A to B, it is necessary to
> add a reference (calss
> B) in class A to model 
> the association: OK. But adding an integer (for
> example) to model a database
> foreig in the class A
> is a very very bad thing. There is any way to avoid
> that monstrosity.
> 
> Houari TINE
> 
>
-
> 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]
> 


__
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/

-
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: API ODMG or PersistenceBroker

2003-02-25 Thread oliver . matz
Hi Ferran,

> -Original Message-
> 
> Hi all,
> what are you using the API ODMG or API 
> PersistenceBroker?? i try the API ODMG and i need a joins but 

I am pretty new to OJB, too.

This is one of the most frequent questions.  If you get
access to the mail archive (which is currently a bit difficult),
you will find some discussions.

To answer your question: we are using the ODMG API without
the OJB internal tables and with the PB Query language.
But we do consider to move to the JDO or PB API later.
Therefore, we have wrapped the API by a thin access layer.

> i don't know how use joins in API ODMG, its possible joins in 
> API ODMG??

Could you please explain what you mean by: "joins in the API"?
Are you referring to the query language?  In which way could
you use joins?  As to my understanding, both OQL and the PB 
query language are object oriented,
so they should not offer a view onto tables, which is needed for
formulating join queries explicitely.  However, they certainly use 
joins "behind the scenes".

Olli

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



Autoincrement

2003-02-25 Thread Lennart Benoot
Hey Guys,

I have an existing MySql table that i would like to manipulate with OJB. 
This table has an autoincrement integer row that has the role of primary 
key. What measures should I take to use this in OJB?
I don't want OJB to generate this primary key. This is, i think, what 
happens when i define this attribute as autoincrement.

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


RE: ClassCastException persisting Date field

2003-02-25 Thread Mark Rowell
John

You may need to use a FieldConversion on the relevant field(s)/columns(s)

e.g




Mark


-Original Message-
From: O'Reilly John [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 25, 2003 10:38 AM
To: 'OJB Users List'
Subject: ClassCastException persisting Date field


Hi,

Is there any known issue with persisting Date's using OJB.  I have defined
the field as follows:



The code that sets the date is as follows:

   Calendar today = Calendar.getInstance() ;
   today.set(Calendar.DAY_OF_MONTH, 28 );
   today.set(Calendar.MONTH, 8 );
   today.set(Calendar.YEAR, 2000);
   productModel.setIntendedDateOfRelease( today.getTime() );

When I try to persist the productModel object I get a ClassCastException (as
shown below).  I noticed that when I load an existing object from the db the
type of the field is java.sql.Date (subclass of java.util.Date) whereas the
type of the field I'm persisting is actaully a java.util.Date.

Rgds,
John


java.lang.ClassCastException: java.util.Dateat
oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement
.java:2051) at
oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement
.java:2102) at
com.p6spy.engine.spy.P6PreparedStatement.setObject(P6PreparedStatement.java:
282)at
org.apache.ojb.broker.platforms.PlatformDefaultImpl.setObjectForStatement(Pl
atformDefaultImpl.java:229) at
org.apache.ojb.broker.platforms.PlatformOracleImpl.setObjectForStatement(Pla
tformOracleImpl.java:126)   at
org.apache.ojb.broker.accesslayer.StatementManager.bindInsert(StatementManag
er.java:511)at
org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeInsert(JdbcAccessImp
l.java:198) at
org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.storeToDb(PersistenceBr
okerImpl.java:1742) at
org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.store(PersistenceBroker
Impl.java:1683) at
org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.store(PersistenceBroker
Impl.java:632)  at
org.apache.ojb.broker.singlevm.DelegatingPersistenceBroker.store(DelegatingP
ersistenceBroker.java:151)  at
ie.mcps.product.dao.ProductDAO.addProduct(ProductDAO.java:65)   at
ie.mcps.product.dao.ProductDAOTest.testAddProduct(ProductDAOTest.java:191)
at java.lang.reflect.Method.invoke(Native Method)   at
junit.framework.TestCase.runTest(TestCase.java:166) at
junit.framework.TestCase.runBare(TestCase.java:140) at
junit.framework.TestResult$1.protect(TestResult.java:106)   at
junit.framework.TestResult.runProtected(TestResult.java:124)at
junit.framework.TestResult.run(TestResult.java:109) at
junit.framework.TestCase.run(TestCase.java:131) at
junit.framework.TestSuite.runTest(TestSuite.java:173)   at
junit.framework.TestSuite.run(TestSuite.java:168)   at
com.borland.jbuilder.unittest.JBTestRunner.run(JBTestRunner.java:161)   at
com.borland.jbuilder.unittest.JBTestRunner.initiateTest(JBTestRunner.java:19
4)  at
com.borland.jbuilder.unittest.JBTestRunner.main(JBTestRunner.java:486) 

This e-mail and any files transmitted with it are confidential and may be
privileged and are intended solely for the individual named/ for the use of
the individual or entity to whom they are addressed.If you are not the
intended addressee, you should not disseminate, distribute or copy this
e-mail.Please notify the sender immediately if you have received this e-mail
by mistake and delete this e-mail from your system.If you are not the
intended recipient, you are notified that reviewing, disclosing, copying,
distributing or taking any action in reliance on the contents of this e-mail
is strictly prohibited.Please note that any views or opinions expressed in
this e-mail are solely those of the author and do not necessarily represent
those of Traventec Limited.E-mail transmission cannot be guaranteed to be
secure or error-free as information could be intercepted, corrupted, lost,
destroyed, or arrive late or incomplete.Traventec Limited therefore does not
accept liability for any errors or omissions in the contents of this
message, which arise as a result of e-mail transmission.The recipient should
check this e-mail and any attachments for the presence of viruses.This
e-mail has been swept for computer viruses however Traventec Limited accepts
no liability for any damage caused by any virus transmitted by this e-mail.

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

CreditTrade Limited is regulated by the FSA. (c) CreditTrade 2002. All rights 
reserved. The information and data contained in this email is provided for the 
information purposes of the addressee only and should not be reproduced and/or 
distributed to any other person. It is provided without any warranty whatsoever and 
unless stated otherwise co

ClassCastException persisting Date field

2003-02-25 Thread O'Reilly John
Hi,

Is there any known issue with persisting Date's using OJB.  I have defined
the field as follows:



The code that sets the date is as follows:

   Calendar today = Calendar.getInstance() ;
   today.set(Calendar.DAY_OF_MONTH, 28 );
   today.set(Calendar.MONTH, 8 );
   today.set(Calendar.YEAR, 2000);
   productModel.setIntendedDateOfRelease( today.getTime() );

When I try to persist the productModel object I get a ClassCastException (as
shown below).  I noticed that when I load an existing object from the db the
type of the field is java.sql.Date (subclass of java.util.Date) whereas the
type of the field I'm persisting is actaully a java.util.Date.

Rgds,
John


java.lang.ClassCastException: java.util.Dateat
oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement
.java:2051) at
oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement
.java:2102) at
com.p6spy.engine.spy.P6PreparedStatement.setObject(P6PreparedStatement.java:
282)at
org.apache.ojb.broker.platforms.PlatformDefaultImpl.setObjectForStatement(Pl
atformDefaultImpl.java:229) at
org.apache.ojb.broker.platforms.PlatformOracleImpl.setObjectForStatement(Pla
tformOracleImpl.java:126)   at
org.apache.ojb.broker.accesslayer.StatementManager.bindInsert(StatementManag
er.java:511)at
org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeInsert(JdbcAccessImp
l.java:198) at
org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.storeToDb(PersistenceBr
okerImpl.java:1742) at
org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.store(PersistenceBroker
Impl.java:1683) at
org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.store(PersistenceBroker
Impl.java:632)  at
org.apache.ojb.broker.singlevm.DelegatingPersistenceBroker.store(DelegatingP
ersistenceBroker.java:151)  at
ie.mcps.product.dao.ProductDAO.addProduct(ProductDAO.java:65)   at
ie.mcps.product.dao.ProductDAOTest.testAddProduct(ProductDAOTest.java:191)
at java.lang.reflect.Method.invoke(Native Method)   at
junit.framework.TestCase.runTest(TestCase.java:166) at
junit.framework.TestCase.runBare(TestCase.java:140) at
junit.framework.TestResult$1.protect(TestResult.java:106)   at
junit.framework.TestResult.runProtected(TestResult.java:124)at
junit.framework.TestResult.run(TestResult.java:109) at
junit.framework.TestCase.run(TestCase.java:131) at
junit.framework.TestSuite.runTest(TestSuite.java:173)   at
junit.framework.TestSuite.run(TestSuite.java:168)   at
com.borland.jbuilder.unittest.JBTestRunner.run(JBTestRunner.java:161)   at
com.borland.jbuilder.unittest.JBTestRunner.initiateTest(JBTestRunner.java:19
4)  at
com.borland.jbuilder.unittest.JBTestRunner.main(JBTestRunner.java:486) 

This e-mail and any files transmitted with it are confidential and may be
privileged and are intended solely for the individual named/ for the use of
the individual or entity to whom they are addressed.If you are not the
intended addressee, you should not disseminate, distribute or copy this
e-mail.Please notify the sender immediately if you have received this e-mail
by mistake and delete this e-mail from your system.If you are not the
intended recipient, you are notified that reviewing, disclosing, copying,
distributing or taking any action in reliance on the contents of this e-mail
is strictly prohibited.Please note that any views or opinions expressed in
this e-mail are solely those of the author and do not necessarily represent
those of Traventec Limited.E-mail transmission cannot be guaranteed to be
secure or error-free as information could be intercepted, corrupted, lost,
destroyed, or arrive late or incomplete.Traventec Limited therefore does not
accept liability for any errors or omissions in the contents of this
message, which arise as a result of e-mail transmission.The recipient should
check this e-mail and any attachments for the presence of viruses.This
e-mail has been swept for computer viruses however Traventec Limited accepts
no liability for any damage caused by any virus transmitted by this e-mail.

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



API ODMG or PersistenceBroker

2003-02-25 Thread Ferran Parra
Hi all,
what are you using the API ODMG or API PersistenceBroker?? i try the API ODMG and 
i need a joins but i don't know how use joins in API ODMG, its possible joins in API 
ODMG??

thanks in advanced
Ferran Parra

Departament de Noves Tecnologies
MUBIMEDIA S.L.
--
[EMAIL PROTECTED]
Mallorca, 275, 1r 2a
08008 BARCELONA
T. (+34) 93 215 21 91
F. (+34) 93 215 41 21



RE: Cannot access mailing list archive/documentation problem

2003-02-25 Thread Anthony Kong
Hi, all,

I guess I have solved the problem by myself. If I try to access mail archive
form http://db.apache.org/mail.html  then it is Ok. The list name is
[EMAIL PROTECTED]

However, if i go inside the ojb page and use the url "Mailing lists" (on the
left hand side) to access the archive, [EMAIL PROTECTED] becomes the
list name and hence the error.

I do not know whom to contact in order to fix it. If you know please kindly
forward to appropriate party. (I think someone should have noticed, because
the change form apache.org/ojb to db.apache.org has become effective for
some time already ?!)


Regards,

Anthony


-Original Message-
From: Anthony Kong [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 25, 2003 4:45 PM
To: '[EMAIL PROTECTED]'
Subject: Cannot access mailing list archive/documentation problem


Hi, all

1)

When I try to access the mailing list archive shown in
http://db.apache.org/ojb/mail-lists.html


I encoutnered the following errors
 

Error occurred
Required parameter "listId" or "listName" is missing or invalid 


Is everything OK with this? 

2) 

When i try to read http://db.apache.org/ojb/faq.html, I realise that the
"general" section is missing. Additionally, clicking on the url in the table
of content does not take me to the entry. I guess the anchors are invalid
(e.g. http://db.apache.org/ojb/faq.html#5 does not take me to "How to use
OJB with my RDBMS?"
 

Regards,

Anthony

-
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: Report queries on extents

2003-02-25 Thread Mark Rowell
Jakob

I have a test case to show my problem

public void testReportQuery() {
testDeleteContractVersionEffectiveness();
createTestData();

Query query = QueryFactory.newReportQuery(Version.class, new
String[]{"PK","contract.PK","contract.contractValue1"}, null, false);
Iterator iter = broker.getReportQueryIteratorByQuery(query);
int rowCount = 0;
while ( iter.hasNext() ) {
rowCount++;
}

assertTrue("Expected to get " + COUNT + " rows in the report query.
Got " + rowCount + " instead.", rowCount == COUNT);
}

Add it to the ContractVersionEffectivenessTest class. I had to chage the
primary key column names to PK from pk in 
reposotory_junit.xml for the three mappings involved thus:


 
 
 
 
 
 
 
  
 
  



 
 
 
 



 
 
 
 

 

 
 

 
 
 
 
 

 

 
 
 

If I use the field names in the report query (e.g. lower case 'pk') if works
fine. Using upper case values (e.g. 'PK') 
and the database (in my case SQLServer) I get the following stack trace:

[org.apache.ojb.broker.accesslayer.JdbcAccessImpl] ERROR: SQLException
during the execution of the query (for a org.apache.ojb.broker.Version):
[Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Ambiguous column name
'pk'.
[Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Ambiguous column name
'pk'.
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for
JDBC][SQLServer]Ambiguous column name 'pk'.
at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown
Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown
Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown
Source)
at
com.microsoft.jdbc.sqlserver.tds.TDSRPCRequest.processReplyToken(Unknown
Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown
Source)
at com.microsoft.jdbc.sqlserver.tds.TDSCursorRequest.openCursor(Unknown
Source)
at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.execute(Unknown
Source)
at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.executeQueryInternal(Unknown
Source)
at com.microsoft.jdbc.base.BasePreparedStatement.executeQuery(Unknown
Source)
at
org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeQuery(JdbcAccessImpl
.java:291)
at
org.apache.ojb.broker.accesslayer.RsIterator.(RsIterator.java:175)
at
org.apache.ojb.broker.accesslayer.ReportQueryRsIterator.(ReportQueryRs
Iterator.java:86)
at
org.apache.ojb.broker.singlevm.ReportRsIteratorFactoryImpl.createRsIterator(
ReportRsIteratorFactoryImpl.java:96)
at
org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.getRsIteratorFromQuery(
PersistenceBrokerImpl.java:2147)
at
org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.getReportQueryIteratorF
romQuery(PersistenceBrokerImpl.java:2195)
at
org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.getReportQueryIteratorB
yQuery(PersistenceBrokerImpl.java:2124)
at
org.apache.ojb.broker.singlevm.DelegatingPersistenceBroker.getReportQueryIte
ratorByQuery(DelegatingPersistenceBroker.java:273)
at
org.apache.ojb.broker.ContractVersionEffectivenessTest.testReportQuery(Contr
actVersionEffectivenessTest.java:184)

and the following generated SQL:

  [junit] [org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl]
DEBUG: SQL: SELECT PK,PK,A1.contract_value1 FROM Version A0 LEFT OUTER JOIN
Contract A1 ON A0.fk_to_contract=A1.PK

I hope that helps!

Mark


BTW -- what is the "policy" on selecting our by field name or column name
and filtering by the same?




-Original Message-
From: Jakob Braeuchi [mailto:[EMAIL PROTECTED]
Sent: Friday, February 21, 2003 4:41 PM
To: OJB Users List
Subject: Re: Report queries on extents


hi mark,

yes, please send me the testcase. if it's based on our testclasses it 
would be perfect.

jakob

Mark Rowell wrote:

>Hi Jakob
>
>Some news on this problem -- it turns out it is a case sensitivity issue.
>E.g. If I query on the column name in the report
>query (e.g. upper case 'ID') it does not work, if I query on the field name
>(e.g. lower case 'id') it works.
>
>N.B. this therefore is only a problem where we have 2 columns in the query
>with the same names on different tables. E.g. if I query by
>column name rather than field name the sql generator strips off any
>qualification I put in.
>
>I do have some new classes/data/tests that show this.
>Do you want me to send them to you?
>
>Mark
>-Original Message-
>From: Jakob Braeuchi [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, February 19, 2003 6:25 PM
>To: OJB Users List
>Subject: Re: Report queries on extents
>
>
>hi mark,
>
>i forgot to ask whether yo

RE: QueryBySQL and update statement (Additional information)

2003-02-25 Thread Anthony Kong
Hi, all,

I have some extra information. 

The target database is MSSQL. I found that if I run the update statment in a
query analyser and then go back to my application to try again, the update
statement will be fired. It seems strange to me. Is it an expected
behaviour?

Regard,

Anthony

-Original Message-
From: Anthony Kong [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 25, 2003 4:49 PM
To: '[EMAIL PROTECTED]'
Subject: QueryBySQL and update statement


Hi, all,

I am using 0.9.8. I try to use QueryBySQL to apply an "update" clause on a
few thousand records. I did not apply pb.getCollectionByQuery() on this sql
object because it will fire "no resultset returned" error. Fair enough. So I
did a pb.getCount(query_by_sql) instead. As far as I can see from the sql
trace, a "select count(*) from object" table is fired instead of my update
statement.

I would like to know more about how to use QueryBySQL with an "update" sql
statement.


Regards,

Anthony


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



QueryBySQL and update statement

2003-02-25 Thread Anthony Kong
Hi, all,

I am using 0.9.8. I try to use QueryBySQL to apply an "update" clause on a
few thousand records. I did not apply pb.getCollectionByQuery() on this sql
object because it will fire "no resultset returned" error. Fair enough. So I
did a pb.getCount(query_by_sql) instead. As far as I can see from the sql
trace, a "select count(*) from object" table is fired instead of my update
statement.

I would like to know more about how to use QueryBySQL with an "update" sql
statement.


Regards,

Anthony

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



Cannot access mailing list archive/documentation problem

2003-02-25 Thread Anthony Kong
Hi, all

1)

When I try to access the mailing list archive shown in
http://db.apache.org/ojb/mail-lists.html


I encoutnered the following errors
 

Error occurred
Required parameter "listId" or "listName" is missing or invalid 


Is everything OK with this? 

2) 

When i try to read http://db.apache.org/ojb/faq.html, I realise that the
"general" section is missing. Additionally, clicking on the url in the table
of content does not take me to the entry. I guess the anchors are invalid
(e.g. http://db.apache.org/ojb/faq.html#5 does not take me to "How to use
OJB with my RDBMS?"
 

Regards,

Anthony

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