|
About This Patch
This patch corrects several Java-related bugs in WebObjects 3.5.1 for Windows NT and Solaris. It should be installed on all WebObjects 3.5.1 development and deployment systems running on Windows NT or Solaris. This patch also incorporates the changes to the Sybase and ODBC EOF adaptors included in a previously released patch. Once this patch is installed, be sure to read
TIL article # 72624
to learn about a problem that can occur when subclassing customObject and how to avoid it.
Installing WebObjects 3.5.1 Java Patch 2 on Windows NT 4.0
1. Download the Windows NT version of the patch from Apple's FTP site at ftp.info.apple.com. The file is located at:
/Apple_Support_Area/Apple_Software_Updates/MultiCountry/Enterprise/webobjects/patches/
3.5.1/3.5.1_Java_Patch_NT.tar.gz
2. Log in as a user with Administrator privileges.
3. Open a Bourne shell . The Bourne shell should be available from your Start menu, under the WebObjects program group, or under your Apple root directory at Demos\sh.exe.
4. Type the following at the shell prompt (make sure that there are no WebObjects or OPENSTEP applications running first):
cd $NEX T_ROOT
gunzip -c 3.5.1_Java_Patch_NT.tar.gz | gnutar xvfE -
6. Reboot
your Windows NT system
On Windows NT, this patch replaces some of the files in the following directories. If you back up these directories before installing the patch, replacing them will return you to a "clean" installation:
Installing WebObjects 3.5.1 Java Patch 2 on Solaris
1. Download the Solaris version of the patch from Apple's FTP site at ftp.info.apple.com. The file is located at:
/Apple_Support_Area/Apple_Software_Updates/MultiCountry/Enterprise/webobjects/patches/
3.5.1/3.5.1_Java_Patch_Solaris.tar.gz
2. Log in as root . If you're not sure how to log in as root, see your system administrator.
3. Type the following at the shell prompt (make sure that there are no WebObjects applications running first):
cd $NEXT_ROOT
gnutar xvf 2674_WebObjects_3.5.1_Java_Patch_Solaris.tar
4. Reboot your Solaris system
New Features
New features in WebObjects 3.5.1 Java Patch 2
Java VM arguments: You may now pass "command line" arguments to the Java Virtual Machine. This is particularly useful for increasing the memory allocation pool (the garbage collected heap), which defaults to a maximum size of 16 MB. You should increase the pool size if you receive a java.lang.OutOfMemoryError exception.
Here is some sample code showing how to pass these arguments. Be sure to add the JavaVM framework to your project. In YourApplication_main.m, do something like this:
#import <JavaVM/NSJavaVirtualMachine.h>
int main(int argc, const char *argv[])
{
NSAutoreleasePool* shutUp=[NSAutoreleasePool new];
NSMutableDictionary* myArguments=[NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:30*1024*1024], @"NSJavaMinHeapSize",
[NSNumber numberWithInt:60*1024*1024], @"NSJavaMaxHeapSize",
nil];
[NSJavaVirtualMachine setDefaultVirtualMachineArguments:myArguments];
return WOApplicationMain(@"Application", argc, argv);
}
You can ignore the compiler warning about the unused AutoreleasePool variable.
For a complete list of arguments, refer to the NSJavaVirtualMachine.h header in the JavaVM framework.
Problems Fixed
Corrected in WebObjects 3.5.1 Java Patch 2
DecimalNumber: Several of the next.util.DecimalNumber arithmetic methods raised exceptions when called. These methods now work properly.
CalendarDate: The next.util.CalendarDate constructor CalendarDate(java.util.Date date) would sometimes return an incorrect date. This has been fixed.
NoSuchMethodError exceptions: WebObjects applications written in Java would occasionally raise a java.lang.NoSuchMethodError exception, when the method did in fact exist. This was caused by a race condition on the interaction between Objective C's reference counting and Java's garbage collection. This has been fixed. These exceptions could also be raised if a subclass of next.eo.CustomObject did not implement a default constructor (that is, an -init method with no parameters). Chained initializer methods would give the same result if some of the methods in the chain did not have Java equivalents. After installing this patch, a missing default constructor will generate a more meaningful error message.
Java string retain crashes: A problem was fixed where Java strings were garbage collected before WebObjects had a chance to retain them. The missing strings caused some applications to crash under heavy use.
Multiprocessor crashes on Solaris: Because of improper use of lock files, WebObjects 3.5.1 applications would sometimes crash on multiprocessor Solaris machines. This behavior is fixed in this patch.
Incorrect cloning behavior: Previously, custom Java objects did not correctly implement the Cloneable interface. With this patch installed, subclasses of NextObject and CustomObject should be cloneable.
DirectToWeb application crashing: The previous version of this patch for Windows NT caused crashes when launching a DirectToWeb application. This has been corrected in the current patch release.
EOEditingContext can now retain all referenced objects: EOEditingContext's weak references to objects caused problems with Java's multithreaded garbage collection. If you are writing an application which accesses the Enterprise Objects Framework from Java, you may encounter two problems:
+ (void)setInstancesRetainRegisteredObjects:(BOOL)flag;
+ (BOOL)instancesRetainRegisteredObjects;
If instancesRetainRegisteredObjects is YES, newly created EOEditingContexts will retain any EOs that it is observing. The default value for this flag is YES if an application contains Java, and NO otherwise. Each EOEditingContext caches the value of this flag, so it is possible to switch from one state to the other midway through your application. Note that only newly created EOEditingContexts will be affected by the flag.
In order to collect the EOs, you must either deallocate the editing context, or call the new method:
- (void)reset;
on the editing context. Calling reset causes the editing context to forget and release all of the objects that it is watching, and makes all of those objects effectively unusable. You typically will not not have to do anything to a Java WebObjects application in order to be compatible with this new behavior. A session's defaultEditingContext will get collected when the session times out, releasing all of the EOs fetched by that session.
Corrected in EOF 2.2 Sybase Adaptor Patch
All parameters required for Sybase stored procedures
Apple reference # 2203081
PROBLEM:
If you did not supply all values when executing a Sybase stored procedure, the execution would fail with an exception like:
Feb 19 11:23:53 WOF_3_5_Sybase_Patch[1027] Caught exception:EOGeneralAdaptorException
Sybase: Server:unknown Procedure:NEXT_MOVIE_PRIMARY_KEY Line:0 Procedure NEXT_MOVIE_PRIMARY_KEY expects parameter @A_MOVIE_ID, which was not supplied.
This happens even though A_MOVIE_ID is not required for the stored procedure.
RESOLUTION:
The Sybase adaptor no longer requires optional arguments to stored procedures.
Cannot fetch float-NSDecimalNumbers along with text columns
Apple reference # 2208497
PROBLEM:
If you have an attribute with external type float, and internal type NSDecimalNumber, it will not fetch properly if a text column is also in the fetch. The attribute will be blank.
RESOLUTION:
The Sybase adaptor now correctly fetches these attributes.
Corrected in EOF 2.2 ODBC Adaptor Patch
ODBC Adaptor cannot execute stored procedures with output parameters
Apple reference # 2208503
PROBLEM
The EOF 2.2 (WebObjects 3.5) version of ODBCEOAdaptor.framework introduced a bug which causes an error when using a stored procedure with an output parameter.
RESOLUTION
The ODBC adaptor now handles output parameters correctly.
ODBC adaptor leaks connections with Microsoft Access
Apple reference # 2209574
PROBLEM:
The EOF 2.2 (WOF 3.5) and earlier versions of ODBCEOAdaptor.framework did not release ODBC connections when using Microsoft Access (or any JET based data source) in order to work around a bug in the Microsoft odbcjt32.dll library; this bug caused a crash when SQLFreeConnect was called. The SQLFreeConnect bug was discovered in version 3.40.2829 of the DLL. Newer versions of the DLL (beyond 3.50) no longer exhibit the crashing problem.
RESOLUTION:
The patched version of this framework now checks the version of the DLL more carefully and allows SQLFreeConnect to be called unless the DLL version is 3.4X. The adaptor no longer leaks the ODBC Connection when running with fixed versions of odbcjt32.dll.
Disclaimer
THE SOFTWARE PATCH PROVIDED FROM APPLE IS PROVIDED "AS IS" AND WITHOUT WARRANTY, EXPRESS OR IMPLIED. APPLE SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL APPLE BE LIABLE FOR ANY DAMAGES, INCLUDING BUT NOT LIMITED TO ANY LOST PROFITS, LOST SAVINGS OR ANY INCIDENTAL OR CONSEQUENTIAL DAMAGES, WHETHER RESULTING FROM IMPAIRED OR LOST DATA, SOFTWARE OR COMPUTER FAILURE OR ANY OTHER CAUSE, EVEN IF APPLE IS ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, OR FOR ANY OTHER CLAIM BY CUSTOMER OR FOR ANY THIRD PARTY CLAIM.
Document Information | |
Product Area: | WebObjects |
Category: | WebObjects 3.5.1 |
Sub Category: | Patches |
Keywords: |
Copyright © 2000 Apple Computer, Inc. All rights reserved.