You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Gavin Carr <ga...@openfusion.com.au> on 2002/06/05 06:37:28 UTC

File locking on EmbperlObject::Execute

Hi Gerald,

Are you doing any explicit file locking on the reads involved in an 
EmbperlObject::Execute?  If not, could I make it a feature request?
Maybe an 'flock' argument to Execute or something?

I've got a situation where I want to able to write lock some of my epl
components and know that the locking will be honoured ...

Cheers,
Gavin

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: File locking on EmbperlObject::Execute

Posted by Gavin Carr <ga...@openfusion.com.au>.
On Wed, Jun 05, 2002 at 08:22:36AM +0200, Gerald Richter wrote:
> > I've got a situation where I want to able to write lock some of my epl
> > components and know that the locking will be honoured ...
> 
> You want to write lock the Embperl source files? Do you creating them
> dynamicly? Otherwise I can't imagine for what this should be good for.

Yes, some of my .epl components are dynamic, and some I'm just wanting
to edit atomically. I'm finding all kinds of interesting (mis)uses for
your EmbperlObject framework. :-)

Cheers,
Gavin

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: File locking on EmbperlObject::Execute

Posted by Gerald Richter <ri...@ecos.de>.
Hi,

>
> I've got a situation where I want to able to write lock some of my epl
> components and know that the locking will be honoured ...
>

You want to write lock the Embperl source files? Do you creating them
dynamicly? Otherwise I can't imagine for what this should be good for.

Gerald


-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: File locking on EmbperlObject::Execute

Posted by Gavin Carr <ga...@openfusion.com.au>.
On Wed, Jun 05, 2002 at 11:20:15AM +0200, Gerald Richter - ecos gmbh wrote:
> > Yeah that handles atomic writes, but not proper atomic updates - read
> > data, modify, write, avoiding the race condition between the read and
> > the write. I think that requires proper locking?
> 
> If you only have concurrent reads, it should work. If you also have
> concurrent writes/updates, then you really need locking.
> 
> I can put it on the TODO list, but I am currently don't have the time to
> implement it. If you want to take a look on your own, then go to the file
> epio.c and look at the function ReadHTML. All sourcefiles are read by this
> function.

Thanks Gerald, I'll see how critical it looks for me and may have a
play.

Cheers,
Gavin


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: File locking on EmbperlObject::Execute

Posted by Gerald Richter - ecos gmbh <ri...@ecos.de>.
>
> Yeah that handles atomic writes, but not proper atomic updates - read
> data, modify, write, avoiding the race condition between the read and
> the write. I think that requires proper locking?
>

If you only have concurrent reads, it should work. If you also have
concurrent writes/updates, then you really need locking.

I can put it on the TODO list, but I am currently don't have the time to
implement it. If you want to take a look on your own, then go to the file
epio.c and look at the function ReadHTML. All sourcefiles are read by this
function.

Gerald

-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------





---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Error tracking

Posted by Andrew Lim <an...@caltan.com>.
Hello. I have just finished a site using embperl (www.caltan.com).
Thank you for this great software!!!

BTW, I am getting below error constantly in my apache log file. I don't know
which page this error is coming from. How do I trace this error into?
Thanks


Andy

------------------------------------
[Fri Jun 7 09:45:49 2002] null: DBD::mysql::db rollback failed: Warning:
Some non-transactional changed tables couldn't be rolled back at
/usr/lib/perl5/site_perl/5.6.0/Apache/DBI.pm line 153.


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: File locking on EmbperlObject::Execute

Posted by Angus Lees <gu...@switchonline.com.au>.
At Wed, 5 Jun 2002 15:50:20 +1000, Gavin Carr wrote:
> On Wed, Jun 05, 2002 at 03:49:59PM +1000, Angus Lees wrote:
> > At Wed, 5 Jun 2002 14:37:28 +1000, Gavin Carr wrote:
> > > I've got a situation where I want to able to write lock some of my epl
> > > components and know that the locking will be honoured ...
> > 
> > just do the usual "write to a temporary file next to it, then rename
> > over the file you wanted" trick.  IO::AtomicFile will do it for you,
> > in fact.
> 
> Yeah that handles atomic writes, but not proper atomic updates - read
> data, modify, write, avoiding the race condition between the read and
> the write. I think that requires proper locking?

yes, i hadn't realised you wanted to read them in first..

it sounds like you want to write your own EMBPERL_INPUT_FUNC, which
does the locking and then a normal file read (see Embperl docs for an
example of "normal")

-- 
 - Gus

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: File locking on EmbperlObject::Execute

Posted by Gavin Carr <ga...@openfusion.com.au>.
On Wed, Jun 05, 2002 at 03:49:59PM +1000, Angus Lees wrote:
> At Wed, 5 Jun 2002 14:37:28 +1000, Gavin Carr wrote:
> > I've got a situation where I want to able to write lock some of my epl
> > components and know that the locking will be honoured ...
> 
> just do the usual "write to a temporary file next to it, then rename
> over the file you wanted" trick.  IO::AtomicFile will do it for you,
> in fact.

Yeah that handles atomic writes, but not proper atomic updates - read
data, modify, write, avoiding the race condition between the read and
the write. I think that requires proper locking?

-G

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: File locking on EmbperlObject::Execute

Posted by Angus Lees <gu...@switchonline.com.au>.
At Wed, 5 Jun 2002 14:37:28 +1000, Gavin Carr wrote:
> I've got a situation where I want to able to write lock some of my epl
> components and know that the locking will be honoured ...

just do the usual "write to a temporary file next to it, then rename
over the file you wanted" trick.  IO::AtomicFile will do it for you,
in fact.

-- 
 - Gus

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org