dbTalk Databases Forums  

Universe: LOGOUT of UniObjects session based proceses

comp.databases.pick comp.databases.pick


Discuss Universe: LOGOUT of UniObjects session based proceses in the comp.databases.pick forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
Curt
 
Posts: n/a

Default Re: Universe: LOGOUT of UniObjects session based proceses - 08-07-2006 , 12:19 PM






I am attempting to leard VB.NET. I came from a VB6 background and am
learning Visual Studio 2005, specifically VB, although there is little
difference between it and C anymore.

Here is a sample of the code (No Laughing. I am new to .net)

Sub LoadShipmentGrid()
Dim uvsession As UniSession
Dim uvSub As UniSubroutine
Dim Quote As String = Chr(34)
Dim Shipments As UniDynArray
Dim Args() As String = {"", ""}
Dim Valu As String
uvsession = UniObjects.OpenSession("192.169.2.222", "UserName",
"Password", "LogonAccount", "uvcs")
uvSub = uvsession.CreateUniSubroutine("SR.LOAD.SHIPMENT.LI ST",
3)
uvSub.SetArg(0, Profile.uvIntCustNo)
uvSub.Call()
Shipments = uvSub.GetArgDynArray(1)
' Generate rows and cells.
Dim TrackNo As String = ""
Dim numrows As Integer = Shipments.Dcount(0)
Dim numcells As Integer = 4
Dim j As Integer
Dim RelNo As String = ""
For j = 0 To numrows - 1
Dim r As New TableRow()
Dim i As Integer
For i = 0 To numcells - 1
Dim c As New TableCell()
Valu = Shipments.Extract(j, i + 1, 0).ToString
c.Controls.Add(New LiteralControl("row " & j.ToString()
& ", cell " & i.ToString()))
r.Cells.Add(c)
If i = 0 Then
r.Cells.Item(i).Text = Valu 'Cust Po#
End If
If i = 1 Then
RelNo = Valu 'FSR Rel#
r.Cells.Item(i).Text = "<a href=" & Chr(34) &
"DisplayRelease.aspx?Relno=" & RelNo & Chr(34) & ">" & RelNo & "</a>"
End If
If i = 2 Then
r.Cells.Item(i).Text = Valu 'Ship Date
End If
If i = 3 Then
TrackNo = Valu
r.Cells.Item(i).Text = "<a href=" & Chr(34) &
"track.aspx?RelNo=" & RelNo & Chr(34) & ">" & TrackNo & "</a>"
End If
Next i
ShipmentTable.Rows.Add(r)
Next j
UniObjects.CloseSession(uvsession)
End Sub








In article <eildd2dbu619th9eqsbkdka8pvp8tdprgh (AT) 4ax (DOT) com>, g6q3x9lu53001
@sneakemail.com.invalid says...
Quote:
Curt wrote:
One thing I learned on Friday about this problem.
The sessions do complete and disappear immediately when you are using a
winform app. It appears to only be when you are linking in from a web
page that they hang around. The IBM Rep had me run one of the samples
that came with UniDK and it worked perfectly. It was doing nothing
differently than I was in my web app, 'cept mine was a web app.

Oh boy, here is a dump of thoughts, hope it makes sense.

A thick client usually makes a persistent connection for one user, and
goes through a nice wrapup process when the user closes the app.
A thin client needs to hit and run much faster than a thin client.

Theory #1 is that if you are trying to instantiate and then terminate
a session within a single web session, that there isn't enough time
for the close to occur before the client destructs. That could leave
the server trying to close a connection without a client, and leave it
in a hung state.

Theory #2: the fact that your connection seems to wrap itself up in 30
minutes reminds me of the TIME_WAIT condition of sockets. This is a
perfectly normal condition but some people (and programs) insist on
trying to brutally terminate a process if it doesn't go from LISTENING
or ESTABLISHED to dead within some number of seconds. I'm guessing
that the code is not wrapping itself up for some reason and that it's
remaining in a TIME_WAIT condition.
Theory #3: If you're using ASP or ASP.NET then _where_ and _when_ you
instantiate, store, and destroy your connection objects is critical.
Some people instantiate a new DBMS connection on every transaction,
which (per theories 1 and 2) will eventually leave the server in a
wierd state. Some people handle everything in Session State, others
in Application State. There are trade-offs for both.

Theory #4: Curt, you didn't say so, but if you are using VB6 with ASP,
for example, objects don't clean up their own memory, and if you just
null a DBMS object (for whatever reason), you might be leaving a
memory reference hanging. In .NET, most objects are cleaned up
properly through garbage collection, but there are some classes that
do not inherit from IDisposable which must be wrapped up manually -
otherwise you have the same hanging problem. A series of ASP.NET
transactions that instantiates objects without wrapping them up is
bound to result in issues like this. I have no idea if the classes of
UO.NET inherit from IDisposable. Even if your own code implements the
Dispose pattern and use class Destructors, garbage collection is not
guaranteed to happen immediately, thus leaving the possibility of
objects hanging around when they shouldn't, or not being properly
wrapped up when you expect.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.