You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by St...@zas.admin.ch on 2004/06/11 17:42:39 UTC
Réf. : Re: My proxies do not make late binding
Thank you for the quick answer Tom,
I looked at the URL you sent me, but I dont know enough the internals of
OJB to understand the message. I went a little further : I tried to get the
Persistence Broker from the transaction and to execute a good old OJB
QueryByCriteria : the late binding works.
Besides that, I am not sure that the problem is only with the collection
proxy. I have also tried with single-object dynamic proxies and the same
result (returns already materialized proxies).
Wish you a happy week-end
Stefano
|---------+--------------------------->
| | Thomas Dudziak |
| | <tomdz@first.fhg|
| | .de> |
| | |
| | 11.06.2004 17:25|
| | Veuillez |
| | répondre à "OJB |
| | Users List" |
| | |
|---------+--------------------------->
>----------------------------------------------------------------------------------------------------------------------|
| |
| Pour : OJB Users List <oj...@db.apache.org> |
| cc : |
| Objet : Re: My proxies do not make late binding |
>----------------------------------------------------------------------------------------------------------------------|
On Fri, 11 Jun 2004 Stefano.Juri@zas.admin.ch wrote:
> I have a problem : even if I define proxy for a connection, OJB reads the
> linked objects immediately.
>
> Explanation : I have a class Dossier, wich is the entry point of my
> application. This class is mapped to a DB2 table called TMPDOSSIER. Each
> dossier has a collection of Prestation. Prestation is an abstract class
> with two concrete subclasses called Apg and IJ. Both are mapped to the
same
> table TMPPREST. The collection has proxy="true".
>
> When I read an instance of Dossier and look the result with my debugger,
I
> can see that the collection is of type
> org.apache.ojb.broker.accesslayer.ListProxy, but that all elements are
> alraedy instatiated, even before I access Dossier from the result list of
> the query.
>
> I wonder : what am I doing wrong ?
The problem lies with the collection proxy right ? Well, I think that the
OJB version you're using does not support collection proxies for ODMG. You
should try CVS because I think Brian added a patch for that:
http://nagoya.apache.org/eyebrowse/ReadMsg?listName=ojb-dev@db.apache.org&msgNo=7497
Tom
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Complex mapping problem
Posted by ma...@redcentre.com.
Hi all,
I'm just looking for some advice regarding mapping a
reasonably complex class with OJB.
The basis of the problem is the structure of a
"User" transfer class. The class includes name,
password and so on. However, it also includes two
Collections; a vector of "permissions" and a vector
of "permission holders". The permissions class is a
simple one and can be handled with a many to many
relationship. The permission holder is more complex
and defined by an interface. It may be implemented
as a Role, Group or User. Hence a User (or Role or
Group) is a permission holder and can also hold
other permission holders. This facilitates quite a
rich structure of permissions. The question relates
to the possibility of mapping a single vector
(PermissionHolders) within a (say) User to the three
RDB data sets that define Roles, Groups and Users.
Of course it is possible that the basic structure is
flawed!
Thanks in anticipation,
MarcusUnix Systems Administrator
+61 3 9873 0155
+61 3 9720 7467 (fax)
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Re: Réf. : Re: My proxies do not make late binding
Posted by Brian McCallister <mc...@forthillcompany.com>.
Assuming you are using ODMG...
The problem was with the implicit locking mechanism in the ODMG
implementation. It was not properly detecting collection proxies so it
would iterate over the collection (loading it) and lock every object
before even returning from the OQLQuery#execute() call.
I have fixed this in cvs so that it will register itself as a
materialization listener on any implementation of CollectionProxy which
has not yet been loaded, and only bind the contents of the collection
to the transaction if the collection is loaded during the transaction.
If you are using the default proxies, you should be fine if you pull
the version from CVS, or use the release coming up (if Thomas D.
retracts his vote to go to 1.0 final instead of an rc ;-) this weekend.
-Brian
On Jun 11, 2004, at 11:45 AM, Thomas Dudziak wrote:
> On Fri, 11 Jun 2004 Stefano.Juri@zas.admin.ch wrote:
>
>> I looked at the URL you sent me, but I dont know enough the internals
>> of
>> OJB to understand the message. I went a little further : I tried to
>> get the
>> Persistence Broker from the transaction and to execute a good old OJB
>> QueryByCriteria : the late binding works.
>
> Yup, the problem is with ODMG, not with the PB Api.
>
>> Besides that, I am not sure that the problem is only with the
>> collection
>> proxy. I have also tried with single-object dynamic proxies and the
>> same
>> result (returns already materialized proxies).
>
> They should work (might depend on how old the OJB version is that
> you're using though). As I said, please try the latest from CVS.
>
>> Wish you a happy week-end
>
> Same for you :-)
>
> Tom
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Re: Réf. : Re: My proxies do not make late binding
Posted by Thomas Dudziak <to...@first.fhg.de>.
On Fri, 11 Jun 2004 Stefano.Juri@zas.admin.ch wrote:
> I looked at the URL you sent me, but I dont know enough the internals of
> OJB to understand the message. I went a little further : I tried to get the
> Persistence Broker from the transaction and to execute a good old OJB
> QueryByCriteria : the late binding works.
Yup, the problem is with ODMG, not with the PB Api.
> Besides that, I am not sure that the problem is only with the collection
> proxy. I have also tried with single-object dynamic proxies and the same
> result (returns already materialized proxies).
They should work (might depend on how old the OJB version is that
you're using though). As I said, please try the latest from CVS.
> Wish you a happy week-end
Same for you :-)
Tom
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org