Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Problem /w SetFullstate and dataobject

3 posts in DataWindow .NET Last posting was on 2004-09-08 22:07:59.0Z
Jack Addington Posted on 2004-09-08 03:57:56.0Z
From: "Jack Addington" <jaddington@shaw.ca>
Newsgroups: sybase.public.datawindow.net
Subject: Problem /w SetFullstate and dataobject
Lines: 50
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
X-Original-NNTP-Posting-Host: s010600e018e32f17.cg.shawcable.net
Message-ID: <413e84e3$1@forums-2-dub>
X-Original-Trace: 7 Sep 2004 21:04:51 -0700, s010600e018e32f17.cg.shawcable.net
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 7 Sep 2004 20:46:32 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 7 Sep 2004 20:57:56 -0700
X-Trace: forums-1-dub 1094615876 10.22.108.75 (7 Sep 2004 20:57:56 -0700)
X-Original-Trace: 7 Sep 2004 20:57:56 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:321
Article PK: 124752

I am having a problem with my datastore that doesn't seem to make sense. I
am loading my data in the following manner.

public DataStore = new DataStore( liblist, dataobject );

retrieveData( object[] args )
{
sourceDS.SetFullState( getData( sourceDS.LibList,
sourceDS.dataWindowObject, args ) );
sourceDS.ShareData( datawindowOnWindow )
}

getData( string dwLibList, dwDataObjda , object[] args)
{
DataStore ds = new DataStore(dwLibList, dwDataObj);
SQLCA.openConnection();
ds.SetTransaction(SQLCA.dsTrans);
ds.Retrieve(objArgs);
SQLCA.closeConnection();
return ds.GetFullState();
}

Which is fine except the SetFullState clears the datawindow object.
According to the docs this is the expecting result. I get my data but then
when I go to call the function again I have no dataobject and the retrieve
fails. So I decided to copy and restore the dataobject. I added the
following to the retrieveData method:

retrieveData( object[] args )
{
string dataObject;

---> dataObject = sourceDS.dataWindowObject;

sourceDS.SetFullState( getData( sourceDS.LibList,
sourceDS.dataWindowObject, args ) );
sourceDS.ShareData( datawindowOnWindow );

---> sourceDS.DataWindowObject = dataObject;

---> as soon as the last line fires the data is erased, as if the
datastore was completely initialized.
}

Is this expected behavior? If so, how am I suppose to get around this? My
only thought would be to retrieve the data through fullstate to a temp
datastore and then do a rowsCopy for all rows... Why does SetFullState
replace the dataobject?


Jim O'Neil [Sybase] Posted on 2004-09-08 14:26:32.0Z
From: "Jim O'Neil [Sybase]" <joneil_at_sybase_dot_com>
Newsgroups: sybase.public.datawindow.net
Subject: Re: Problem /w SetFullstate and dataobject
Message-ID: <104uj0lnbrv63pttl257goobl04ae8e2kj@4ax.com>
References: <413e84e3$1@forums-2-dub>
X-Newsreader: Forte Agent 2.0/32.652
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: joneilw2k.sybase.com
X-Original-NNTP-Posting-Host: joneilw2k.sybase.com
Date: 8 Sep 2004 07:26:32 -0700
X-Trace: forums-1-dub 1094653592 10.18.63.187 (8 Sep 2004 07:26:32 -0700)
X-Original-Trace: 8 Sep 2004 07:26:32 -0700, joneilw2k.sybase.com
Lines: 70
X-Authenticated-User: teamsybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:327
Article PK: 124758

What you are seeing would be expected behavior. SetFullState is
generally used for distributed applications. The replacement of the
DataWindowObject is by design since it obviates the need to have the
DataWindow object on both the 'client' and the 'server' side of a
distributed application. SetFullState also replaces whatever
DataWindowObject was currently assigned; therefore, to not reset
DataWindowObject to "" would leave the DataStore in an inconsistent
state - you would see a DataWindowObject name in the property that had
no relation to what the DataStore really contains.

If this is not part of a distributed application, I would question the
benefit of the Get/SetFullState methods here; however, I think your
issue would be easily resolved by just retaining the original
dataobject name and passing that in to getData instead. You could
extend System.DataWindow.DataStore to add such a property if you
wanted as well.

On 7 Sep 2004 20:57:56 -0700, "Jack Addington" <jaddington@shaw.ca>

wrote:

>I am having a problem with my datastore that doesn't seem to make sense. I
>am loading my data in the following manner.
>
>public DataStore = new DataStore( liblist, dataobject );
>
> retrieveData( object[] args )
> {
> sourceDS.SetFullState( getData( sourceDS.LibList,
>sourceDS.dataWindowObject, args ) );
> sourceDS.ShareData( datawindowOnWindow )
> }
>
> getData( string dwLibList, dwDataObjda , object[] args)
> {
> DataStore ds = new DataStore(dwLibList, dwDataObj);
> SQLCA.openConnection();
> ds.SetTransaction(SQLCA.dsTrans);
> ds.Retrieve(objArgs);
> SQLCA.closeConnection();
> return ds.GetFullState();
> }
>
>Which is fine except the SetFullState clears the datawindow object.
>According to the docs this is the expecting result. I get my data but then
>when I go to call the function again I have no dataobject and the retrieve
>fails. So I decided to copy and restore the dataobject. I added the
>following to the retrieveData method:
>
> retrieveData( object[] args )
> {
> string dataObject;
>
>---> dataObject = sourceDS.dataWindowObject;
>
> sourceDS.SetFullState( getData( sourceDS.LibList,
>sourceDS.dataWindowObject, args ) );
> sourceDS.ShareData( datawindowOnWindow );
>
>---> sourceDS.DataWindowObject = dataObject;
>
>---> as soon as the last line fires the data is erased, as if the
>datastore was completely initialized.
> }
>
>Is this expected behavior? If so, how am I suppose to get around this? My
>only thought would be to retrieve the data through fullstate to a temp
>datastore and then do a rowsCopy for all rows... Why does SetFullState
>replace the dataobject?
>


Jack Addington Posted on 2004-09-08 22:07:59.0Z
From: "Jack Addington" <jaddington@shaw.ca>
Newsgroups: sybase.public.datawindow.net
References: <413e84e3$1@forums-2-dub> <104uj0lnbrv63pttl257goobl04ae8e2kj@4ax.com>
Subject: Re: Problem /w SetFullstate and dataobject
Lines: 83
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
NNTP-Posting-Host: s010600e018e32f17.cg.shawcable.net
X-Original-NNTP-Posting-Host: s010600e018e32f17.cg.shawcable.net
Message-ID: <413f82bf$1@forums-1-dub>
Date: 8 Sep 2004 15:07:59 -0700
X-Trace: forums-1-dub 1094681279 68.147.193.82 (8 Sep 2004 15:07:59 -0700)
X-Original-Trace: 8 Sep 2004 15:07:59 -0700, s010600e018e32f17.cg.shawcable.net
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:330
Article PK: 124762

So the lightbulb just turned on. Thanks so much. I am not quite struggling
to come up with a new architecture but to 'do it right' when there are
obviously lots of right ways to do things. Too much client/server work :-).

"Jim O'Neil [Sybase]" <joneil_at_sybase_dot_com> wrote in message
news:104uj0lnbrv63pttl257goobl04ae8e2kj@4ax.com...
> What you are seeing would be expected behavior. SetFullState is
> generally used for distributed applications. The replacement of the
> DataWindowObject is by design since it obviates the need to have the
> DataWindow object on both the 'client' and the 'server' side of a
> distributed application. SetFullState also replaces whatever
> DataWindowObject was currently assigned; therefore, to not reset
> DataWindowObject to "" would leave the DataStore in an inconsistent
> state - you would see a DataWindowObject name in the property that had
> no relation to what the DataStore really contains.
>
> If this is not part of a distributed application, I would question the
> benefit of the Get/SetFullState methods here; however, I think your
> issue would be easily resolved by just retaining the original
> dataobject name and passing that in to getData instead. You could
> extend System.DataWindow.DataStore to add such a property if you
> wanted as well.
>
> On 7 Sep 2004 20:57:56 -0700, "Jack Addington" <jaddington@shaw.ca>
> wrote:
>
> >I am having a problem with my datastore that doesn't seem to make sense.
I
> >am loading my data in the following manner.
> >
> >public DataStore = new DataStore( liblist, dataobject );
> >
> > retrieveData( object[] args )
> > {
> > sourceDS.SetFullState( getData( sourceDS.LibList,
> >sourceDS.dataWindowObject, args ) );
> > sourceDS.ShareData( datawindowOnWindow )
> > }
> >
> > getData( string dwLibList, dwDataObjda , object[] args)
> > {
> > DataStore ds = new DataStore(dwLibList, dwDataObj);
> > SQLCA.openConnection();
> > ds.SetTransaction(SQLCA.dsTrans);
> > ds.Retrieve(objArgs);
> > SQLCA.closeConnection();
> > return ds.GetFullState();
> > }
> >
> >Which is fine except the SetFullState clears the datawindow object.
> >According to the docs this is the expecting result. I get my data but
then
> >when I go to call the function again I have no dataobject and the
retrieve
> >fails. So I decided to copy and restore the dataobject. I added the
> >following to the retrieveData method:
> >
> > retrieveData( object[] args )
> > {
> > string dataObject;
> >
> >---> dataObject = sourceDS.dataWindowObject;
> >
> > sourceDS.SetFullState( getData( sourceDS.LibList,
> >sourceDS.dataWindowObject, args ) );
> > sourceDS.ShareData( datawindowOnWindow );
> >
> >---> sourceDS.DataWindowObject = dataObject;
> >
> >---> as soon as the last line fires the data is erased, as if the
> >datastore was completely initialized.
> > }
> >
> >Is this expected behavior? If so, how am I suppose to get around this?
My
> >only thought would be to retrieve the data through fullstate to a temp
> >datastore and then do a rowsCopy for all rows... Why does SetFullState
> >replace the dataobject?
> >
>