Unofficial Content
  • This documentation is valid for:

.NET Generator Specific Section

Introduction

This section explains all changes and improvements done to GeneXus 9.0 .NET Generator.

Main Features

NET Framework 2.0 Support has been added

As from this version .net framework 2.0 has been added. So, the GeneXus generated applications can be compiled with framework 1.1 and run in machines with framework 1.1 or 2.0; or be compiled with framework 2.0 and run in machines with framework 2.0.
Note: In order to run on framework 2.0 a .net win application or a PDF report in web, jsharp framework 2.0 is required. More information

GeneXus .NET Publication Assistant: Deploy with just one click

Deploy your .net win application with just one click! Regardless if it is a 2tier or a 3tier application and regardless if it is the first version of your application or an upgrade. Send your users the HTTP URL of the applications and they will access it easily, with no installation headaches. And they will be automatically using the latest version of your application every time they access it! More information

ADO.NET connectivity with more dbmses than ever!

ADO.NET connectivity is supported in DB2 UDB, DB2 UDB for Iseries, MySQL and Oracle.
The new ones are MySQL and DB2 UDB for Iseries.
To see how to access MySQL with ADO.NET, click here
To see how to access DB2 UDB for Iseries, click here

New Model Property for .NET WIN: "Assemblies Structure"

This new property has two options: "By Folder" and "By Main". "By Folder" means that one assembly per folder in the KB will be generated which contains the classes of the different procedures and objects which are in that folder. This way to build assemblies was the one used in GeneXus 8.0.
"By Main" means that one assembly per Main will be created which contains all the objects of the "Callees tree" of that Main. (The tree is cut when a called main is reached.)

Other Features

New Model Property: Maximum cached cursors per connection

When the maximum is reached, the application tries to close some open cursor. If this is possible, the application closes the cursor and opens (and caches the new). If not, writes a warning to the log (if trace is enabled) telling that the cache is being expanded and continues the execution.
The target is to avoid infinite memory consumption / reduce memory consumption.
Changing the value specified in this property may affect performance of the application. The best value depends on the application and the environment.
The default value is 100.
More Information...

Generating Cleaner Code

As from this version the code is generated cleaner, with better legibility.
As an example, the method which implements the Pseud transactional dialog was named 'chkps', now its name is 'CheckOptimisticConcurrency'. Given the case you need to explore the generated code, now you will understand it easier. Camelcasing is used also. Instead of the method 'init_no_key' the 'InitializeNonKey' method is generated.

New Model Property for .NET WEB: "Static Content Base URL"

This allows to reference images and other static content with relative paths even when this content is not under the same virtual directory. More Information...

Improvements to .NET Compilation.

This option now works accurate in win and webmodels.
Improvements have been done also in compilation time: Now the Succeeded message is more accurate.
More Information...

Crypto.dll is not more used

The C code used to encrypt and decrypt was moved to C# and is now implemented in gxclasses.dll

GXResources.dll is created

The GXResources.resources and messages.<lenguaje>.resources are not created. Both files were replaced by GXResources.dll and messages.<lenguaje>.dll. The first one makes easier the web deployment and second one avoids file lock problems.
More Information...

Object Property "Execute in new LUW" has been implemented in .NET

Rule Error_handler is now supported

Now you can handle data access errors. More Information...

New Model Property "Log Level"

Use this property to specify the level of log you want to generate. You don't need anymore to modify web.config to generate the log. More Information...

New value for "Reorganize Server Tables" property : Yes (Subscribed Database).

Allows to reorganize subscribed databases in SQL Server. More Information...

Compatibility

  • The default access technology changed from ODBC to ADO.NET for SQL Server, Oracle, DB2 UDB, DB2 UDB for Iseries.
  • When creating Multi tier applications, the Application Server host default is now http://localhost/remoting.
  • Win: The default of the Client Side Validation Model Property changed from No to Yes
  • As from this version when comparing, unicode comparison is used and not the one which depends on the culture More Information...
  • See GeneXus 9.0 Compatibility section for more information...

Comments & Collaboration

DOS window opens and closes when compiling, why ?

In a .NET WEB model, when compiling, a dos window is opened and closed, appears like a flash. This is because the web.config is touched in order to recycle asp.net (asp.net locks the resource files) and be able to compile a new version of the resources. (In previous versions resources were standard and included in the generator's setup.) )
The resources contain all the messages, text, etc of the application.

Multi tier applications and server object's lifetime

img/wiki_up//objectlifetime1.gif

Each server object (Client A's objects) is associated with a lease upon creation. This lease assigns a time to live -TTL- count to each object that is created at the server (which starts at five minutes by default) and is decremented in certain intervals. Additionally for each method call placed on the remote object (it means from the client), the TTL is incremented again (two minutes in the default configuration) to ensure that objects currently in use will not time out.

The Lease Manager is part of the .net remoting framework and it runs in the background of each server side application. It polls all server side objects at certain intervals (10 seconds by default) and decrements their TTL. When this time reaches zero, the framework looks for any sponsors registered with this lease.

A sponsor is an object running on the server itself that will take a call from .NET Remoting framework asking whether an object's lifetime should be renewed (and in this case it will return the new TTL) or not. When the sponsor decides that the lease will not be renewed or when the framework is unable to contact any of the registered sponsors, the object is marked as timed out and then garbage collected. When a client still has a reference to time-out object and calls a method on it, it will receive an exception.
Each client has a sponsor on the server side for its objects. Its sponsor is created at the first client request.

The sponsors are remote objects themselves. Therefore, they also have an assigned lifetime and we have to manage this to provide a consistent behavior. Generally, we need the sponsors to be active as long as the client is "online". We nevertheless will have to make sure that the resources will be freed as soon as possible after the client application is ended. To do this, when a client starts, it starts a "KeepAlive thread" that sends a command to the sponsor at certain intervals so that it stays alive.

The sponsor has a DateTime variable that holds the time of the last command received from the "KeepAlive thread". When the sponsor takes a call from Lease Manager asking whether an object's lifetime should be renewed (and the time to add) or not, the difference between the current time and the last time command has been received will be checked, and the sponsored object's lease will only be renewed when the interval is below a certain limit. As soon as all objects that are monitored by this sponsor are timed out, no further calls will be placed to the sponsor itself, and its own lease will therefore expire as well.

The following settings allow you to specify parameters for the sponsorships mechanism.

At the client configuration file (client.exe.config):
KEEP_ALIVE_INTERVAL: the interval (in seconds) in which the KeepAlive thread will send a command to the sponsor (default is 90 seconds).

At the server configuration file (web.config or server.exe.config):
SPONSOR_LIFETIME: the maximum time to wait for a "keep alive" command. If the sponsor doesn't receive a "keep alive" command before this time is reached then the sponsored object's lease will not be renewed (default is 420 seconds).
SPONSOR_RENEWONCALL: the new TTL when the sponsor wants to renew an object's lifetime (default is 300 seconds).
leaseTime: the initial TTL for the server objects (default is 5 minutes)
renewOnCallTime: the time to add to an object's TTL when a method is called (default is 2 minutes)
leaseManagerPollTime: the interval in which your object's TTL will be checked by the Lease Manager (default is 10 seconds).
sponsorshipTimeout: the time to wait for a sponsor's reply (default is 2 minutes).


The last four settings are important for the sponsor object because it doesn't have an associated sponsor like the other server side objects. It's mean that the lifetime of the sponsor depends only on these settings. Additionally, the only methods that a remote client calls on the sponsor are the "keep alive" commands that the KeepAlive thread sends. For this reason the KEEP_ALIVE_INTERVAL has to be less than renewOnCallTime.

Last update: February 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant