Hi Oliver, I have created the oracle schema and I think I got it right, but I am experiencing some issues using StandardRDBMSAdapter-the domain initialization fails and cannot load the servlet. I think the problem lies in some of the sql statements, so I wrote an oracle adapter with the following modifications. In this regard, I have a few outstanding questions:
1.delete statments: I have to modify some of the delete statements as they don't work: eg, existing: "delete LINKS from LINKS l, URI u where l.URI_ID = u.URI_ID and u.URI_STRING = ?" modified to: "delete from LINKS lwhere l.URI_ID in(select u.URI_ID from URI u where u.URI_STRING = ?"
Am I doing it right?
No, but
delete from LINKS where LINKS.URI_ID = URI.URI_ID and URI.URI_STRING = ?
might work though. Avoid sub selects where ever you can...
2. The binding and the statement in the following method does not seem right: method: public void removeLock(Connection connection, Uri uri, NodeLock lock)
first query: statement = connection.prepareStatement( "delete LOCKS from LOCKS, URI u where LOCK_ID = u.URI_ID and u.URI_STRING=?"); statement.setString(1, lock.getLockId());
second query: statement = connection.prepareStatement( "delete URI from URI, LOCKS l where URI_ID = l.LOCK_ID and URI_STRING=?"); statement.setString(1, lock.getLockId());
comments: first query:Should we bind u.URI_STRING to lock_id?
Actually, yes. This is some sort of HACK. See bug #27291 at
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=27291
second query: should we delete the uri when we are removing the lock? Not sure.Please confirm.
Yes, we should (see above). Statement was not executed, though... Fixed this...
3. Adding properties: In properties table, none of the fields can be null. When I was initializing domain.xml, I found that some of the fields values like property_type were "", and oracle would complain with some message like 'cannot insert null into properties table'. I saw that domain.xml file has <property> tag does not have all the attributes mandatory. for example, in domain.xml, we have <property namespace="http://jakarta.apache.org/slide/" name="password"/>
comments: should I make the fields in Properties table nullable?
Yes. Oracle has some special treatment of null values. As default "" is interpreted as null, I guess...
Oliver
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]