O$: Object vs Object Refence?
Paul Mulroney
pmulroney at logicaldevelopments.com.au
Mon Apr 19 00:04:57 UTC 2021
Hi Everyone,
We've been using a class var to hold a Postgres session object ever since we started migrating our software to SQL. For a recent project, we're going to use one postgres database with multiple schemas, and found that our class var isn't going to work. The basic issue is that the session holds the current schema, so if you change schemas in one place, the next call elsewhere will use the new schema.
For our desktop app, that's going to be OK, because it always references the one schema. However we use the same framework for our jsClient - each connection could potentially reference a different schema.
My plan was to use a class var for the desktop, and instance vars for the jsClient, and somehow switch between the two. However, I couldn't find an easy way do that. The best I could find was to convert the Object to an Object Reference, and then I could easily pick between either the session pool or the class var.
Next problem: Our typical block of SQL code goes like this:
Do ioSQL.$mySessionObject returns voSQL
calculate vsQuery as <something>
Do voSQL.$execdirect(vsQuery)
... etc
where voSQL is an Object.
My question: Can I have an Object Reference, and somehow get back to the Object? Otherwise, there's hundreds of lines of code across dozens of libraries that need to change <groan>
Regards,
Paul.
Why does a chicken coop have two doors? If it had four doors it would be a chicken sedan.
--
Paul W. Mulroney We Don't Do Simple Pty Ltd
pmulroney at logicaldevelopments.com.au Trading as Logical Developments
www.logicaldevelopments.com.au ACN 161 009 374
Ph: +61 8 9458 3889 86 Coolgardie Street
BENTLEY WA 6102
More information about the omnisdev-en
mailing list