RE: Isolation level

2008-02-19 Thread Christian Lipp
Hi Armin,

thank you for  quick answer and sorry for my long delay.

We are using an older OJB version (1.0.1.x), so I thought I cannot use your
recommendation and wanted to perform a backport now.
I got the actual OJB now and examined it, but also couldn't find an
attribute in the jdbc-connection-descriptor (I checked the repository.dtd).

So I asume I have to implement the JDBC transaction level as attribute for
jdbc-connection-descriptor into OJB or do I miss something?

Could someone point me in the right direction for this implementation? I
assume I have to read the attribute and apply it in the function
PlatformDefaultImpl.initializeJdbcConnection.

Thanks in advance, CL

-Original Message-
From: Armin Waibel [mailto:[EMAIL PROTECTED] 
Sent: Freitag, 25. Jänner 2008 03:03
To: OJB Users List
Subject: Re: Isolation level

Hi Christian,

Christian Lipp wrote:
 I am still looking for an solution for my lock level settings and 
 therefore I am digging through the OJB source.
 
 What I am not sure at the moment is if the setting of the 
 isolation-level is generally ignored in OJB?
 descriptor-repository version=1.0 isolation-level=read-comitted
 
 I couldn't find the place in the OJB code where the isolation level is 
 set to the DescriptorRepository and later to the connection.
 In my optionion the isolation-level in the XML file is ignored.
 
 Could someone point me in the right direction?

Out of the box the isolation-level setting is only used by the ODMG-api
which use pessimistic locking by default.
http://db.apache.org/ojb/docu/guides/lockmanager.html#Pessimistic-Locking
The PB-api doesn't use pessimistic locking, thus it will ignore these
settings.

The database transaction levels are completely independent from the
isolation-level setting in OJB. So you can use different database
transaction levels (e.g. as property in the dbalias attribute in the
jdbc-connection-descriptor)

regards,
Armin

 
 Thanks in advance,
 CL
 
 
 
 
 -
 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: How to check for null values when using proxies?

2008-02-19 Thread Armin Waibel



Armin Waibel wrote:



In the 1:n associations I set auto-retrieve=false
and proxy=dynamic. As my classes do not implement interfaces, I'm using
CGLib as ProxyFactoryClass.




Now I get your point. You are using dynamic proxies for the referenced 
objects (and maybe a proxy reference for the 1:n relation too) and OJB 
return the wrong instance for all subclasses.




Another problem that came up after I started using proxies is in the
hierarchy mapping. I'm using just one table to map my class hierarchy. 
So,

this table has a CLASSNAME field to identify which class to load. In the
constructor of my base class I have a
setOjbConcreteClass(this.getClass().getName()) call. Before using 
proxies,

the class name was configured correctly. But after, instead of having the
real object class name, the application configures the classname field 
using

the proxy class name.

I assume there should be something wrong with my mapping files or some 
other

point in my application. As said earlier, I believe proxies should be
transparent. Did someone here experience the same problems?


Hm, I will have a look at this tomorrow (will try to reproduce your issue).


I can reproduce the issue and create a bug report:
http://issues.apache.org/jira/browse/OJB-138

Setup some new tests and it seems that I can fix it soon.


regards,
Armin

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



Re: BUGREPORT : OJB 1.0.5rc1 : UserAliases in OrderBy clauses are not replaced by the generated aliases for the joins resulting in illegal SQL statements

2008-02-19 Thread Armin Waibel

Hi Roger,

I create two new user-alias related bug reports:

http://issues.apache.org/jira/browse/OJB-137

https://issues.apache.org/jira/browse/OJB-139

OJB-137 reflects your issue. Locally I fixed OJB-139 (easier to fix then 
137) and start work on OJB-137 (seems more complex to fix).


regards,
Armin

Armin Waibel wrote:

Hi Roger,

now I get your point (I'm a bit slow on the uptake ;-)). I start writing 
many new order by tests to isolate the problem and to make sure that 
changes don't have unrequested side-effects.


  itself was not stable enough for us). In fact, I helped implementing
  this feature in OJB a long time ago, and I believe the documentation
  on
  the OJB site is the documentation I once sent to you guys.

You are right, I found your example in the query documentation. But I 
can't find a test in the OJB test-suite. I think this is the reason why 
this feature got lost between 1.0.rc6 and now (the criteria/query stuff 
was reworked/improved since 1.0rc6).


My new tests show another bug when using a user alias on a 1:n relation 
with table-per-subclass inheritance - but this is another story. After 
finish test writing, I will do my best to find a patch for your problem

and keep you up-to-date.

regards,
Armin

Janssen, Roger wrote:

Hi,

The management summary answer to your question is it important to
support alias-names in order by and having clause is : Yes, it is
really really really important!!!

So now for some background information explaining our situation.

We implemented a concept to support non-modelled (abstract) attributes.
We need to support many different complex forms and datasets for our
customers. The deviation between customers is huge, so modifying our
domain model (and thus our pojos and thus out database tables) for every
customer implementation is not an option. We need to have a stable core
domain model.

So all our objects in our domain model have a collection property that
is capable of holding a collection of abstract-attribute instances, it's
a standard 1:N relation which OJB supports. Abstract attribute classes
are classes implementing name-value tuples, the name of the attribute,
and the value of the attribute. So adding new attributes to specific
objectclass instances implies we just have to add abstract attribute
instances to the collection and OJB will store them in the apropriate
table in the database. We do not have to modify our domain model by
adding new java properties to the affected classes and adding new
columns to the affected tables.

So querying for values of object properties, represented by abstract
attributes, we need to create clauses combining the name/value
properties of the abstract attribute instances.

So an example query with two selection criteria based on abstract
attributes of an object could be:

SELECT * FROM PERMIT AS A0 INNER JOIN PERMIT_ABSTRACT_ATTRIBUTE AS A1
INNER JOIN PERMIT_ABSTRACT_ATTRIBUTE AS A2
WHERE A0.ID=A1.ID AND A0.ID=A2.ID AND
  (A1.NAME='name of attribute 1 AND A1.VALUE='value of attribute
1') AND
  (A2.NAME='name of attribute 2 AND A2.VALUE='value of attribute
2');

Since we need to work with bounded name/value pairs, we need to bind
them together using a alias, in this example the aliases are A1 and A2.

So if we want to order the resultset on such an abstract attribute value
the query would look like:

SELECT * FROM PERMIT AS A0 INNER JOIN PERMIT_ABSTRACT_ATTRIBUTE AS A1
INNER JOIN PERMIT_ABSTRACT_ATTRIBUTE AS A2
WHERE A0.ID=A1.ID AND A0.ID=A2.ID AND
  (A1.NAME='name of attribute 1 AND A1.VALUE='value of attribute
1') AND
  (A2.NAME='name of attribute 2 AND A2.VALUE='value of attribute
2')
ORDER BY A2.VALUE;

We need to use the alias to link the orderby to the proper join, of
which there are two, to the same join table (the abstract attribute
table)!

This is rather common functionality, currently supported in all our
applications, supported by OJB 1.0rc6 that we use (the 1.0 release
itself was not stable enough for us). In fact, I helped implementing
this feature in OJB a long time ago, and I believe the documentation on
the OJB site is the documentation I once sent to you guys.

The upcoming 1.0.5 release has some features that we have been waiting
for, for several years. We have been able to postpone improvements in
our applications for this long, but we cannot do this any longer. So we
really need these new features 1.0.5 implements, but we need the
user-alias in the orderby to work as well, otherwise we will loose a lot
of functionality and our customers will not accept that.

Some of the required features are the native limit-clause
implementations, the reference descriptor implementation without using
foreign-keys (I requested this feature for more then a year ago myself),
etc., etc..
I hope you now have an understanding of how we use this feature, and
that we cannot afford to loose it.

Greetings,

Roger Janssen
iBanx