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 Danilo Tommasina <dt...@risksys.com> on 2004/10/05 13:29:14 UTC

Is it possible to force use of ANSI outer joins

Hi everbody,

We just discovered that Sybase (and Oracle), understand also the standard SQL outer-join syntax.
Since legacy Sybase Outer-Joins have several restrictions (that do not apply to ANSI outer joins) and deliver different results than the ANSI outer joins, I would like to know if 
it is possible to force the use of ANSI outer join syntax in OJB.
Is ther just a generic flag for doing this? Or do I have to override some PlatformXXXImpl class?
What I would like to do is just to use the same outer-join syntax as it is generated for MySQL instead of using the Sybase legacy *= operators.

Thanks,
cheers
Danilo


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


force flushing items from cache?

Posted by Ryan Vanderwerf <rv...@metrowerks.com>.
I haven't seen anyone ask this, but in my plan to migrate from OJB 0.9.9 to
1.01. I've run into a bit of a problem manipulating the cache, due to
changes in the caching between versions. 

In several cases we use database views as beans, and whenever we update the
table behind the view we would use our own extension of the class
ObjectCacheDefaultImpl via the following method:


public void removeClassFromCache(String className) {
       Enumeration enum = super.objectTable.keys();
       while (enum.hasMoreElements()) {
           String key = (String) enum.nextElement();
           if (key.startsWith(className)) {
               super.objectTable.remove(key);
           }

       }

    }

I built this with the intention that flushing a certain class would have
less of a sledgehammer effect than just flushing the whole cache each time.
As far as I know there is no way to tell OJB a view is related through
metadata so the cache would flush appropriate either (that would be nice!).

However with the new type of cache per broker implementation (which I would
like to use for a variety of reasons, mainly to connect to 2 different DBs
with the same exact schema and have no cache ramifications).

I converted my method to compile under the new cache interface, but I'm not
sure it will accomplish what I want:

    public void removeClassFromCache(String className) {
       Set enum = super.objectTable.keySet();
       Iterator it = enum.iterator();
       while (it.hasNext()) {
           String key = (String) it.next();
           if (key.indexOf(className)!=-1) {
               super.objectTable.remove(key);
           }

       }

    }

If I am using the cache per broker implementation, is there a way I can
access all of the individual cache classes to tell them to remove a certain
item or bean class? On that implementation if I tell it to flush the cache
does it tell all of the individual caches per broker to flush too?

As far as I can tell I'm just randomly getting a broker and wiping that
broker's cache, and nothing on a global scale.

Any advice appreciated,

Ryan


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: Is it possible to force use of ANSI outer joins?

Posted by Danilo Tommasina <dt...@risksys.com>.
> Hi everbody,
> 
> We just discovered that Sybase (and Oracle), understand also the 
> standard SQL outer-join syntax.
> Since legacy Sybase Outer-Joins have several restrictions (that do not 
> apply to ANSI outer joins) and deliver different results than the ANSI 
> outer joins, I would like to know if it is possible to force the use of 
> ANSI outer join syntax in OJB.
> Is ther just a generic flag for doing this? Or do I have to override 
> some Platform...Impl class?
> What I would like to do is just to use the same outer-join syntax as it 
> is generated for MySQL instead of using the Sybase legacy *= operators.
> 
> Thanks,
> cheers
> Danilo
> 

I am answering my own post and adding a new question...

Ok, I got a lok at the Platform...Impl sources it seems very easy to do what I need. It is just necessary to extend the the PlatformSybaseASE or PlatformOracle9i classes and 
override the a method as follows:

public byte getJoinSyntaxType()
{
     return SQL92_NOPAREN_JOIN_SYNTAX;
}


Now, my new question is: do somebody knows of any drwabacks by using ANSI syntax instead of legacy syntax?

If there are no real huge performance drawbacks, shouldn't ANSI join syntax become the default implementation? This way the same PersistenceBroker queries would/should always 
return the same data set independently from the underlying database, this is not the case for legacy *outer* joins.
As proposal, it should maybe be possible to force the use of 'legacy' syntax directly on the Query object (yeah hardcore guys may want to set it independently on each join within 
the same query, but this would be quite complicated to manage and not very useful).
What about adding a method 'forceLegacyJoins()' on to the Query interface? On databases like MySQL this would have no effect, but on Sybase, Oracle and maybe other, could be very 
useful...

Thanks for comments/answers
bye
Danilo


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org