[Opensource] RE: [Opensource] Réf. : RE: [Opensource] pb retrieving BDObjLimit with DB without setup tables

Malcolm Wise malcolm.wise at sde.eu.sony.com
Wed Mar 12 00:47:12 PST 2003


Hi Thierry,

"Unable to locate Default Controller Parameters for data Caches for
com.cetim.annuaire.dbobj.Hie_node - setting cache size to 0"

Have you set up any cache values for this DBObject?  I believe this message
indicates that there are no values in DBOBJLIMIT fot this DBObject. These
can be set in the admin section using setup>Database Object Cache
Settings/Page Limits.

For situations where I am only retrieving data I let the DBObject create the
connection (i.e. I use the DBObject default constructor).  If I am updating
the database, I do something like this:

    myPool = DBConnectionPool.getInstance(competitor.getDataContext());
    conn = myPool.getConnection();
    conn.setAutoCommit(false);
    competitor.setConnection(conn);
    competitor.update();
    conn.commit();

having already created my DBObject using the default constructor.  Using
this method I do not get the exception
regarding DBOBJLIMIT.
I too am using split DB Contexts, only I use Sybase ASE 12 for both - but a
separate database in the server for each context.

HTH,
Malc

-----Original Message-----
From: opensource-admin at jcorporate.com
[mailto:opensource-admin at jcorporate.com]On Behalf Of Thierry Clement
Sent: 11 March 2003 15:39
To: opensource at jcorporate.com
Subject: [Opensource] Réf. : RE: [Opensource] pb retrieving BDObjLimit with
DB without setup tables



Thank you Malcolm.
I checked out if my app. was invoking setDataContext() [or setDBName() that
it replaced since Expresso 5 ] and read the edg once again about database
object mapping and DBOTHERNAME table.
Indeed , I had a call to setDBName("annuaire"), and I found out that it was
no more necessary since I specified : addDBObject(
"com.cetim.annuaire.dbobj.Hie_node", "annuaire" ); in my schema class
constructor.

But still, the change I described in my first mail seems necessary,
otherwise I get the message :
"Unable to locate Default Controller Parameters for data Caches for
com.cetim.annuaire.dbobj.Hie_node - setting cache size to 0" , ... and
consequently cache is not set for my data.

I have also to point out that, when I try to access objects mapped with
context "annuaire", I always specify the database connection with such lines
as :
 // connection init
 thePool = DBConnectionPool.getInstance("annuaire");
 myConnection = thePool.getConnection();
...
 // creation of a DB object for my needs...
 myNode = new Hie_node(myConnection);
...
and Hie_node deriving from DBObject, it ends up by setting a call to
setDBName(), which sets originalDBKey to "annuaire" and hence the pb. I am
getting and for which I proposed a fix in DBObject.java

I guess I am not the only one using Expresso with a split db context (one
for Expresso setup tables and one for pure data), so I am surprised that not
more people encountered it - If I am OK with the configuration , may be the
way I use the connection is wrong ? - or nobody noticed that cache is not
working with such a configuration ?

Thierry
------------------

>Hi Thierry,

>I was getting the same problem on some of my DBObjects.  After a little
>investigation, I found that as well as setting up my DBObjects in
>DBOtherMap, I was also calling setDataContext().  Removing the call to
>setDataContext() stopped the exception being thrown.  I think that
>setDataContext() sets the originalDBKey field (returned by
>getOriginalDBName()).
>Maybe this is the same in your case.  If so, you won't need to make any
>changes to DBObject code.

>Cheers
>Malc
 -----Original Message-----
 From: opensource-admin at jcorporate.com
[mailto:opensource-admin at jcorporate.com]On Behalf Of Thierry Clement
 Sent: 05 March 2003 18:01
 To: opensource at jcorporate.com
 Subject: [Opensource] pb retrieving BDObjLimit with DB without setup
tables



>>  I found out that DBObject thows an exception which I think it shouldn't,
>>in the case of using the  "DBOtherMap" feature and no Setup Values,
>>  like set in this expresso-config file:

>>          <context name="default">
>>                  <description>default context - Expresso
data</description>
>>                  <jdbc driver="org.gjt.mm.mysql.Driver" ... cache="y"/>
>>                  ...
>>          <context name="annuaire">
>>                  <description>Oracle context - pure data</description>
>>                  <hasSetupTables>false</hasSetupTables>
>>                  <jdbc driver=oracle.jdbc.driver.OracleDriver" ...
>>                cache="y"/>
                 ...
         </context name>

>>  My schema being set thru a class extending
>>com.jcorporate.expresso.core.dbobj.Schema with declarations in constructor
>>such as:

>>              addDBObject( "com.cetim.annuaire.dbobj.Hie_node",
>>"annuaire" );

>>  [ Hie_node is the name of a table in my Oracle DB connected to context
>>"annuaire"  and also the name of the corresponding DBObject]


>>  When running the app and accessing Hie_node, JDBCExecutor tries to find
a
>>table DBOBJLIMIT in the Oracle DB, which is in fact in the MySql DB
(default
>>context) [ in a stack like IsCached -> getCacheSize() -> setCacheSize() ->
>>dbl.retrieve() ]
>>  May be my configuration is wrong (tell me if it is the case), but - if
>>not - I found a solution to avoid that, in DBObject.java, around line
6185 -
>>the idea is to use "default" context in this case
>>  [ from expresso 5-03 ]

>>    if (dbl == null) {
>>                  dbl = new DBObjLimit();
>>                  // dbl.setDBName(getOriginalDBName());        // WHAT I
>>COMMENTED and replaced by the following lines
>>                  // change: "default" context has to be set in the case
of
>>a DB  without setup tables>
>>                  ConfigContext oneContext = null;
>>                  String origDBName = getOriginalDBName();
>>                  try {
>>                      oneContext = ConfigManager.getContext(origDBName);
>>                  }
>>                  catch (ConfigurationException ignored) { }
>>                  if (oneContext != null &&
!(oneContext.hasSetupTables()))
>>{
>>                      dbl.setDBName("default");
>>                  }
>>                  else {
>>                      dbl.setDBName(origDBName);
>>                  }
>>          // END CHANGE
>>                  dbl.setField("DBObjectName", this.myClassName);
>>

>>  Has anyone experienced the same pb. and is it a proper change ?
>>  Thanks

>>  Thierry Clement
>>  CETIM - France



*************************************************************************
The information contained in this message or any of its
attachments may be privileged and confidential and intended 
for the exclusive use of the addressee. If you are not the
addressee any disclosure, reproduction, distribution or other
dissemination or use of this communication is strictly prohibited
*************************************************************************



More information about the Opensource mailing list