[GemStone-Smalltalk] Getting started with Gembuilder for VW
Martin McClure via GemStone-Smalltalk
gemstone-smalltalk at lists.gemtalksystems.com
Tue Nov 20 16:50:18 PST 2018
On 11/20/18 10:37 AM, Annick Fron via GemStone-Smalltalk wrote:
> I have succeeded to connect 2 PCs using the same database, and I have defined classes in the base. Now I have a class inst var as a connector, and I am able to store one object in the server. But using the same connect with updateST, I am not able to get it back.
> Any idea how to debug ?
> Best regards
Connectors have some limitiations. Class instvar connectors in
particular have the limitation that changes in the variable's value
cannot be automatically detected by GBS. Connectors for class variables
don't have this limitiation.
However, especially when getting started, you may find it easier to not
use connectors for your data roots.
Use connectors for your classes (you can do without them sometimes, but
they're easy and reliable. Then, after login, you can "manually"
replicate your data roots.
Say you have on both client and server the class MyClass, with class
instVar myInstances, and accessor methods for that variable.
Since you have a class connector for MyClass, once you're logged in the
client MyClass is automatically mapped to the server MyClass.
To initialize the instance variable on the server, you could do this on
MyClass performOnGsServer: #myInstances: withArguments: (Array with:
Thereafter, after each login, you can have the client initialize itself
from the server with:
MyClass myInstances: (MyClass performOnGsServer: #myInstances).
After that, the client and server OrderedCollections (in this example;
could be just about any object) are mapped to each other and will
automatically synchronize their state.
I hope this has been helpful, and that I haven't completely
misunderstood what you're trying to do.
If you get things working as I've suggested above, then you can
experiment with Connectors if you like. And keep asking questions! GBS
is very general-purpose, and it can take a bit to learn what the more
successful patterns of use are.
More information about the GemStone-Smalltalk