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.

filewrite question

4 posts in General Discussion (old) Last posting was on 2000-03-27 03:31:15.0Z
steve Posted on 2000-03-25 04:26:56.0Z
Newsgroups: sybase.public.easerver
Date: Fri, 24 Mar 2000 20:26:56 -0800
From: steve <steve_k_91776@yahoo.com>
X-Mailer: Mozilla 4.61 [en] (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
Subject: filewrite question
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 18
NNTP-Posting-Host: whv-ca4a-32.rasserver.net 199.182.53.32
Message-ID: <347_38DC4010.DBD99ACE@yahoo.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:25714
Article PK: 155770

Hello,
I am having problem to write to a same file from multiple
components. each component calls log() to write things to file. The
codes for log() is as follow:
void log(string msg)
{
int fn;
fn=fileopen("Myfile",Write!,Shared!,Append!);
filewrite(fn,msg);
fclose(fn);
}

There appears to be a synchronization problem running in NT4. I am
guessing its due to the fact multiple components are calling log()
almost simultaneously. The program will crash each time. What would be
a good way to take care of situation like this? any suggestions? Is
there a way to synchronize file access in PB? thanks...
--Steve


Carson Hager[Team Sybase] Posted on 2000-03-27 01:30:25.0Z
Newsgroups: sybase.public.easerver
From: chager@dyn-data.com (Carson Hager[Team Sybase])
Subject: Re: filewrite question
Date: Mon, 27 Mar 2000 01:30:25 GMT
Organization: Dynamic Data Solutions, Inc.
X-Newsreader: Forte Free Agent 1.21/32.243
Lines: 44
NNTP-Posting-Host: charon.lifescape.com 63.86.26.130
Message-ID: <347_38deb962.5313900@forums.sybase.com>
References: <347_38DC4010.DBD99ACE@yahoo.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:25694
Article PK: 155750

You could push the log entries to a queue and have a single process
handle the file writes. As alluded to in an earlier post, this will
likely entail using java instead of PB.


Carson

___________________________________________________________

Carson Hager
Team Sybase
Dynamic Data Solutions, Inc.
Enterprise Application Studio 3.0 Consulting and Training
http://www.dyn-data.com

DDS is now hiring EAServer consultants
to support its exploding EAServer business!
Please submit your resume to
hr@dyn-data.com!


On Fri, 24 Mar 2000 20:26:56 -0800, steve <steve_k_91776@yahoo.com>

wrote:

>Hello,
> I am having problem to write to a same file from multiple
>components. each component calls log() to write things to file. The
>codes for log() is as follow:
> void log(string msg)
> {
> int fn;
> fn=fileopen("Myfile",Write!,Shared!,Append!);
> filewrite(fn,msg);
> fclose(fn);
> }
>
>There appears to be a synchronization problem running in NT4. I am
>guessing its due to the fact multiple components are calling log()
>almost simultaneously. The program will crash each time. What would be
>a good way to take care of situation like this? any suggestions? Is
>there a way to synchronize file access in PB? thanks...
> --Steve
>

___________________________________________________________

Carson Hager
Team Sybase
Dynamic Data Solutions, Inc.
Enterprise Application Studio 3.0 Consulting and Training

DDS Enterprise Application Framework
Available Now as Open Source!
http://www.dyn-data.com


Dave Wolf [Sybase] Posted on 2000-03-27 03:31:15.0Z
Newsgroups: sybase.public.easerver
From: "Dave Wolf [Sybase]" <dwolf@sybase.com>
Subject: Re: filewrite question
Date: Sun, 26 Mar 2000 22:31:15 -0500
Lines: 67
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6600
X-MIMEOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
NNTP-Posting-Host: nomad6-13.sybase.com 157.133.176.13
Message-ID: <347_HvuzJ25l$GA.201@forums.sybase.com>
References: <347_38DC4010.DBD99ACE@yahoo.com> <347_38deb962.5313900@forums.sybase.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:25681
Article PK: 155737

Just uncheck "concurrency" on the components threading. We'll make sure we
synchronize the access. Writing to a log file is the example I always give
of when you would disable concurrency with a non-shared component.

Dave Wolf
Internet Applications Division

"Carson Hager[Team Sybase]" <chager@dyn-data.com> wrote in message
news:38deb962.5313900@forums.sybase.com...
> You could push the log entries to a queue and have a single process
> handle the file writes. As alluded to in an earlier post, this will
> likely entail using java instead of PB.
>
>
> Carson
>
> ___________________________________________________________
>
> Carson Hager
> Team Sybase
> Dynamic Data Solutions, Inc.
> Enterprise Application Studio 3.0 Consulting and Training
> http://www.dyn-data.com
>
> DDS is now hiring EAServer consultants
> to support its exploding EAServer business!
> Please submit your resume to
> hr@dyn-data.com!
>
>
> On Fri, 24 Mar 2000 20:26:56 -0800, steve <steve_k_91776@yahoo.com>
> wrote:
>
> >Hello,
> > I am having problem to write to a same file from multiple
> >components. each component calls log() to write things to file. The
> >codes for log() is as follow:
> > void log(string msg)
> > {
> > int fn;
> > fn=fileopen("Myfile",Write!,Shared!,Append!);
> > filewrite(fn,msg);
> > fclose(fn);
> > }
> >
> >There appears to be a synchronization problem running in NT4. I am
> >guessing its due to the fact multiple components are calling log()
> >almost simultaneously. The program will crash each time. What would be
> >a good way to take care of situation like this? any suggestions? Is
> >there a way to synchronize file access in PB? thanks...
> > --Steve
> >
>
>
> ___________________________________________________________
>
> Carson Hager
> Team Sybase
> Dynamic Data Solutions, Inc.
> Enterprise Application Studio 3.0 Consulting and Training
>
> DDS Enterprise Application Framework
> Available Now as Open Source!
> http://www.dyn-data.com
>


Peter Reedijk Posted on 2000-03-25 08:59:20.0Z
Newsgroups: sybase.public.easerver
From: "Peter Reedijk" <peter.reedijk@pica.nl>
Organization: 194.109.132.165
X-Newsreader: AspNNTP 1.41 (Advent 2000, Inc.)
Subject: Re: filewrite question
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Date: Sat, 25 Mar 2000 03:59:20 -0500
Lines: 32
NNTP-Posting-Host: 207.156.232.4
Message-ID: <347_o9GVohjl$GA.202@forums.sybase.com>
References: <347_38DC4010.DBD99ACE@yahoo.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:25712
Article PK: 155767

Assuming you definitely want to use another file than the server log,
it looks like a good idea to build a separate component for the logging, which
has a log() method that all other components that want to 'log something' should
invoke.
If you build the shared component in PB, the concurrency problem is also gone :)

Peter

On Fri, 24 Mar 2000 20:26:56 -0800,
in powersoft.public.easerver

steve <steve_k_91776@yahoo.com> wrote:
>Hello,
> I am having problem to write to a same file from multiple
>components. each component calls log() to write things to file. The
>codes for log() is as follow:
> void log(string msg)
> {
> int fn;
> fn=fileopen("Myfile",Write!,Shared!,Append!);
> filewrite(fn,msg);
> fclose(fn);
> }
>
>There appears to be a synchronization problem running in NT4. I am
>guessing its due to the fact multiple components are calling log()
>almost simultaneously. The program will crash each time. What would be
>a good way to take care of situation like this? any suggestions? Is
>there a way to synchronize file access in PB? thanks...
> --Steve
>

---== Posted via the PFCGuide Web Newsreader ==---
http://www.pfcguide.com/_newsgroups/group_list.asp