GemBuilder for Java (GBJ) version 3.2 is a major new release of the GemBuilder for Java product.
GBJ 3.2 includes significant changes in the infrastructure involved in connecting to the GemStone server, and how RPC vs. linked sessions are configured. This affects how the environment is set up, but other than a few specific restrictions, the changes should be fairly transparent to the user.
This release also contains improvements in handling GemStone specials, and other changes and bug fixes.
These release notes provide details of the changes between the previous version of GBJ, version 3.1.3, and this release. If you are upgrading from a version earlier than 3.1.3, please refer to the Release Notes for each intermediate release as well.
To install GemBuilder for Java v3.2, follow the instructions in the GemBuilder for Java Installation Guide for v3.2.
GemBuilder for Java version 3.2 is compatible with GemStone/S 64 Bit v3.7.2 only, with GemStone and clients on Linux only. Contact GemTalk for support on other platforms.
GBJ now supports two environments; one which supports robust, performant multithreaded applications using RPC sessions, and another to support maximum-performance single session linked applications.
The multithreaded RPC environment is supported by gbj320.jar, while the linked environment is supported by gbjLnk320.jar.
There are differences between the packages com.gemstone.gbjgci between the RPC and linked interfaces. However, using the com.gemstone.gbj package (which is recommended), a compiled java application should run correctly in both environments, provided the appropriate login parameters are used.
To support performant multiple session GBJ applications, gbj320.jar loads the server thread-safe libraries, rather than the classic GCI libraries used in previous releases of GBJ. A related sources file is provided for debugging, gbjsource320.jar.
gbj320.jar loads the server shared library libgcits* and the GBJ-specific libgbjts*, which use GemStone/S 64 Bit’s thread-safe GCI interface, with the API defined in gcits.hf.
The multiheaded RPC configuration using gbj320.jar has some limitations:
To allow linked logins, gbjLnk320.jar is provided, which allows only a single instance of GbjSession to be logged in at a time. Using this .jar file provides the highest performance for a Java VM that only needs a single server session, with one Java thread executing queries. A related sources file is provided for debugging, gbjLnksource320.jar.
gbjLnk320.jar loads the server shared library libgcilnk*, and the GBJ-specific library libgbjlnk*, using the classic GCI defined in gci.hf.
A separate set of javadocs for this environment is provided under docsLnk/.
Using gbjLnk320.jar, the default java stack size is insufficient. The java argument to increase this value should be used; for example, -Xss2048k.
Previous releases of GBJ used the classic GCI, which required significant extra handling to support multiple sessions.
gbj320.jar supports a Java VM containing multiple logged in instances of GbjSession. Access to the server is by synchronized methods in com.gemstone.gbjgci.GbjGciSession. This provides synchronizing on the instances of GbjSession, allowing multiple Java threads to simultaneously execute queries against multiple server sessions.
Previous releases of GBJ contained static synchronized native methods, which synchronized on the com.gemstone.gbjgci.GbjGciInterface class, which does not allow multithreaded execution of queries. Multiple sessions were supported by nonblocking executions. This access is now only used by the linked interface, and nonblocking executions have been removed. All access to the server is via blocking GCI calls.
GBJ v3.2 relies on BigFraction for Fraction support. This class is from Apache; see https://commons.apache.org/proper/commons-math/.
Your CLASSPATH or -cp argument must include the .jar file that supports this, commons-math3-3.6.1.jar.
This file can be downloaded from https://dlcdn.apache.org//commons/math/binaries/
GBJ requires access to a directory containing the GemStone server shared libraries, and it must know the version of the server that you are intended to connect to.
The process has changed in this release to unambiguously handle the expected configurations.
The follow are expected configurations:
To avoid issues where a java.time.ZonedDateTime, which is based on /etc/timezone, and a GemStone server DateTime, which is based on TimeZone current, are not equal, the server’s TimeZone must now match the OS’s configured timezone.
The installation process verifies that the TimeZone installed in the repository (reported by TimeZone current) matches the TimeZone configured in the OS (in /etc/timezone), and reports an error if it does not match.
The GemStone/S 64 Bit v3.7.2 now includes support for updating the timezone by executing code, using TimeZone >> installOsTimeZone. See the GemStone/S 64 Bit v3.7.2 Release Notes or image method comments for more information.
Mapping Collections to GbjCollection did not work correctly for operations such as enumerations, when used against GemStone Collections that are not implemented by the collection directly containing the content elements. These kinds of Collections are now mapped to GbjObject rather than GbjCollection.
Attempting to use GbjCollection with these kinds of collections is no longer allowed.
This includes: Set and Bag, as well as other GemStone specific collections such as GsPipe and RcQueue. Dictionaries are also not supported, due to variations in the implementations.
See GbjGciInterface class >> excludeFromGbjCollectionMapping for the excluded classes.
New class mappings have been added to better support recently added GemStone server specials.
The following table lists the current class mappings:
GbjInstant is a subclass of DateAndTime, used to represent instances of Java.time.Instant. Instances in the server have a timezone offset of zero (GMT); any offset stored in the instance is ignored in Java.
GbjLocalDateTime is a subclass of DateAndTime, used to represent instances of Java LocalDateTime. Instances in the server have a timezone offset of zero (GMT); any offset stored in the instance is ignored in Java.
Previously, there were a number of issues in the way java strings outside the ASCII range were handled in GemStone. A number of specific bugs have been fixed, and extensive testing and cleanup has been done in this area.
For java strings containing codepoints in the range 128-255, the resulting single-byte String created in GemStone contained UTF-8 codepoints using two bytes, rather than the single 8-bit Character. #(50996)
Instances of java.lang.String contain UTF-16 encoded data. When these are converted to Smalltalk objects, java strings containing code points in the range 16r10000 to 16r10FFFF (the unicode maximum) were not correctly converted to QuadByteString/Unicode32. (#51112)
Note that GemStone/S 64 Bit now disallows characters with code points in the range 16rD800 to 16rDFFF; these are illegal characters in Unicode.
GemStone supports two kinds of strings, the legacy String/DoubleByteString/QuadByteString, and the unicode strings Unicode7/Unicode15/Unicode32.
Previously, when a java string stored into GemStone, it was always a legacy string. Now, the kind of String created depends on the repository’s configuration. If the class defined by (Globals at: #StringConfiguration) is String, then a legacy string of the appropriate class for that string’s codePoint range is created; if this is Unicode16, then the appropriate class of unicode string is created. (#46427)
When running with GemStone/S 64 Bit v3.7 or later, GCSI statistics initialization failed, as a larger Array size was needed to hold results. (#50994)
When using an instance of GbjIterator to enumerate over a large collection, if the collection was larger than GbjIterator.BatchSize (which defaults to 1000), then an exception "startindex/numObjs out of range in getObjs()" was raised when attempting to enumerate to an element beyond the batch size. (#47289)
When using registerStub to establish a correspondence between a java and GemStone Smalltalk class, and enumerating over a collection of instances of this class that was replicated from the server, and the size of the preload buffer (as set in GbjSession.initialize()) is smaller than the number of objects in the replicated collection, then retrieval of elements that were not preloaded failed with a java.lang.ClassCastException. (#47084)
Using the GbjObject.stringValue() method returned incorrect results on LargeInteger objects. (#46551)
When OOPs are printed using GbjObject asString(), for OOPs greater than 1152921504606846975, the printed version wrapped, and was printed as an incorrect negative value. (#48138)
Calling up the GbjLauncher from a java program on an open session (via "new GbjLauncher(mySession)") worked, but subsequent subwindows could not be opened. This way of invoking GbjLauncher did not execute code that set GemStone-to-java class mappings correctly. (#46531)