[Opensource] transferring connections to DBObjects with "split DB" context

Thierry Clement Thierry.Clement at cetim.fr
Wed Mar 26 06:14:50 PST 2003


I think I cleared out some pbs I was having with transferring connections 
to DBObjects with "split DB" context, and that some of them are due to a 
bug in Expresso :
I first suggested a correction in DBObject.java in a section of method 
setCacheSize() dealing with variable dbl ("DBObjLimit") in a mail entitled 
"pb retrieving DBObjLimit with DB without setup tables", because I 
observed the cache limit was looked for in the wrong DB ("pure data" DB 
and not "setup DB", referring to a context/DB with no setup tables)
Mike Rimov pointed out a pb. in the way I defined connections attached to 
my DBObjects : I should use myDBObjClass(dbName, setupContext) as an 
invocation to my own DBObjects constructors instead of 
myDBObjClass(dbName).  I corrected that, and tried to ensure that all the 
DBObjects that should share a same connection were built this way - but 
still had a pb. with DBObjLimit !

After some debugging, I have one question and some suggestions :
 - in class DBObject, does "originalDBName" or "originalDBKey"  means 
"setup table context name" or "the initial context name before any mapping 
occurs" as written in javadoc, or can have both meanings ?

- if indeed, it is now used only in the first sense (as it looks to me), 
it should have different names and javadoc should be corrected because it 
is confusing.

- if method getOriginalDBName of class DBObject  is indeed the method that 
has to be called in order to get the "setup table context name" of the 
underlying object, (in which case it could be renamed to smthg like 
"getSetupContextName"),  then there are at least 2 bugs in Expresso :
1. in method searchAndRetrieveList() of class DBObject , the line :
  myObj.setDBName(getDBName());
indirectly calls setOriginalDBName() and then assigns a potentially 
different "setup context" for object myObj

2. in method addToCache(DBObject theDBObj) of class DBObject, the line :
  newObj.setDBName(theDBObj.getDBName());
causes same pb. with object newObj.

To correct the pb. I had to modify such a line to code such as :
String origDBName = getOriginalDBName();
myObj.setDBName(getDBName());
myObj.setOriginalDBName(origDBName);
 
...but it is surely not a good way and may be I am missing some concepts 
of Expresso - does anyone agree with my observations or can clear out the 
questions that I raised ?

thank you
Thierry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.jcorporate.com/pipermail/opensource/attachments/20030326/cf559a47/attachment-0002.htm


More information about the Opensource mailing list