[Opensource] DB contexts and ControllerRequest.getDBName()
- proposed change
larry hamel
expresso at codeguild.com
Sat Oct 5 00:38:19 PDT 2002
can you help me understand the proposal more?
typically, a DBObject is constructed:
MyDBObject obj = new MyDBObject();
obj.setDBName( request.getDBName() ); // can substitute any dbname here
under the proposal, how will this change? Will the object constructor figure out some default DB name, or will the request object somehow figure out what object the DB name is for?
also, I'm not sure if this is related, but let me throw it out just in case:
I recently ran into "sticky" behavior on DBObject when I used DBObject.setStringFilter(). setting the filter causes the cashed version of the DBObject to get the filter also, so that all DBObject of the given type get this filter after setting. (is this a feature or a bug? i'm talking about 4.02; haven't tried latest expresso)
would the proposal be sticky like this? are you suggesting that dbname for an object, with dbname changed on-the-fly via setDBName(), becomes sticky thereafter, or that only the setting in the schema would be sticky?
ok, I'm sure that I have confused the issue enough to stop now :-)
larry
At 04:26 PM 10/4/2002, you wrote:
>Right now, it seems that the db context is driven by the request object and the only way to override that is by programmatically changing that. But, there is the handy constructor Schema.addDBObject(String class, String dbName). It seems right now that setting the dbName for a DBOject using this constructor does nothing.
>
>I believe that if ControllerRequest.getDBName() were changed (pretty much a one-liner) to first check this (before the request object), then this functionality would be added to expresso. A benefit off the bat would be that DBMaint could work with DBObjects outside of "default", which it does not right now - unless I am missing something big.
>
>Thoughts?
>
>Mike
>
More information about the Opensource
mailing list