possible performance increase for visual lansa on sybase...

18
LANSA Newsletter April 2009 page 1 © LANSA 2009 Newsletter April 2009 http://www.lansa.com Possible performance increase for Visual LANSA on Sybase databases Prior to V10, Visual LANSA databases created on Sybase were created with a default page size of 2048. This was appropriate for the version of Sybase that was included at that time, but currently it may be too low. Since Version 10, the default page size for new databases is 4096. If Visual LANSA, or a VL runtime application has been continuously upgraded from an older version, the database may still be set to 2096. Changing it to 4096 may offer improvements in all aspects involving database access. Confirming the current page size Start Sybase Central from the Sybase SQL Anywhere, or SQL Anywhere start menu folder. In Sybase Central, use File, Connect and then specify the User/Password and then select your LANSA database from the ODBC Datasource dropdown. Now click on the database name on the left window. The resulting dialog box should show the page size: In This Issue Performance increase Sybase page 1 TAG feature in the VL IDE page 12 More than 20 Sybase connections page 2 IDE crash when editing XSL source page 13 Source code Split View in the IDE page 3 Important System I Commands page 14 Teraspace storage in OS400 V5R4 page 6 PrompterActivate Event page 15 Fatal error debugging EPC834 page 7 Activate command at start VLF page 16 Update error Other Files page 8 MAIL_ADD_TEXT – second argument page 17 uQueryCanDeactivate in VLF EPC831 page 9 Important IBM PTFs for V6R1 page 18 VLF.NET Application Level Tracing page 11

Upload: buitram

Post on 16-Feb-2019

230 views

Category:

Documents


0 download

TRANSCRIPT

LANSA Newsletter April 2009 page 1 © LANSA 2009

Newsletter April 2009

http://www.lansa.com

Possible performance increase for Visual LANSA on Sybase databases

Prior to V10, Visual LANSA databases created on Sybase were created with a

default page size of 2048. This was appropriate for the version of Sybase that

was included at that time, but currently it may be too low. Since Version 10, the

default page size for new databases is 4096.

If Visual LANSA, or a VL runtime application has been continuously upgraded

from an older version, the database may still be set to 2096. Changing it to 4096

may offer improvements in all aspects involving database access.

Confirming the current page size Start Sybase Central from the Sybase SQL Anywhere, or SQL Anywhere start

menu folder. In Sybase Central, use File, Connect and then specify the

User/Password and then select your LANSA database from the ODBC Datasource

dropdown.

Now click on the database name on the left window. The resulting dialog box

should show the page size:

In This Issue

Performance increase Sybase page 1 TAG feature in the VL IDE page 12

More than 20 Sybase connections page 2 IDE crash when editing XSL source page 13

Source code Split View in the IDE page 3 Important System I Commands page 14

Teraspace storage in OS400 V5R4 page 6 PrompterActivate Event page 15

Fatal error debugging EPC834 page 7 Activate command at start VLF page 16

Update error Other Files page 8 MAIL_ADD_TEXT – second argument page 17

uQueryCanDeactivate in VLF EPC831 page 9 Important IBM PTFs for V6R1 page 18

VLF.NET Application Level Tracing page 11

LANSA Newsletter April 2009 page 2 © LANSA 2009

How do I allow for more than 20 concurrent connections to my Adaptive Sybase Anywhere (ASA) Database?

Adaptive Sybase Anywhere (ASA) Database (shipped with LANSA) has built-in

default of 20 concurrent connections. This may not be sufficient for some

organizations.

This number can be changed or increased by using the -gn parameter on the

database start line.

-gn parameter must be set up to number of connections line -gn 25

Syntax { dbsrv9 | dbeng9 } -gn integer

Number of tasks: The -gn option controls the number of tasks used to process

requests.

Effectively, this is the number of requests that can be handled concurrently. Each

request uses a task. When there are more requests than there are tasks, any

outstanding requests must wait until a currently-running task completes. By

default, there are 20 tasks for the network database server and 10 tasks for the

personal database server. There is no benefit to setting a number of tasks that is

greater than the maximum number of server connections.

LANSA Newsletter April 2009 page 3 © LANSA 2009

Enabling source code

split-view in the IDE

There is an undocumented feature in the V11 IDE that allows you to view two or

more sections of source code in one screen. This is useful when editing large

components or functions, where it might be necessary to constantly refer to the

definitions section of the source code.

Enabling split-view To enable split view, open the source code screen and put the cursor over the

splitscreen anchor at the top right of the source code window:

LANSA Newsletter April 2009 page 4 © LANSA 2009

When the mouse cursor is placed over the splitscreen anchor (the small bar on

top of the scrollbar) it will change into a resize cursor. At this point it is possible

to click and drag to create a splitscreen:

Once the mouse button is released, the code will be split at this level and it is

possible to scroll each window individually. Changes made in one window will be

reflected in the other window.

LANSA Newsletter April 2009 page 5 © LANSA 2009

It is also possible to create a vertical splitscreen by splitscreen anchor across

which exists on the left of the bottom scrollbar:

Or even a quad splitscreen by dragging both horizontal and vertical splitscreen

anchors:

To cancel the splitscreen feature, drag the splitscreen divider all the way to the

top or bottom of the source code.

LANSA Newsletter April 2009 page 6 © LANSA 2009

Enable 'Teraspace storage' in V5R4 to run JSM with IBM Technology for Java 32-bit JDK

V5R4 comes with the IBM Technology for Java 32-bit JDK, this JVM requires the

JNI JSMMGRSRV service program to be TERASPACE enabled.

This can be done by using the following command:

(On V5R4)

CHGSRVPGM SRVPGM(JSMMGRSRV) TERASPACE(*YES)

(On V6R1)

This is not required on V6R1 as the OS will automatically convert the JNI

JSMMGRSRV service program to be TERASPACE enabled.

When this keyword is not enabled on V5R4 you may get a message in the joblog:

================================================================================

Start JSM using IBM Technology for Java 32-bit JDK

STRJSM VERSION(*JVM5032)

Joblog message

MCH4443 Escape 40 01/26/09 11:26:56.313936 < lProcedure 0003D4 QP2USER2 QSYS *STMT

From Program . . . . . . . : AiUpcallProcedure

To module . . . . . . . . . : QP2API

To procedure . . . . . . . : runpase_common__FiPvT2

Statement . . . . . . . . . : 2

Thread . . . . : 00000005

Message . . . . : Invalid storage model for target program JSMMGRSRV.

Cause . . . . . : Target program JSMMGRSRV cannot be called or activated by

source program &1 because program JSMMGRSRV contains one or more modules

that are not teraspace storage enabled.

Recovery . . . : Recreate the target program.

Technical description . . . . . . . . : Source program &1 either uses *TERASPACE

storage model

or is running a Portable Application Solutions Environment

(i5/OS PASE) program. All modules in a *SNGLVL storage

================================================================================

LANSA Newsletter April 2009 page 7 © LANSA 2009

Fatal error when debugging in VL to System i after applying EPC834

This problem is introduced when an iSeries LANSA system that didn't have

LANSA for the Web initially installed is upgraded to V11 SP5. However, the

problem is only highlighted when trying to execute a VL form in debug against

the iSeries after applying EPC834 to SP5. EPC834 introduces the new debugging

mechanism and attempts to use LXQUEUE. Because of the incorrect version of

LXQUEUE, the debugging will issue a fatal error. When viewing the TP joblog in

the System i you may get a message similar to:

MCH4437 Escape 40 03/12/08 11:15:26.089992 AiActivator 001E00 QLEAWI QSYS *S To module . . . . . . . . . : QLEPM To procedure . . . . . . . : QleActBndPgmCommon__FPPvPULP24Qle_ActBndPgmInf o_Long_tPiPvPc Statement . . . . . . . . . : 30 Message . . . . : Program import not found. Cause . . . . . : The calling program W3XSVPGV refers to a procedure or data export from service program LXQUEUE which does not exist. The calling program refers to export-ID X'00000028', the service program defines only X'00000025' exports. Recovery . . . : Recreate the calling program. Technical description . . . . . . . . : The service program has been changed in an incompatible manner since the time the calling program was created and thus bound to the service program. Recreate the calling program.

This error message suggests that the LXQUEUE object is not the correct version.

Recovery This error is caused by the fact that the upgrade to SP5 did not replace the

existing version of LXQUEUE with the SP5 version. So, to recover from this

situation requires the current version of LXQUEUE to be replaced with an SP5

shipped version. The SP5 version of LXQUEUE can be obtained from your local

support center.

Note The LANSA for iSeries SP5 (EPC834) CD set (spin 300) shipped with the Visual

LANSA SP5 (EPC834) DVD (spin 301) installs/upgrades the correct version of

LXQUEUE. So, this V11 SP5 spin set should be used for any future upgrades to

avoid this problem.

LANSA Newsletter April 2009 page 8 © LANSA 2009

Crossed Update error message when accessing Logical Views on Other Files

When fetching from, and updating a logical on an Other File, in some cases the

message Record to be updated has been changed by another job/user will

be shown, even though no such change has occurred. The I/O will also fail with a

VE status.

Reason On LANSA defined files, crossed update checking is done using the @@UPID

value, and if this changes between fetch and update, a validation error is issued.

However, for Other files LANSA takes a snapshot of the field values at the time of

the read, and compares them to the values at the time of the update.

If a logical view does not contain all the fields from the physical file, the crossed

update check will have blank values for some fields in the file. When the Insert is

done, these blank values may cause the crossed update check to give a false

positive result.

Workaround This is unavoidable due to the way that the crossed update check works, hence

the workaround just involves using the physical file instead of the Logical. After

fetching the record from the logical file, fetch the same record from the physical

file using the relative record number, and then perform the update on the

physical instead of the logical file.

LANSA Newsletter April 2009 page 9 © LANSA 2009

'uQueryCanDeactivate' in EPC831 can be used to check unsaved changes when running VLF applications

A new feature called 'uQueryCanDeactivate' has been released in EPC831 of the

Visual LANSA Framework.

This is a method you can define in a command handler to:

1. Check whether there are unsaved changes.

2. Asks end users if they wants to save their unsaved changes.

3. Save unsaved changes.

This method is executed when a user clicks on a different command handler, a

different instance of a business object, a different business object or application,

or even when the user closes the Framework.

It is useful for saving unsaved changes as the routine can check whether

changes need to be saved. If so, the user can asked "Do you want to save your

changes before continuing?" (Yes/No). If the answer is Yes, their changes can be

saved.

At the time when the routine is executing, the command handler still has all its

values as they were before the user attempted to move away. Therefore

checking for unsaved changes, and saving those changes, is easy.

To use it, you need to set the avNotifyDeActivation property in the command

handler's initialize routine: * Handle Initialization Mthroutine Name(uInitialize) Options(*REDEFINE) * Do any initialization defined in the ancestor Invoke #Com_Ancestor.uInitialize * Activate Check for unsaved changes (Unsaved changes logic) set #Com_Owner avNotifyDeactivation(TRUE) Endroutine

Then add a redefined uQueryCanDeActivate routine to your command handler: * The Framework initiates this when the user moves to another command tab, or business object instance, or business object, or application, or closes the framework. * (The framework may initiate this method multiple times) MTHROUTINE NAME(uQueryCanDeactivate) OPTIONS(*REDEFINE) * Define_Map For(*Result) Class(#vf_elBool) Name(#Allow)

LANSA Newsletter April 2009 page 10 © LANSA 2009

#Allow := True * My flag indicating that an unsaved change has occurred if '(#pty_NeedsSaving *eq TRUE)' * If something needs saving, ask the user if they want to save it USE BUILTIN(MESSAGE_BOX_SHOW) WITH_ARGS('YESNO' 'YES' *Default *Default 'The notes have been changed. Would you like to save your changes before continuing?') TO_GET(#MSG_RET) if '#MSG_RET *eq YES' * Save everything << my save logic>> endif #pty_NeedsSaving := False endif endroutine

A more complicated version could set #Allow to false if there was an error during

the save, and in that case the user would not go to where they clicked, (or the

framework would stay open if they were attempting to close it)

Comments/Warnings You must set #Com_Owner.avNotifyDeactivation to TRUE if you want to use it.

The uQueryCanDeactivate method may be invoked several times by a single user

click, so it is important to reset (your equivalent of) #pty_NeedsSaving in the

routine, so that subsequent invokes do not check with the user again.

There are warnings in the feature help about using method uQueryCanDeactivate

and property avNotifyDeactivation in version EPC831 of the framework. These

warnings can be ignored.

This method can be useful when dealing with objects that don't signal when they

have changed. By using this method you can compare a snapshot of the object's

current status with its as-loaded status, just at the point the user has finished

with the command handler. (Rather than checking for changes every second)

LANSA Newsletter April 2009 page 11 © LANSA 2009

VLF.NET Application

Level Tracing

VLF.NET is available in EPC831 and in the same way as for VLF/Web or

VLF/WAM, you can switch on the VLF Trace window to troubleshoot VLF.NET

applications.

The Trace Window is a useful tool which displays the VLF build information, the

web host detail, your web server images path, HTML codes and also your VLF

source code arriving at the browser when the .NET application has been

executed:

To enable tracing, simply select the option in 'Execute as Web Application'

window --> select 'Start - As .NET executable' and the option 'Turn Tracing On':

You can also copy all trace details using the Copy to Clipboard button when

reporting an issue to LANSA Support for investigation.

LANSA Newsletter April 2009 page 12 © LANSA 2009

Using the TAG feature to jump to the next or previous tagged comment line

Long time users of LANSA on system i might be familiar with the TAG feature

that is available in RDML source which allows you to put a permanent tag on a

comment line. when you close the RDML editor, the tag is saved with the source

and is available again when you net open the source.

This permanent tag feature is also available in the Visual LANSA IDE and can be

used in both functions and components. Adding a tag allows you to use

keystrokes to jump to the next or previous tagged comment line.

Action Key to use

Toggle a tag on a line Ctrl + F2

Remove all tags Alt + F2

Jump to the previous tagged line Ctrl + Up Arrow

Jump to the next tagged line Ctrl + Down Arrow

Comment selected text Ctrl + W

Uncomment selected text Ctrl + Shift + W

LANSA Newsletter April 2009 page 13 © LANSA 2009

IDE crash when editing XSL Source

There have been some cases reported where the IDE crashes with a fatal error

after certain operations in the XSL Source tab of a WAM or Weblet. While there is

no definite pattern to reproduce the error, crashes have been reported during

copy/paste procedures, or when pressing backspace.

Recovery A defect has been found in the XSL editor, which will be corrected in the next

EPC. Until then there is a hotfix for SP5 EPC834 available from support to correct

the issue. Please contact support for a copy of the hotfix.

LANSA Newsletter April 2009 page 14 © LANSA 2009

Important/Common System i Queries and Commands

The following article provides a clear roadmap to assist in obtaining the system

control information most commonly requested by 3rd party vendors for licensing

purposes.

http://www.itjungle.com/fhg/fhg092607-printer03.html

All the information required by LANSA for licensing is listed along with the

commands used to obtain the information. The system information required by

LANSA is also listed in the Identify your System i Details section of the Installing

LANSA on System i guide.

LANSA Newsletter April 2009 page 15 © LANSA 2009

Making use of the PrompterActivate event to prepare a prompter form

The PrompterActivate event is triggered when the user clicks on the prompter

button. This event is intended to allow access to the prompter form before it

displays, so that initialization processing can be performed. The event contains a

reference to the prompter form about to be called, so it is possible to pass values

to the prompter form by calling a method, or setting a property on it. However at

design-time, the IDE does not know which form will be called, so the reference to

the prompter form only returns a generic PRIM_FORM. This means that none of

the custom methods or properties can be accessed.

Solution In order to allow access to the properties or methods contained in the prompter

form, the PRIM_FORM must be cast into an instance of the prompter form, as per

the RDMLX source code below:

EVTROUTINE HANDLING(#CUSTOMER.PrompterActivate) OPTIONS(*NOCLEARMESSAGES *NOCLEARERRORS) Form(#PromptForm) (#PromptForm *As #CustPrmpt).SetCaption("Hello World") ENDROUTINE

This assumes that #CustPrmpt is the name of the prompter form. Note that the

form being called hasn’t actually been initialized when this event executes, so the

initialization logic will be performed after the PrompterActivate event completes.

LANSA Newsletter April 2009 page 16 © LANSA 2009

Automatically activate an Application Command after the VLF has been launched

Automatically starting a default Application Command in the Visual LANSA

Framework on Windows, immediately after the Framework has been launched ,

can be achieved by using a Mthroutine in the System entry point of the VL

Framework.

Example MTHROUTINE NAME(avMAINWindowReady) OPTIONS(*REDEFINE)

INVOKE METHOD(#avFrameworkManager.avSwitch) To(BusinessObject)

named(LANSA_DEMO) execute(Details) caller(#com_owner)

Set Com(#Continue) Value(True)

ENDROUTINE

Remark The RED items should be replaced by your own BO and CH

LANSA Newsletter April 2009 page 17 © LANSA 2009

MAIL_ADD_TEXT -

second argument When you use the BuiltIn function MAIL_ADD_TEXT without the value ‘N’ in the second argument, you always get a new line for every new MAIL_ADD_TEXT instruction! But when you use MAIL_ADD_TEXT with value 'N' in the second argument, for example: USE BUILTIN(MAIL_ADD_TEXT) WITH_ARGS(#TEXT 'N') TO_GET(#IO$STS) the text of the next MAIL_ADD_TEXT will be connected to one before. This will result in a text block, which can contain more then 255 characters. An email reply in a program from one of our LANSA customers always showed two lines. This was solved by using the second argument value 'N': CHANGE FIELD(#TXT) TO('''Indien u langer dan drie weken voorafgaand aan de heenreis een aanvraag gedaan heeft, ontvangt u per post''') USE BUILTIN(MAIL_ADD_TEXT) WITH_ARGS(#TXT N) TO_GET(#LEM_RETC) CHANGE FIELD(#TXT) TO('''een bevestiging met acceptgiro.''') USE BUILTIN(MAIL_ADD_TEXT) WITH_ARGS(#TXT) TO_GET(#LEM_RETC)

The result in the mail now is: Indien u langer dan drie weken voorafgaand aan de heenreis een aanvraag gedaan heeft, ontvangt u per post een bevestiging met acceptgiro.

LANSA Newsletter April 2009 page 18 © LANSA 2009

Important IBM PTFs

for V6R1

If you experienced significant performance degradation after upgrading to V6R1,

it’s recommended to apply the V6R1 PTFs and follow their instructions to improve

the performance. One such case experienced by our customer was when using

complex SELECT_SQL statements in RDML.

If you are in the process of upgrading to V6R1, the PTFs are also suggested by

IBM to avoid possible performance impact.

Solution Apply PTFs MF46183 and MF46307

Coversheet descriptions PTF/FIX #: MF46183 - Licensed Internal Code

LICENSED PROGRAM: 5761999 DESCRIPTION OF PROBLEM FIXED FOR APAR 'MA37477' : ------------------------------------------------- Since going to R610 CPU has been higher than expected and the end users have complained about response time. Client application uses LANSA which uses OPM RPG programs. CFGRPBL bzero_GenNaker appears to be the largest CPU consumer. CORRECTION FOR APAR 'MA37477' : ------------------------------- Revert to the previous release behavior for processing recycled static storage for those MI program objects that have undergone conversion after the apply of PTF MF46307.

PTF/FIX #: MF46307 - Licensed Internal Code

LICENSED PROGRAM: 5761999 DESCRIPTION OF PROBLEM FIXED FOR APAR MA37558 : ----------------------------------------------- For programs and service programs created or converted on V6R1, static initializers consisting of a string of zeros were not generated. Instead, the activation of the program would clear all static storage to zeros. In some cases this results in a noticeable performance degradation. See also APAR MA37477. CORRECTION FOR APAR MA37558 : ----------------------------- Licensed Internal Code has been altered to create program and service program objects with the required zero initializers for static storage. Activation of the new programs will perform better when the PTF for APAR MA37477 is applied. The affected programs must be either re-created or converted after this PTF is applied.