cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leszek Gawron <>
Subject Re: DB support in flowscript (was: XSP "official" position)
Date Fri, 21 Nov 2003 09:01:59 GMT
On Wed, Nov 19, 2003 at 01:36:17PM -0600, Antonio Gallardo wrote:
> >> >   - sometimes the db schema makes it impossible to use O/R tools
> Show me one. This also denote SQL can be abused. Just for the records, we
> are currently building an accounting system and O/R works fine there. This
> is the example you said: a 150+ tables.

The second case is : 
Imagine you have table that describes building (Building) and then you have a
table that describes the flat (Flat).

Now you want to assign tasks:
 - visit the flat and do something 
 - visit the whole building (each flat in the building)

so you add some more tables:

You also have to add a TaskBuildingFlatVisited table to be able to report
which flats have already been visited if a task was for the whole building. 

Now the problem: you cannot generate a report simply if you do just inserts
into the TaskBuildingFlatVisited table, just because you know which flats HAVE
been visited and it is very hard to query the database for a negated set (the
flats that have not been visited have no corresponding records in the

So the solution is simple: 

You extend TaskBuildingFlatVisited table with a visited_status column. Now you
create a trigger on TaskBuilding table that for each building task insert you
insert all corresponding flat references to TaskBuildingFlatVisited. Now if a
user visits a flat you do not insert a record - you UPDATE an appropriate one.

So now if you want to query for flats that have not been visited it is really
simple. But now the database adds/deletes rows from database behind your back.
AFAIU this messes up OJB tool completely. Or am I wrong maybe? 

> Who said O/R mapping need to be wroten by hand? This is not a MUST
> anymore. This is mainly why I go to Druid. Did you know Druid? If not here
> is the link: :-D
This link does not work :)

I've been looking at druid but there is one problem: Druid uses some weird
technique to detect a JDBC driver in provided jar file. The problem is that
Microsoft SQL Server JDBC driver consists of 3 jar files and even if you edit
the druid configuration by hand it does not detect the driver class.

> Using Druid making an O/R mapping is a matter fo secs! Is this a problem?
> Also + your Beans ready to be used. Well the Beans for JDO are a little
> bit slower. But I am sure you will have in less than 2 mins you
> database.jar ready to use. So where is the problem? :-DD
If you advertise it so strongly I think I will have to try it but first I have
to resolve a problem with the M$ JDBC driver.

         | /  \ |        Leszek Gawron            //  \\
        \_\\  //_/           _\\()//_
         .'/()\'.     Phone: +48(501)720812     / //  \\ \
          \\  //  recursive: adj; see recursive  | \__/ |

View raw message