Re: [U2] UniObject .NET Session and Common Block Bug

2009-10-12 Thread Adrian Halid
 confidential or privileged material. Any unauthorised review, use, 
alteration,
disclosure or distribution of this e-mail (including any attachments) by an 
unintended recipient
is prohibited. If you are not the intended recipient please contact the sender 
as soon as
possible by return e-mail and then delete both messages.
___


-Original Message-
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Bill Haskett
Sent: Saturday, 10 October 2009 9:16 AM
To: U2 Mail List
Subject: Re: [U2] UniObject .NET Session and Common Block Bug

For those interested in logging UO connections in UniData...

http://www.nabble.com/UV-basic-assignment-error---to12606716.html#a12764018

This is very helpful.  HTH,

Bill


 Symeon Breen said the following on 10/9/2009 1:29 AM:
 This is very odd, uniobjects, uniobjects for java, and uniobjects.net are
 just client libraries that connect over a socket to the unirpcd process on
 the unidata host, which in turn runs and communicates with the backend udt
 process. I cannot imagine any of these libraries has an understanding of
 common. It is the backend udt process that handles and errors any of this.

 All i can think of is that the old uniobjects is somehow closing the
 session/udt process, in between the call to sub 1 and 2, whereas the .net
 library is keeping it open - it should keep it open if you are using the
 same unisession and not closing it between calls. - maybe you can check the
 backend udt process is the same for the old uniobjects one - perhaps also
 consider putting unirpcd into debug mode - it will log all messages for you
 - instructions are erm somewhere ...



 Rgds
 Symeon.

 -Original Message-
 From: u2-users-boun...@listserver.u2ug.org
 [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Adrian Halid
 Sent: 09 October 2009 06:24
 To: U2 Users List
 Subject: Re: [U2] UniObject .NET Session and Common Block Bug

 No connection pooling.

 Just the standard session.

 I am doing the same UniSession and UniSubroutine object setup and creation
 in .NET, VB6 and Java.

 It seems in .NET UniObjects doesn't clear unnamed commons between subroutine
 calls where in VB6 and Java UniObjects it does.

 Regards

 Adrian Halid
 Senior Analyst/Programmer
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] UniObject .NET Session and Common Block Bug

2009-10-11 Thread Hugh Yang

Maybe you could return something in SR.AHTEST.CALL1 and try to run
ahsub1.GetArg(1); before ahsub1.Dispose(); , so you can make sure the first
subroutine has been finished before you run the second one.



Adrian Halid wrote:
 
 Yeah I tried the Dispose method after the Call but no luck there either.
 
 
 
 Adrian Halid
 Senior Analyst/Programmer
  
 IT Vision Australia Pty Ltd (ABN: 34 309 336 904)
 PO Box 881, Canning Bridge WA 6153
 Level 3, Kirin Centre, 15 Ogilvie Road, Applecross, WA, 6153
 P:  (08) 9315 7000  F:  (08) 9315 7088
 E:  adrian.ha...@itvision.com.au    W: http://www.itvision.com.au
     
 ___  
   
 NOTICE : This e-mail and any attachments are intended for the addressee(s)
 only and may
 contain confidential or privileged material. Any unauthorised review, use,
 alteration,
 disclosure or distribution of this e-mail (including any attachments) by
 an unintended recipient
 is prohibited. If you are not the intended recipient please contact the
 sender as soon as
 possible by return e-mail and then delete both messages.
 ___
 
 
 -Original Message-
 From: u2-users-boun...@listserver.u2ug.org
 [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Hugh Yang
 Sent: Thursday, 8 October 2009 12:51 PM
 To: u2-users@listserver.u2ug.org
 Subject: Re: [U2] UniObject .NET Session and Common Block Bug
 
 
 Try ahsub1.Dispose(); after ahsub1.Call();
 
 Regards
 
 
 Adrian Halid wrote:
 
 Hi All,
 
 I am trying to call 2 subroutines using the same session in UniObject
 .NET
 but have an issue when the second subroutine Inserts a larger common
 block.
 
 I call the first subroutine without any issues. But when I call the
 second
 subroutine I get the following error.
 
 [IBM U2][UODOTNET - UNICLIENT][ErrorCode=30105] Unable to load the
 subroutine on the server
 
 I only have this issue in .NET and not in VB6.
 I believe that the .net UniSession is storing the Common Block variables
 and when I try to call another subroutine with a different common block
 it
 fails to load.
 
 I have read in another post on the web that people have created a Common
 Block loading subroutine to load all Common Blocks when they create the
 session.
 This way when ever they call any subroutine they know the common block
 does not increase.
 
 This seems a like a hack to me.
 
 I am worried that when ever a developer creates a new Common Block that
 they have to remember to update the Common Block loading Subroutine.
 Also we have thousands of Subroutines that may or may not include some
 common blocks.
 If a subroutine has the same variable name as a variable used in common
 block it does not insert will its value change.
 
 The other hack is to close and open the session every time I want to call
 a subroutine.
 But once again this is not suitable for my application.
 
 
 Here is my common blocks in universe
 - BP AH.COMMON1 ---
     COMMON AHCOMMON1
 
 
 - BP AH.COMMON2 ---
    COMMON AHCOMMON2
 
 
 Here are my two subroutines.
 - BP SR.AHTEST.CALL1
 -
   SUBROUTINE SR.AHTEST.CALL1
   $INSERT AH.COMMON1
   RETURN
 END
 
 
 - BP SR.AHTEST.CALL2
 -
   SUBROUTINE SR.AHTEST.CALL2
   $INSERT AH.COMMON1
   $INSERT AH.COMMON2
   RETURN
 END
 
 
 Here is the C# .net code
 - C# .NET
 
     UniSession ahsession = UniObjects.OpenSession(HOST,
 USERNAME, PASSWORD, ACCOUNT, uvcs);
 
 
     UniSubroutine ahsub1 =
 ahsession.CreateUniSubroutine(SR.AHTEST.CALL1, 0);
     ahsub1.Call(); // No Error on this call
 
     UniSubroutine ahsub2 =
 ahsession.CreateUniSubroutine(SR.AHTEST.CALL2, 0);
     try
     {
     ahsub2.Call(); // Throws and exception 
     }
     catch (UniSubroutineException ex)
     {
     MessageBox.Show(ex.Message); //Displays [ErrorCode=30105]
 Unable to load the subroutine on the server
 
     }
     MessageBox.Show(Done);
 
 
 If I write the same code in VB6 using the UniObject for VB6 I get no
 errors
 - C# .NET
 
 
     Dim objSession As Object
     Set objSession = CreateObject

Re: [U2] UniObject .NET Session and Common Block Bug

2009-10-09 Thread Symeon Breen
This is very odd, uniobjects, uniobjects for java, and uniobjects.net are
just client libraries that connect over a socket to the unirpcd process on
the unidata host, which in turn runs and communicates with the backend udt
process. I cannot imagine any of these libraries has an understanding of
common. It is the backend udt process that handles and errors any of this.

All i can think of is that the old uniobjects is somehow closing the
session/udt process, in between the call to sub 1 and 2, whereas the .net
library is keeping it open - it should keep it open if you are using the
same unisession and not closing it between calls. - maybe you can check the
backend udt process is the same for the old uniobjects one - perhaps also
consider putting unirpcd into debug mode - it will log all messages for you
- instructions are erm somewhere ...



Rgds
Symeon.

-Original Message-
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Adrian Halid
Sent: 09 October 2009 06:24
To: U2 Users List
Subject: Re: [U2] UniObject .NET Session and Common Block Bug

No connection pooling.

Just the standard session.

I am doing the same UniSession and UniSubroutine object setup and creation
in .NET, VB6 and Java.

It seems in .NET UniObjects doesn't clear unnamed commons between subroutine
calls where in VB6 and Java UniObjects it does.

Regards

Adrian Halid
Senior Analyst/Programmer
 
IT Vision Australia Pty Ltd (ABN: 34 309 336 904)
PO Box 881, Canning Bridge WA 6153
Level 3, Kirin Centre, 15 Ogilvie Road, Applecross, WA, 6153
P:  (08) 9315 7000  F:  (08) 9315 7088
E:  adrian.ha...@itvision.com.au    W: http://www.itvision.com.au
    
___  
  
NOTICE : This e-mail and any attachments are intended for the addressee(s)
only and may
contain confidential or privileged material. Any unauthorised review, use,
alteration,
disclosure or distribution of this e-mail (including any attachments) by an
unintended recipient
is prohibited. If you are not the intended recipient please contact the
sender as soon as
possible by return e-mail and then delete both messages.
___


-Original Message-
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of ozemail
Sent: Friday, 9 October 2009 12:46 PM
To: 'U2 Users List'
Subject: Re: [U2] UniObject .NET Session and Common Block Bug

Hi Adrian

If you are using connection pooling, I believe the session would not drop.  

Regards

David Jordan

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] UniObject .NET Session and Common Block Bug

2009-10-09 Thread Bill Haskett

For those interested in logging UO connections in UniData...

http://www.nabble.com/UV-basic-assignment-error---to12606716.html#a12764018

This is very helpful.  HTH,

Bill



Symeon Breen said the following on 10/9/2009 1:29 AM:

This is very odd, uniobjects, uniobjects for java, and uniobjects.net are
just client libraries that connect over a socket to the unirpcd process on
the unidata host, which in turn runs and communicates with the backend udt
process. I cannot imagine any of these libraries has an understanding of
common. It is the backend udt process that handles and errors any of this.

All i can think of is that the old uniobjects is somehow closing the
session/udt process, in between the call to sub 1 and 2, whereas the .net
library is keeping it open - it should keep it open if you are using the
same unisession and not closing it between calls. - maybe you can check the
backend udt process is the same for the old uniobjects one - perhaps also
consider putting unirpcd into debug mode - it will log all messages for you
- instructions are erm somewhere ...



Rgds
Symeon.

-Original Message-
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Adrian Halid
Sent: 09 October 2009 06:24
To: U2 Users List
Subject: Re: [U2] UniObject .NET Session and Common Block Bug

No connection pooling.

Just the standard session.

I am doing the same UniSession and UniSubroutine object setup and creation
in .NET, VB6 and Java.

It seems in .NET UniObjects doesn't clear unnamed commons between subroutine
calls where in VB6 and Java UniObjects it does.

Regards

Adrian Halid
Senior Analyst/Programmer

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] UniObject .NET Session and Common Block Bug

2009-10-08 Thread Womack, Adrian

The common blocks you've shown are not named - maybe that's your
problem. 

Try naming them (i.e. adding a unique slash-delimited name between the
word COMMON and the variable name(s).

eg. 

COMMON /AHC1/ AHCOMMON1

COMMON /AHC2/ AHCOMMON2

That way there won't be any conflict between the two blocks. 

We use named common extensively and it is mostly lazy loaded i.e. only
loaded the first time it's required, and we don't have any problems.


-Original Message-
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Adrian Halid
Sent: Thursday, 8 October 2009 11:07 AM
To: u2-users@listserver.u2ug.org
Subject: [U2] UniObject .NET Session and Common Block Bug

snip
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


DISCLAIMER:
Disclaimer.  This e-mail is private and confidential. If you are not the 
intended recipient, please advise us by return e-mail immediately, and delete 
the e-mail and any attachments without using or disclosing the contents in any 
way. The views expressed in this e-mail are those of the author, and do not 
represent those of this company unless this is clearly indicated. You should 
scan this e-mail and any attachments for viruses. This company accepts no 
liability for any direct or indirect damage or loss resulting from the use of 
any attachments to this e-mail.
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] UniObject .NET Session and Common Block Bug

2009-10-08 Thread Hona, David
Hi Adrian 

I've never seen this particular issue before. What release of UniVerse or 
UniData is this (likewise the clients too)? What OS/platform is your U2 
installation on?

I would suggest some of the following to assist you in drill down the root 
cause:

a) Execute a DIVERT.OUT or COMO ON (or call !COMO) to capture the host 
sessions standard output  errors. Sometimes you can see the actual error in 
your output file (if there is any additional errors output)

b) Check the VOC entries for the subroutines you're calling

c) Call the subroutines as globally catalogued subroutines (CATALOG BP 
*MYSUB).. see if there is a difference

Regards,
David


** IMPORTANT MESSAGE *   
This e-mail message is intended only for the addressee(s) and contains 
information which may be
confidential. 
If you are not the intended recipient please advise the sender by return email, 
do not use or
disclose the contents, and delete the message and any attachments from your 
system. Unless
specifically indicated, this email does not constitute formal advice or 
commitment by the sender
or the Commonwealth Bank of Australia (ABN 48 123 123 124) or its subsidiaries. 
We can be contacted through our web site: commbank.com.au. 
If you no longer wish to receive commercial electronic messages from us, please 
reply to this
e-mail by typing Unsubscribe in the subject line. 
**



___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] UniObject .NET Session and Common Block Bug

2009-10-08 Thread Adrian Halid
Thanks for the help.

It seems once you name your common block you do not get the error anymore.

Just having a read of the documentation about the common statement in the 
documentation.

A common area can be either named or unnamed. An unnamed common area is
lost when the program completes its execution and control returns to the 
UniVerse
command level. A named common area remains available for as long as the user
remains in the UniVerse environment.

From what it says I should be able to have them unnamed and loose it between 
subroutine calls.

Regards


Adrian Halid
Senior Analyst/Programmer
 
IT Vision Australia Pty Ltd (ABN: 34 309 336 904)
PO Box 881, Canning Bridge WA 6153
Level 3, Kirin Centre, 15 Ogilvie Road, Applecross, WA, 6153
P:  (08) 9315 7000  F:  (08) 9315 7088
E:  adrian.ha...@itvision.com.au    W: http://www.itvision.com.au
    
___  
  
NOTICE : This e-mail and any attachments are intended for the addressee(s) only 
and may
contain confidential or privileged material. Any unauthorised review, use, 
alteration,
disclosure or distribution of this e-mail (including any attachments) by an 
unintended recipient
is prohibited. If you are not the intended recipient please contact the sender 
as soon as
possible by return e-mail and then delete both messages.
___


-Original Message-
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Womack, Adrian
Sent: Thursday, 8 October 2009 2:19 PM
To: U2 Users List
Subject: Re: [U2] UniObject .NET Session and Common Block Bug


The common blocks you've shown are not named - maybe that's your
problem. 

Try naming them (i.e. adding a unique slash-delimited name between the
word COMMON and the variable name(s).

eg. 

COMMON /AHC1/ AHCOMMON1

COMMON /AHC2/ AHCOMMON2

That way there won't be any conflict between the two blocks. 

We use named common extensively and it is mostly lazy loaded i.e. only
loaded the first time it's required, and we don't have any problems.


-Original Message-
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Adrian Halid
Sent: Thursday, 8 October 2009 11:07 AM
To: u2-users@listserver.u2ug.org
Subject: [U2] UniObject .NET Session and Common Block Bug

snip
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


DISCLAIMER:
Disclaimer.  This e-mail is private and confidential. If you are not the 
intended recipient, please advise us by return e-mail immediately, and delete 
the e-mail and any attachments without using or disclosing the contents in any 
way. The views expressed in this e-mail are those of the author, and do not 
represent those of this company unless this is clearly indicated. You should 
scan this e-mail and any attachments for viruses. This company accepts no 
liability for any direct or indirect damage or loss resulting from the use of 
any attachments to this e-mail.
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] UniObject .NET Session and Common Block Bug

2009-10-08 Thread Adrian Halid
Yeah I tried the Dispose method after the Call but no luck there either.



Adrian Halid
Senior Analyst/Programmer
 
IT Vision Australia Pty Ltd (ABN: 34 309 336 904)
PO Box 881, Canning Bridge WA 6153
Level 3, Kirin Centre, 15 Ogilvie Road, Applecross, WA, 6153
P:  (08) 9315 7000  F:  (08) 9315 7088
E:  adrian.ha...@itvision.com.au    W: http://www.itvision.com.au
    
___  
  
NOTICE : This e-mail and any attachments are intended for the addressee(s) only 
and may
contain confidential or privileged material. Any unauthorised review, use, 
alteration,
disclosure or distribution of this e-mail (including any attachments) by an 
unintended recipient
is prohibited. If you are not the intended recipient please contact the sender 
as soon as
possible by return e-mail and then delete both messages.
___


-Original Message-
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Hugh Yang
Sent: Thursday, 8 October 2009 12:51 PM
To: u2-users@listserver.u2ug.org
Subject: Re: [U2] UniObject .NET Session and Common Block Bug


Try ahsub1.Dispose(); after ahsub1.Call();

Regards


Adrian Halid wrote:
 
 Hi All,
 
 I am trying to call 2 subroutines using the same session in UniObject .NET
 but have an issue when the second subroutine Inserts a larger common
 block.
 
 I call the first subroutine without any issues. But when I call the second
 subroutine I get the following error.
 
 [IBM U2][UODOTNET - UNICLIENT][ErrorCode=30105] Unable to load the
 subroutine on the server
 
 I only have this issue in .NET and not in VB6.
 I believe that the .net UniSession is storing the Common Block variables
 and when I try to call another subroutine with a different common block it
 fails to load.
 
 I have read in another post on the web that people have created a Common
 Block loading subroutine to load all Common Blocks when they create the
 session.
 This way when ever they call any subroutine they know the common block
 does not increase.
 
 This seems a like a hack to me.
 
 I am worried that when ever a developer creates a new Common Block that
 they have to remember to update the Common Block loading Subroutine.
 Also we have thousands of Subroutines that may or may not include some
 common blocks.
 If a subroutine has the same variable name as a variable used in common
 block it does not insert will its value change.
 
 The other hack is to close and open the session every time I want to call
 a subroutine.
 But once again this is not suitable for my application.
 
 
 Here is my common blocks in universe
 - BP AH.COMMON1 ---
     COMMON AHCOMMON1
 
 
 - BP AH.COMMON2 ---
    COMMON AHCOMMON2
 
 
 Here are my two subroutines.
 - BP SR.AHTEST.CALL1 -
   SUBROUTINE SR.AHTEST.CALL1
   $INSERT AH.COMMON1
   RETURN
 END
 
 
 - BP SR.AHTEST.CALL2 -
   SUBROUTINE SR.AHTEST.CALL2
   $INSERT AH.COMMON1
   $INSERT AH.COMMON2
   RETURN
 END
 
 
 Here is the C# .net code
 - C# .NET
 
     UniSession ahsession = UniObjects.OpenSession(HOST,
 USERNAME, PASSWORD, ACCOUNT, uvcs);
 
 
     UniSubroutine ahsub1 =
 ahsession.CreateUniSubroutine(SR.AHTEST.CALL1, 0);
     ahsub1.Call(); // No Error on this call
 
     UniSubroutine ahsub2 =
 ahsession.CreateUniSubroutine(SR.AHTEST.CALL2, 0);
     try
     {
     ahsub2.Call(); // Throws and exception 
     }
     catch (UniSubroutineException ex)
     {
     MessageBox.Show(ex.Message); //Displays [ErrorCode=30105]
 Unable to load the subroutine on the server
 
     }
     MessageBox.Show(Done);
 
 
 If I write the same code in VB6 using the UniObject for VB6 I get no
 errors
 - C# .NET
 
 
     Dim objSession As Object
     Set objSession = CreateObject(UniObjects.unioaifctrl)
     objSession.UserName = USERNAME
     objSession.Password = PASSWORD
     objSession.AccountPath = ACCOUNT
     objSession.HostName = HOST
      objSession.Connect
     
     Dim ahsub1 As Object
     Set ahsub1 = objSession.Subroutine

Re: [U2] UniObject .NET Session and Common Block Bug

2009-10-08 Thread Adrian Halid
Yeah I have compiled all my subroutines after creating the Commons.

Like I said.. No issues when I make the calls using VB6 UniObjects.
But an issue when I use the UniObjects .NET

The error that is returned is 

[IBM U2][UODOTNET - UNICLIENT][ErrorCode=30105] Unable to load the subroutine 
on the server

SR.AHTEST.CALL1 only inserts AH.COMMON1

And

SR.AHTEST.CALL2 inserts AH.COMMON1 and AH.COMMON2


I assume it is an issue with the common block cause if I comment out $INSERT 
AH.COMMON2 in the SR.AHTEST.CALL2 subroutine I don't get any errors in 
UniObjects .NET.

Examples of this working in VB6 and throwing an exception in .NET can be 
downloaded from

http://www.mediafire.com/?sharekey=dfc3c5e4b0702c4d2fb2ca15d7ea42d9e04e75f6e8ebb871

The subroutines have been included as text files.




Adrian Halid
Senior Analyst/Programmer
 
IT Vision Australia Pty Ltd (ABN: 34 309 336 904)
PO Box 881, Canning Bridge WA 6153
Level 3, Kirin Centre, 15 Ogilvie Road, Applecross, WA, 6153
P:  (08) 9315 7000  F:  (08) 9315 7088
E:  adrian.ha...@itvision.com.au    W: http://www.itvision.com.au
    
___  
  
NOTICE : This e-mail and any attachments are intended for the addressee(s) only 
and may
contain confidential or privileged material. Any unauthorised review, use, 
alteration,
disclosure or distribution of this e-mail (including any attachments) by an 
unintended recipient
is prohibited. If you are not the intended recipient please contact the sender 
as soon as
possible by return e-mail and then delete both messages.
___


-Original Message-
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of ozemail
Sent: Thursday, 8 October 2009 12:40 PM
To: 'U2 Users List'
Subject: Re: [U2] UniObject .NET Session and Common Block Bug

Hi Adrian

I don't have problem with named commons.  There is a problem if you update
the parameters in a named common and you do not compile all the subroutines
with the named common.  If you call a routine that has not been recompiled
you get a fatal, named common mismatch.  Is that a possible issue for you.
This is a general basic issue and is not an issue with .Net API.  

Regards

David Jordan

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] UniObject .NET Session and Common Block Bug

2009-10-08 Thread Anthony W. Youngman
In message 
13e4ae055d203648a4121114f2458c8c7a4adb8...@tefnut.perth.itvision.com.au

, Adrian Halid adrian.ha...@itvision.com.au writes

Thanks for the help.

It seems once you name your common block you do not get the error anymore.


I don't think that's the problem ...


Just having a read of the documentation about the common statement in 
the documentation.


A common area can be either named or unnamed. An unnamed common area is
lost when the program completes its execution and control returns to 
the UniVerse

command level. A named common area remains available for as long as the user
remains in the UniVerse environment.

From what it says I should be able to have them unnamed and loose it 
between subroutine calls.


That may well depend on your emulation. AIUI, unnamed common persists 
for as long as a program runs. It's returning to TCL that clears unnamed 
common (as I say, AIUI, I've never used unnamed common).


Named common persists until you log out. And I've had several obscure 
bugs where something tries to changed the size of common - that's not 
allowed.


So if subroutine A effectively contains COMMON A,B,C while subroutine 
B effectively contains COMMON A,B,C,D,E,F then running them in the 
same execution environment *will* cause a crash because B has tried to 
redefine common.


Regards


Adrian Halid
Senior Analyst/Programmer
 

Cheers,
Wol
--
Anthony W. Youngman pi...@thewolery.demon.co.uk
'Yings, yow graley yin! Suz ae rikt dheu,' said the blue man, taking the
thimble. 'What *is* he?' said Magrat. 'They're gnomes,' said Nanny. The man
lowered the thimble. 'Pictsies!' Carpe Jugulum, Terry Pratchett 1998
Visit the MaVerick web-site - http://www.maverick-dbms.org Open Source Pick
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] UniObject .NET Session and Common Block Bug

2009-10-08 Thread John Woollam
Hi All

Within an execution environment, all subroutines using a given common name, 
including unnamed common, must have each common the same size as every other 
subroutine in the same environment, otherwise you get a COMMON SIZE MISMATCH 
ERROR.

That is why, when you have 2 includes containing unnamed common, and include 
one in one subroutine and both in another, you get the common size mismatch 
error.

In short, put all your unnamed common in one include only and your problems 
will go away

Regards

John Woollam  |  Group Financial Systems  |  Travis Perkins PLC  |  01604 682751

-Original Message-
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Anthony W. Youngman
Sent: 08 October 2009 16:51
To: u2-users@listserver.u2ug.org
Subject: Re: [U2] UniObject .NET Session and Common Block Bug

In message 
13e4ae055d203648a4121114f2458c8c7a4adb8...@tefnut.perth.itvision.com.au
, Adrian Halid adrian.ha...@itvision.com.au writes
Thanks for the help.

It seems once you name your common block you do not get the error anymore.

I don't think that's the problem ...

Just having a read of the documentation about the common statement in 
the documentation.

A common area can be either named or unnamed. An unnamed common area is
lost when the program completes its execution and control returns to 
the UniVerse
command level. A named common area remains available for as long as the user
remains in the UniVerse environment.

From what it says I should be able to have them unnamed and loose it 
between subroutine calls.

That may well depend on your emulation. AIUI, unnamed common persists 
for as long as a program runs. It's returning to TCL that clears unnamed 
common (as I say, AIUI, I've never used unnamed common).

Named common persists until you log out. And I've had several obscure 
bugs where something tries to changed the size of common - that's not 
allowed.

So if subroutine A effectively contains COMMON A,B,C while subroutine 
B effectively contains COMMON A,B,C,D,E,F then running them in the 
same execution environment *will* cause a crash because B has tried to 
redefine common.

Regards


Adrian Halid
Senior Analyst/Programmer
 
Cheers,
Wol
-- 
Anthony W. Youngman pi...@thewolery.demon.co.uk
'Yings, yow graley yin! Suz ae rikt dheu,' said the blue man, taking the
thimble. 'What *is* he?' said Magrat. 'They're gnomes,' said Nanny. The man
lowered the thimble. 'Pictsies!' Carpe Jugulum, Terry Pratchett 1998
Visit the MaVerick web-site - http://www.maverick-dbms.org Open Source Pick
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

html
head
meta http-equiv=Content-type content=text/html; charset=UTF-8
/head
body
P style=MARGIN-TOP: 0pt; MARGIN-BOTTOM: 0ptSPAN 
style=FONT-SIZE: 8.2pt; FONT-FAMILY: 'MS Sans Serif'This e-mail and any 
attachments are confidential and intended solely for the use of the addressee 
only. If you have received this message in error, you must not copy, distribute 
or disclose the contents; please notify the sender immediately and delete the 
message. /SPAN/P
P style=MARGIN-TOP: 0pt; MARGIN-BOTTOM: 0ptSPAN 
style=FONT-SIZE: 8.2pt; FONT-FAMILY: 'MS Sans Serif'This message is 
attributed to the sender and may not necessarily reflect the view of Travis 
Perkins plc or its subsidiaries (Travis Perkins). Agreements binding Travis 
Perkins may not be concluded by means of e-mail communication. /SPAN/P
P style=MARGIN-TOP: 0pt; MARGIN-BOTTOM: 0ptSPAN 
style=FONT-SIZE: 8.2pt; FONT-FAMILY: 'MS Sans Serif'E-mail transmissions are 
not secure and Travis Perkins accepts no responsibility for changes made to 
this 
message after it was sent. Whilst steps have been taken to ensure that this 
message is virus free, Travis Perkins accepts no liability for infection and 
recommends that you scan this e-mail and any attachments. /SPAN/P
P style=MARGIN-TOP: 0pt; MARGIN-BOTTOM: 0ptSPAN 
style=FONT-SIZE: 8.2pt; FONT-FAMILY: 'MS Sans Serif'Part of Travis Perkins 
plc. Registered Office: Lodge Way House, Lodge Way, Harlestone Road, 
Northampton, NN5 7UG. /SPAN/P
/BODY
/HTML

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] UniObject .NET Session and Common Block Bug

2009-10-08 Thread Bill Haskett

Adrian:

An unnamed common is not lost between subroutine calls.  It is only 
lost when a program (not a subroutine) completes execution.  So, If I 
run PROGRAM1, set unnamed common within it, then call SUBROUTINE1, 
then call SUBROUTINE2, unnamed common is kept until PROGRAM1 completes 
execution, even though SUBROUTINE2 completed execution then SUBROUTINE1 
completed execution.


This is where you have to be careful with non-telnet connectivity.  
Sometimes, a product has a BASIC subroutine listening at the U2 end then 
CALLS the subroutines specified.  In this case, the use of all common 
has to be thought about.


Bill


Adrian Halid said the following on 10/7/2009 11:36 PM:

Thanks for the help.

It seems once you name your common block you do not get the error anymore.

Just having a read of the documentation about the common statement in the 
documentation.

A common area can be either named or unnamed. An unnamed common area is
lost when the program completes its execution and control returns to the 
UniVerse
command level. A named common area remains available for as long as the user
remains in the UniVerse environment.

From what it says I should be able to have them unnamed and loose it between 
subroutine calls.

Regards


Adrian Halid
Senior Analyst/Programmer
 
IT Vision Australia Pty Ltd (ABN: 34 309 336 904)

PO Box 881, Canning Bridge WA 6153
Level 3, Kirin Centre, 15 Ogilvie Road, Applecross, WA, 6153
P:  (08) 9315 7000  F:  (08) 9315 7088
E:  adrian.ha...@itvision.com.auW: http://www.itvision.com.au

___  
  
NOTICE : This e-mail and any attachments are intended for the addressee(s) only and may

contain confidential or privileged material. Any unauthorised review, use, 
alteration,
disclosure or distribution of this e-mail (including any attachments) by an 
unintended recipient
is prohibited. If you are not the intended recipient please contact the sender 
as soon as
possible by return e-mail and then delete both messages.
___


-Original Message-
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Womack, Adrian
Sent: Thursday, 8 October 2009 2:19 PM
To: U2 Users List
Subject: Re: [U2] UniObject .NET Session and Common Block Bug


The common blocks you've shown are not named - maybe that's your
problem. 


Try naming them (i.e. adding a unique slash-delimited name between the
word COMMON and the variable name(s).

eg. 


COMMON /AHC1/ AHCOMMON1

COMMON /AHC2/ AHCOMMON2

That way there won't be any conflict between the two blocks. 


We use named common extensively and it is mostly lazy loaded i.e. only
loaded the first time it's required, and we don't have any problems.


-Original Message-
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Adrian Halid
Sent: Thursday, 8 October 2009 11:07 AM
To: u2-users@listserver.u2ug.org
Subject: [U2] UniObject .NET Session and Common Block Bug

snip
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


DISCLAIMER:
Disclaimer.  This e-mail is private and confidential. If you are not the 
intended recipient, please advise us by return e-mail immediately, and delete 
the e-mail and any attachments without using or disclosing the contents in any 
way. The views expressed in this e-mail are those of the author, and do not 
represent those of this company unless this is clearly indicated. You should 
scan this e-mail and any attachments for viruses. This company accepts no 
liability for any direct or indirect damage or loss resulting from the use of 
any attachments to this e-mail.
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users
  

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] UniObject .NET Session and Common Block Bug

2009-10-08 Thread Bill Haskett
Be careful with named common names in UniData.  They're restricted to 
seven characters, maximum, in the name.


Bill


Womack, Adrian said the following on 10/7/2009 11:18 PM:

The common blocks you've shown are not named - maybe that's your
problem. 


Try naming them (i.e. adding a unique slash-delimited name between the
word COMMON and the variable name(s).

eg. 


COMMON /AHC1/ AHCOMMON1

COMMON /AHC2/ AHCOMMON2

That way there won't be any conflict between the two blocks. 


We use named common extensively and it is mostly lazy loaded i.e. only
loaded the first time it's required, and we don't have any problems.


-Original Message-
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Adrian Halid
Sent: Thursday, 8 October 2009 11:07 AM
To: u2-users@listserver.u2ug.org
Subject: [U2] UniObject .NET Session and Common Block Bug

snip
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


DISCLAIMER:
Disclaimer.  This e-mail is private and confidential. If you are not the 
intended recipient, please advise us by return e-mail immediately, and delete 
the e-mail and any attachments without using or disclosing the contents in any 
way. The views expressed in this e-mail are those of the author, and do not 
represent those of this company unless this is clearly indicated. You should 
scan this e-mail and any attachments for viruses. This company accepts no 
liability for any direct or indirect damage or loss resulting from the use of 
any attachments to this e-mail.
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users
  

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] UniObject .NET Session and Common Block Bug

2009-10-08 Thread Adrian Halid
Thanks everyone for you support.

I understand that the issue in .net is caused by trying to resize the common 
block and will look at putting all unnamed commons into one include or name all 
my commons.

The bit that I still don't understand is why I don't have an exception in 
UniObject VB6. But do have an exception in UniObject .NET.

Is this a feature/bug of UniObject VB6 that it clears out the Common Block?

In the VB6 code you are still creating the Subroutine object from the same 
session.

So shouldn't the 2nd subroutine call fail to load as well in VB6 just like it 
does in .net?

I ask this because I am looking converting our existing VB6 app into a .NET app.

We have thousands of Subroutines that insert different common blocks but never 
had this issue when calling consecutive subroutines via VB6 code all within the 
same session.

So before I go naming all my unnamed commons I want to be sure I understand 
exactly what it does as it will effect these thousands of Subroutines.

Regards


Adrian Halid
Senior Analyst/Programmer
 
IT Vision Australia Pty Ltd (ABN: 34 309 336 904)
PO Box 881, Canning Bridge WA 6153
Level 3, Kirin Centre, 15 Ogilvie Road, Applecross, WA, 6153
P:  (08) 9315 7000  F:  (08) 9315 7088
E:  adrian.ha...@itvision.com.au    W: http://www.itvision.com.au
    
___  
  
NOTICE : This e-mail and any attachments are intended for the addressee(s) only 
and may
contain confidential or privileged material. Any unauthorised review, use, 
alteration,
disclosure or distribution of this e-mail (including any attachments) by an 
unintended recipient
is prohibited. If you are not the intended recipient please contact the sender 
as soon as
possible by return e-mail and then delete both messages.
___


-Original Message-
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Bill Haskett
Sent: Friday, 9 October 2009 12:26 AM
To: U2 Users List
Subject: Re: [U2] UniObject .NET Session and Common Block Bug

Adrian:

An unnamed common is not lost between subroutine calls.  It is only 
lost when a program (not a subroutine) completes execution.  So, If I 
run PROGRAM1, set unnamed common within it, then call SUBROUTINE1, 
then call SUBROUTINE2, unnamed common is kept until PROGRAM1 completes 
execution, even though SUBROUTINE2 completed execution then SUBROUTINE1 
completed execution.

This is where you have to be careful with non-telnet connectivity.  
Sometimes, a product has a BASIC subroutine listening at the U2 end then 
CALLS the subroutines specified.  In this case, the use of all common 
has to be thought about.

Bill


Adrian Halid said the following on 10/7/2009 11:36 PM:
 Thanks for the help.

 It seems once you name your common block you do not get the error anymore.

 Just having a read of the documentation about the common statement in the 
 documentation.

 A common area can be either named or unnamed. An unnamed common area is
 lost when the program completes its execution and control returns to the 
 UniVerse
 command level. A named common area remains available for as long as the user
 remains in the UniVerse environment.

 From what it says I should be able to have them unnamed and loose it between 
 subroutine calls.

 Regards


 Adrian Halid
 Senior Analyst/Programmer
  
 IT Vision Australia Pty Ltd (ABN: 34 309 336 904)
 PO Box 881, Canning Bridge WA 6153
 Level 3, Kirin Centre, 15 Ogilvie Road, Applecross, WA, 6153
 P:  (08) 9315 7000  F:  (08) 9315 7088
 E:  adrian.ha...@itvision.com.auW: http://www.itvision.com.au
 
 ___  
   
 NOTICE : This e-mail and any attachments are intended for the addressee(s) 
 only and may
 contain confidential or privileged material. Any unauthorised review, use, 
 alteration,
 disclosure or distribution of this e-mail (including any attachments) by an 
 unintended recipient
 is prohibited. If you are not the intended recipient please contact the 
 sender as soon as
 possible by return e-mail and then delete both messages.
 ___


 -Original Message-
 From: u2-users-boun...@listserver.u2ug.org 
 [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Womack, Adrian
 Sent: Thursday, 8 October 2009 2:19 PM
 To: U2 Users List
 Subject: Re: [U2] UniObject .NET Session and Common Block Bug


 The common blocks you've shown are not named - maybe that's your
 problem. 

 Try naming them (i.e. adding a unique slash-delimited name between the
 word COMMON and the variable name(s).

 eg. 

 COMMON /AHC1/ AHCOMMON1
 
 COMMON /AHC2/ AHCOMMON2

 That way there won't be any conflict between the two blocks. 

 We use named common

Re: [U2] UniObject .NET Session and Common Block Bug

2009-10-08 Thread Adrian Halid
Just an update with common blocks.

What I am doing is calling two different subroutines with the same UniSession.

The first Subroutine inserts 1 common variable to the common block.
The second Subroutine inserts 2 common variables to the common block.

I am calling these subroutines consecutively and not nested.

This means that after each subroutine call the common area should be lost and 
therefore I should not get a common miss match exception.

From UniVerse BASIC Reference
A common area can be either named or unnamed. An unnamed common area is
lost when the program completes its execution and control returns to the 
UniVerse
command level. A named common area remains available for as long as the user
remains in the UniVerse environment.

I decided to compare the difference between UniObject .NET, VB6 and Java.

The results are as follows.

UniObjects VB6 and Java 
Can use the same session to call subroutines consecutively.
The common block is cleared after each subroutine call.

UniObjects .NET
Can NOT use the same session to call subroutines consecutively.
The common block is not cleared after each subroutine call. Causing the second 
subroutine to not load and throw and exception.

This to me sounds like a bug in the .NET implementation of UniObjects.

Example code for .NET, VB6 and Java can be found via the link below.

http://www.mediafire.com/?sharekey=dfc3c5e4b0702c4d2fb2ca15d7ea42d9e04e75f6e8ebb871

Subroutines
SR.AHTEST.CALL1-
  SUBROUTINE SR.AHTEST.CALL1
  COMMON AH1
  RETURN
END


SR.AHTEST.CALL2-
  SUBROUTINE SR.AHTEST.CALL2
  COMMON AH1, AH2
  RETURN
END




Below is the same example in Java

import asjava.uniobjects.*;

public class test
{
public static void main(String [ ] args)
{
System.out.println(Start);
try{
UniJava objUJ;
objUJ = new UniJava();


UniSession ahsession = objUJ.openSession();
ahsession.setHostName(HOST);
ahsession.setUserName(USERNAME);
ahsession.setPassword(PASSWORD);
ahsession.setAccountPath(ACCOUNT);

ahsession.connect();

UniSubroutine ahsub1 = 
ahsession.subroutine(SR.AHTEST.CALL1, 0);
ahsub1.call();

UniSubroutine ahsub2 = 
ahsession.subroutine(SR.AHTEST.CALL1, 0);
ahsub2.call();

}catch(Exception e){
System.out.println(e.toString());
}

System.out.println(End);
}
}


Adrian Halid
Senior Analyst/Programmer
 
IT Vision Australia Pty Ltd (ABN: 34 309 336 904)
PO Box 881, Canning Bridge WA 6153
Level 3, Kirin Centre, 15 Ogilvie Road, Applecross, WA, 6153
P:  (08) 9315 7000  F:  (08) 9315 7088
E:  adrian.ha...@itvision.com.au    W: http://www.itvision.com.au
    
___  
  
NOTICE : This e-mail and any attachments are intended for the addressee(s) only 
and may
contain confidential or privileged material. Any unauthorised review, use, 
alteration,
disclosure or distribution of this e-mail (including any attachments) by an 
unintended recipient
is prohibited. If you are not the intended recipient please contact the sender 
as soon as
possible by return e-mail and then delete both messages.
___

-Original Message-
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Adrian Halid
Sent: Friday, 9 October 2009 8:35 AM
To: U2 Users List
Subject: Re: [U2] UniObject .NET Session and Common Block Bug

Thanks everyone for you support.

I understand that the issue in .net is caused by trying to resize the common 
block and will look at putting all unnamed commons into one include or name all 
my commons.

The bit that I still don't understand is why I don't have an exception in 
UniObject VB6. But do have an exception in UniObject .NET.

Is this a feature/bug of UniObject VB6 that it clears out the Common Block?

In the VB6 code you are still creating the Subroutine object from the same 
session.

So shouldn't the 2nd subroutine call fail to load as well in VB6 just like it 
does in .net?

I ask this because I am looking converting our existing VB6 app into a .NET app.

We have thousands of Subroutines that insert different common blocks but never 
had this issue when calling consecutive subroutines via VB6 code all within the 
same session.

So before I go naming all my unnamed commons I want to be sure I understand 
exactly what it does as it will effect these thousands

Re: [U2] UniObject .NET Session and Common Block Bug

2009-10-08 Thread ozemail
Hi Adrian

If you are using connection pooling, I believe the session would not drop.  

Regards

David Jordan

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] UniObject .NET Session and Common Block Bug

2009-10-08 Thread Adrian Halid
No connection pooling.

Just the standard session.

I am doing the same UniSession and UniSubroutine object setup and creation in 
.NET, VB6 and Java.

It seems in .NET UniObjects doesn't clear unnamed commons between subroutine 
calls where in VB6 and Java UniObjects it does.

Regards

Adrian Halid
Senior Analyst/Programmer
 
IT Vision Australia Pty Ltd (ABN: 34 309 336 904)
PO Box 881, Canning Bridge WA 6153
Level 3, Kirin Centre, 15 Ogilvie Road, Applecross, WA, 6153
P:  (08) 9315 7000  F:  (08) 9315 7088
E:  adrian.ha...@itvision.com.au    W: http://www.itvision.com.au
    
___  
  
NOTICE : This e-mail and any attachments are intended for the addressee(s) only 
and may
contain confidential or privileged material. Any unauthorised review, use, 
alteration,
disclosure or distribution of this e-mail (including any attachments) by an 
unintended recipient
is prohibited. If you are not the intended recipient please contact the sender 
as soon as
possible by return e-mail and then delete both messages.
___


-Original Message-
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of ozemail
Sent: Friday, 9 October 2009 12:46 PM
To: 'U2 Users List'
Subject: Re: [U2] UniObject .NET Session and Common Block Bug

Hi Adrian

If you are using connection pooling, I believe the session would not drop.  

Regards

David Jordan

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


[U2] UniObject .NET Session and Common Block Bug

2009-10-07 Thread Adrian Halid
Hi All,

I am trying to call 2 subroutines using the same session in UniObject .NET but 
have an issue when the second subroutine Inserts a larger common block.

I call the first subroutine without any issues. But when I call the second 
subroutine I get the following error.

[IBM U2][UODOTNET - UNICLIENT][ErrorCode=30105] Unable to load the subroutine 
on the server

I only have this issue in .NET and not in VB6.
I believe that the .net UniSession is storing the Common Block variables and 
when I try to call another subroutine with a different common block it fails to 
load.

I have read in another post on the web that people have created a Common Block 
loading subroutine to load all Common Blocks when they create the session.
This way when ever they call any subroutine they know the common block does not 
increase.

This seems a like a hack to me.

I am worried that when ever a developer creates a new Common Block that they 
have to remember to update the Common Block loading Subroutine.
Also we have thousands of Subroutines that may or may not include some common 
blocks.
If a subroutine has the same variable name as a variable used in common block 
it does not insert will its value change.

The other hack is to close and open the session every time I want to call a 
subroutine.
But once again this is not suitable for my application.


Here is my common blocks in universe
- BP AH.COMMON1 ---
    COMMON AHCOMMON1


- BP AH.COMMON2 ---
   COMMON AHCOMMON2


Here are my two subroutines.
- BP SR.AHTEST.CALL1 -
  SUBROUTINE SR.AHTEST.CALL1
  $INSERT AH.COMMON1
  RETURN
END


- BP SR.AHTEST.CALL2 -
  SUBROUTINE SR.AHTEST.CALL2
  $INSERT AH.COMMON1
  $INSERT AH.COMMON2
  RETURN
END


Here is the C# .net code
- C# .NET 
    UniSession ahsession = UniObjects.OpenSession(HOST, USERNAME, 
PASSWORD, ACCOUNT, uvcs);


    UniSubroutine ahsub1 = 
ahsession.CreateUniSubroutine(SR.AHTEST.CALL1, 0);
    ahsub1.Call(); // No Error on this call

    UniSubroutine ahsub2 = 
ahsession.CreateUniSubroutine(SR.AHTEST.CALL2, 0);
    try
    {
    ahsub2.Call(); // Throws and exception 
    }
    catch (UniSubroutineException ex)
    {
    MessageBox.Show(ex.Message); //Displays [ErrorCode=30105] 
Unable to load the subroutine on the server

    }
    MessageBox.Show(Done);


If I write the same code in VB6 using the UniObject for VB6 I get no errors
- C# .NET 

    Dim objSession As Object
    Set objSession = CreateObject(UniObjects.unioaifctrl)
    objSession.UserName = USERNAME
    objSession.Password = PASSWORD
    objSession.AccountPath = ACCOUNT
    objSession.HostName = HOST
     objSession.Connect
    
    Dim ahsub1 As Object
    Set ahsub1 = objSession.Subroutine(SR.AHTEST.CALL1, 0)
    ahsub1.Call
 
    Dim ahsub2 As Object
    Set ahsub2 = objSession.Subroutine(SR.AHTEST.CALL2, 0)
    ahsub2.Call
 
    MsgBox (Done)




Adrian Halid
Senior Analyst/Programmer
 
IT Vision Australia Pty Ltd (ABN: 34 309 336 904)
PO Box 881, Canning Bridge WA 6153
Level 3, Kirin Centre, 15 Ogilvie Road, Applecross, WA, 6153
P:  (08) 9315 7000  F:  (08) 9315 7088
E:  adrian.ha...@itvision.com.au    W: http://www.itvision.com.au
    
___  
  
NOTICE : This e-mail and any attachments are intended for the addressee(s) only 
and may
contain confidential or privileged material. Any unauthorised review, use, 
alteration,
disclosure or distribution of this e-mail (including any attachments) by an 
unintended recipient
is prohibited. If you are not the intended recipient please contact the sender 
as soon as
possible by return e-mail and then delete both messages.
___

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] UniObject .NET Session and Common Block Bug

2009-10-07 Thread ozemail
Hi Adrian

I don't have problem with named commons.  There is a problem if you update
the parameters in a named common and you do not compile all the subroutines
with the named common.  If you call a routine that has not been recompiled
you get a fatal, named common mismatch.  Is that a possible issue for you.
This is a general basic issue and is not an issue with .Net API.  

Regards

David Jordan

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] UniObject .NET Session and Common Block Bug

2009-10-07 Thread Hugh Yang

Try ahsub1.Dispose(); after ahsub1.Call();

Regards


Adrian Halid wrote:
 
 Hi All,
 
 I am trying to call 2 subroutines using the same session in UniObject .NET
 but have an issue when the second subroutine Inserts a larger common
 block.
 
 I call the first subroutine without any issues. But when I call the second
 subroutine I get the following error.
 
 [IBM U2][UODOTNET - UNICLIENT][ErrorCode=30105] Unable to load the
 subroutine on the server
 
 I only have this issue in .NET and not in VB6.
 I believe that the .net UniSession is storing the Common Block variables
 and when I try to call another subroutine with a different common block it
 fails to load.
 
 I have read in another post on the web that people have created a Common
 Block loading subroutine to load all Common Blocks when they create the
 session.
 This way when ever they call any subroutine they know the common block
 does not increase.
 
 This seems a like a hack to me.
 
 I am worried that when ever a developer creates a new Common Block that
 they have to remember to update the Common Block loading Subroutine.
 Also we have thousands of Subroutines that may or may not include some
 common blocks.
 If a subroutine has the same variable name as a variable used in common
 block it does not insert will its value change.
 
 The other hack is to close and open the session every time I want to call
 a subroutine.
 But once again this is not suitable for my application.
 
 
 Here is my common blocks in universe
 - BP AH.COMMON1 ---
     COMMON AHCOMMON1
 
 
 - BP AH.COMMON2 ---
    COMMON AHCOMMON2
 
 
 Here are my two subroutines.
 - BP SR.AHTEST.CALL1 -
   SUBROUTINE SR.AHTEST.CALL1
   $INSERT AH.COMMON1
   RETURN
 END
 
 
 - BP SR.AHTEST.CALL2 -
   SUBROUTINE SR.AHTEST.CALL2
   $INSERT AH.COMMON1
   $INSERT AH.COMMON2
   RETURN
 END
 
 
 Here is the C# .net code
 - C# .NET
 
     UniSession ahsession = UniObjects.OpenSession(HOST,
 USERNAME, PASSWORD, ACCOUNT, uvcs);
 
 
     UniSubroutine ahsub1 =
 ahsession.CreateUniSubroutine(SR.AHTEST.CALL1, 0);
     ahsub1.Call(); // No Error on this call
 
     UniSubroutine ahsub2 =
 ahsession.CreateUniSubroutine(SR.AHTEST.CALL2, 0);
     try
     {
     ahsub2.Call(); // Throws and exception 
     }
     catch (UniSubroutineException ex)
     {
     MessageBox.Show(ex.Message); //Displays [ErrorCode=30105]
 Unable to load the subroutine on the server
 
     }
     MessageBox.Show(Done);
 
 
 If I write the same code in VB6 using the UniObject for VB6 I get no
 errors
 - C# .NET
 
 
     Dim objSession As Object
     Set objSession = CreateObject(UniObjects.unioaifctrl)
     objSession.UserName = USERNAME
     objSession.Password = PASSWORD
     objSession.AccountPath = ACCOUNT
     objSession.HostName = HOST
      objSession.Connect
     
     Dim ahsub1 As Object
     Set ahsub1 = objSession.Subroutine(SR.AHTEST.CALL1, 0)
     ahsub1.Call
  
     Dim ahsub2 As Object
     Set ahsub2 = objSession.Subroutine(SR.AHTEST.CALL2, 0)
     ahsub2.Call
  
     MsgBox (Done)
 
 
 
 
 Adrian Halid
 Senior Analyst/Programmer
  
 IT Vision Australia Pty Ltd (ABN: 34 309 336 904)
 PO Box 881, Canning Bridge WA 6153
 Level 3, Kirin Centre, 15 Ogilvie Road, Applecross, WA, 6153
 P:  (08) 9315 7000  F:  (08) 9315 7088
 E:  adrian.ha...@itvision.com.au    W: http://www.itvision.com.au
     
 ___  
   
 NOTICE : This e-mail and any attachments are intended for the addressee(s)
 only and may
 contain confidential or privileged material. Any unauthorised review, use,
 alteration,
 disclosure or distribution of this e-mail (including any attachments) by
 an unintended recipient
 is prohibited. If you are not the intended recipient please contact the
 sender as soon as
 possible by return e-mail and then delete both messages.
 ___
 
 ___
 U2-Users mailing list