Re: [Zope-dev] How to add sections to zope.conf?

2004-07-16 Thread Chris Withers
Dieter Maurer wrote:
You must extend the "zopeschema.xml" or let your process use
a schema derived from "zopeschema.xml" (schema support some form
of inheritance).
Is there any way for a Product to do this or do I actually have to go and 
manually spank zopeschema.xml when I install my product?

Chris
--
Simplistix - Content Management, Zope & Python Consulting
   - http://www.simplistix.co.uk
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Making a ZSQL.DA fully multi-threaded?

2004-07-16 Thread Chris Withers
Brad Clements wrote:
On 9 Jul 2004 at 21:17, Dieter Maurer wrote:

Check whether the connection is maintained in a "_v_" attribute
(in this case, it is per thread).
Otherwise, the connection would need to be maintained in a module
global registry indexed with a DA id (e.g. its ZODB path).
This is the deep magic of which my previous note speaks.
Where are these details documented (in general terms, not just about DA's), so that I can 
figure this out without bugging the list too much?
Just checking: you do know that each thread in ZODB gets what appears to it to 
be it's own copy of the ZODB right?

So, even though there's only one connection stored in the class of the DA, 
that'll mean there's one DA connection opened up per Zope thread.

This often means that many more database connections are opened than are 
actually necessary. And if you start timing out inactive database connectiosn on 
the database side, you're in for a world of pain and suffering.

I branched ZOracleDA some time ago to move away from this model for that very 
reason...

What's the actual problem you're experiencing?
Chris
--
Simplistix - Content Management, Zope & Python Consulting
   - http://www.simplistix.co.uk
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] manage_afterAdd +webdav + two times called

2004-07-16 Thread Kai Hoppert
Hi all,

zope2.7.2-RC1
cmf 1.4.4

i tried and tested a bit around with webdav and noticed that manage_afterAdd is called 
two times in putting a file into Plone . Yea i know this is not the list for Plone but 
i think this is more a problem from zope, webdav and cmf. 

 File "/var/lib/zope271/lib/python/webdav/NullResource.py", line 110, in PUT
ob = factory(name, typ, body)

__
 
File "/var/lib/zope271/lib/python/webdav/NullResource.py", line 127, in PUT
self.__parent__._setObject(name, ob)

These two lines from the traceback are the mainproblem i think. First manage 
manage_afterAdd will be called after creating the Object and second it is called after 
writing the object into zodb. 

Is this intended that manage_afterAdd is called two times?? Shouldn't it only called 
after writing the data to zodb.

Below i posted the whole traceback wich was produced.

Greetings Kai

  File "/var/lib/zope271/lib/python/ZServer/PubCore/ZServerPublisher.py", line 23, in 
__init__
response=response)
  File "/var/lib/zope271/lib/python/ZPublisher/Publish.py", line 389, in publish_module
environ, debug, request, response)
  File "/var/lib/zope271/lib/python/ZPublisher/Publish.py", line 180, in 
publish_module_standard
response = publish(request, module_name, after_list, debug=debug)
  File 
"/var/lib/zope271/instance/default/Products/PlacelessTranslationService/PatchStringIO.py",
 line 51, in new_publish
x = Publish.old_publish(request, module_name, after_list, debug)
  File "/var/lib/zope271/lib/python/ZPublisher/Publish.py", line 101, in publish
request, bind=1)
  File "/var/lib/zope271/lib/python/ZPublisher/mapply.py", line 88, in mapply
if debug is not None: return debug(object,args,context)
  File "/var/lib/zope271/lib/python/ZPublisher/Publish.py", line 39, in call_object
result=apply(object,args) # Type s to step into published object.
  File "/var/lib/zope271/lib/python/webdav/NullResource.py", line 110, in PUT
ob = factory(name, typ, body)
  File "/var/lib/zope271/instance/default/Products/CMFCore/PortalFolder.py", line 336, 
in PUT_factory
self.invokeFactory( typeObjectName, name )
  File "/var/lib/zope271/instance/default/Products/CMFCore/PortalFolder.py", line 363, 
in invokeFactory
, kw
  File "/var/lib/zope271/instance/default/Products/CMFCore/TypesTool.py", line 709, in 
constructContent
ob = apply(info.constructInstance, (container, id) + args, kw)
  File "/var/lib/zope271/instance/default/Products/CMFCore/TypesTool.py", line 398, in 
constructInstance
id = apply( m, args, kw ) or id  # allow factory to munge ID
  File "", line 4, in addVCard
  File "/var/lib/zope271/lib/python/OFS/ObjectManager.py", line 276, in _setObject
object.manage_afterAdd(object, self)
  File "/var/lib/zope271/instance/default/Products/VCard/VCard.py", line 239, in 
manage_afterAdd
print print_stack()
None

  File "/var/lib/zope271/lib/python/ZServer/PubCore/ZServerPublisher.py", line 23, in 
__init__
response=response)
  File "/var/lib/zope271/lib/python/ZPublisher/Publish.py", line 389, in publish_module
environ, debug, request, response)
  File "/var/lib/zope271/lib/python/ZPublisher/Publish.py", line 180, in 
publish_module_standard
response = publish(request, module_name, after_list, debug=debug)
  File 
"/var/lib/zope271/instance/default/Products/PlacelessTranslationService/PatchStringIO.py",
 line 51, in new_publish
x = Publish.old_publish(request, module_name, after_list, debug)
  File "/var/lib/zope271/lib/python/ZPublisher/Publish.py", line 101, in publish
request, bind=1)
  File "/var/lib/zope271/lib/python/ZPublisher/mapply.py", line 88, in mapply
if debug is not None: return debug(object,args,context)
  File "/var/lib/zope271/lib/python/ZPublisher/Publish.py", line 39, in call_object
result=apply(object,args) # Type s to step into published object.
  File "/var/lib/zope271/lib/python/webdav/NullResource.py", line 127, in PUT
self.__parent__._setObject(name, ob)
  File "/var/lib/zope271/lib/python/OFS/ObjectManager.py", line 276, in _setObject
object.manage_afterAdd(object, self)
  File "/var/lib/zope271/instance/default/Products/VCard/VCard.py", line 239, in 
manage_afterAdd
print print_stack()
___
tomcom Gesellschaft für Informationstechnologie mbH
Heuriedweg 14 | D-88131 Lindau
Fon +49 (0)8382 975844 | Fax +49 (0)8382 975855
[EMAIL PROTECTED] | http://www.tomcom.de

This document should only be read by those persons to whom it is addressed and is not 
intended to be relied upon by any person without subsequent written confirmation of 
its contents.  tomcom disclaims all responsibility and accepts no liability for the 
consequences of any person acting, or refraining from acting on the contents of this 
document.  Any unauthorised form of dissemination, copying, disclosure, modification, 
distrib

Re: [Zope-dev] Granularity of Persistent Objects

2004-07-16 Thread Lennart Regebro
Ian Beatty wrote:
However, I don't know how to do this. Is it as simple as using a
PersistentMapping where I'd normally use a standard Python dictionary?
Well, yes.
Or shall I wrap each one in a custom class that subclasses Persistent?
That is usually an even better idea. And for big dictionaries, you may 
want to use the BTree objects for storage.

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] mount a plonesite with zeo storage

2004-07-16 Thread Martino Salvato



hi,
I'm just try to use Zope 2.7 and Plone with 
zeo storage support.
and I would like to put a CMFPlone site into 
a zeo client storage to mount in a zope instance.
I have added in my zeo.conf 
  
path $INSTANCE/var/plonesite.fs
and in zope.conf
   mount-point 
/plonesite
   container-class 
Products.CMFPlone.Portal.PlonSite
   
 server 
localhost: storage plonesite
 
name plonesite
 
cache-size 2 client 
cache var $INSTANCE/var   

I start the zeo with runzeo and the zeo 
client storage plonesite.fs is created...
 
I 
start zope, but when i try to add a ZODB Mount Point, I get a Zope 
Folder instead of a Plone Site,
why the container-class rule doesn't 
work?
Or there is another way to add a new 
plonesite as zeo client storage?
Thanks, in advance...
 
Martino
 
<>___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Granularity of Persistent Objects

2004-07-16 Thread Ian Beatty
> > Or shall I wrap each one in a custom class that subclasses Persistent?
> 
> That is usually an even better idea. And for big dictionaries, you may
> want to use the BTree objects for storage.

So in my containing class, I just have

class MyContainer( Persistent ):

subObject = None

def __init__( self ):

self.subObject = BTree()

and etc.? That's all there is to it??

Thanks,

..Ian
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] manage_afterAdd +webdav + two times called

2004-07-16 Thread Florent Guillaume
Could you add this as a bug in the collector please ?
http://collector.zope.org/Zope

Florent

In article <[EMAIL PROTECTED]> you write:
> Hi all,
> 
> zope2.7.2-RC1
> cmf 1.4.4
> 
> i tried and tested a bit around with webdav and noticed that manage_afterAdd
> is called two times in putting a file into Plone . Yea i know this is not the
> list for Plone but i think this is more a problem from zope, webdav and cmf. 
> 
>  File "/var/lib/zope271/lib/python/webdav/NullResource.py", line 110, in PUT
> ob = factory(name, typ, body)
> 
> __
>  
> File "/var/lib/zope271/lib/python/webdav/NullResource.py", line 127, in PUT
> self.__parent__._setObject(name, ob)
> 
> These two lines from the traceback are the mainproblem i think. First manage
> manage_afterAdd will be called after creating the Object and second it is
> called after writing the object into zodb. 
> 
> Is this intended that manage_afterAdd is called two times?? Shouldn't it only
> called after writing the data to zodb.
> 
> Below i posted the whole traceback wich was produced.
> 
> Greetings Kai
> 
>   File "/var/lib/zope271/lib/python/ZServer/PubCore/ZServerPublisher.py",
> line 23, in __init__
> response=response)
>   File "/var/lib/zope271/lib/python/ZPublisher/Publish.py", line 389, in
> publish_module
> environ, debug, request, response)
>   File "/var/lib/zope271/lib/python/ZPublisher/Publish.py", line 180, in
> publish_module_standard
> response = publish(request, module_name, after_list, debug=debug)
>   File
> "/var/lib/zope271/instance/default/Products/PlacelessTranslationService/PatchStringIO.py",
>  line 51, in new_publish
> x = Publish.old_publish(request, module_name, after_list, debug)
>   File "/var/lib/zope271/lib/python/ZPublisher/Publish.py", line 101, in publish
> request, bind=1)
>   File "/var/lib/zope271/lib/python/ZPublisher/mapply.py", line 88, in mapply
> if debug is not None: return debug(object,args,context)
>   File "/var/lib/zope271/lib/python/ZPublisher/Publish.py", line 39, in
> call_object
> result=apply(object,args) # Type s to step into published object.
>   File "/var/lib/zope271/lib/python/webdav/NullResource.py", line 110, in PUT
> ob = factory(name, typ, body)
>   File "/var/lib/zope271/instance/default/Products/CMFCore/PortalFolder.py",
> line 336, in PUT_factory
> self.invokeFactory( typeObjectName, name )
>   File "/var/lib/zope271/instance/default/Products/CMFCore/PortalFolder.py",
> line 363, in invokeFactory
> , kw
>   File "/var/lib/zope271/instance/default/Products/CMFCore/TypesTool.py",
> line 709, in constructContent
> ob = apply(info.constructInstance, (container, id) + args, kw)
>   File "/var/lib/zope271/instance/default/Products/CMFCore/TypesTool.py",
> line 398, in constructInstance
> id = apply( m, args, kw ) or id  # allow factory to munge ID
>   File "", line 4, in addVCard
>   File "/var/lib/zope271/lib/python/OFS/ObjectManager.py", line 276, in
> _setObject
> object.manage_afterAdd(object, self)
>   File "/var/lib/zope271/instance/default/Products/VCard/VCard.py", line 239,
> in manage_afterAdd
> print print_stack()
> None
> 
>   File "/var/lib/zope271/lib/python/ZServer/PubCore/ZServerPublisher.py",
> line 23, in __init__
> response=response)
>   File "/var/lib/zope271/lib/python/ZPublisher/Publish.py", line 389, in
> publish_module
> environ, debug, request, response)
>   File "/var/lib/zope271/lib/python/ZPublisher/Publish.py", line 180, in
> publish_module_standard
> response = publish(request, module_name, after_list, debug=debug)
>   File
> "/var/lib/zope271/instance/default/Products/PlacelessTranslationService/PatchStringIO.py",
>  line 51, in new_publish
> x = Publish.old_publish(request, module_name, after_list, debug)
>   File "/var/lib/zope271/lib/python/ZPublisher/Publish.py", line 101, in publish
> request, bind=1)
>   File "/var/lib/zope271/lib/python/ZPublisher/mapply.py", line 88, in mapply
> if debug is not None: return debug(object,args,context)
>   File "/var/lib/zope271/lib/python/ZPublisher/Publish.py", line 39, in
> call_object
> result=apply(object,args) # Type s to step into published object.
>   File "/var/lib/zope271/lib/python/webdav/NullResource.py", line 127, in PUT
> self.__parent__._setObject(name, ob)
>   File "/var/lib/zope271/lib/python/OFS/ObjectManager.py", line 276, in
> _setObject
> object.manage_afterAdd(object, self)
>   File "/var/lib/zope271/instance/default/Products/VCard/VCard.py", line 239,
> in manage_afterAdd
> print print_stack()
> ___
> tomcom Gesellschaft für Informationstechnologie mbH
> Heuriedweg 14 | D-88131 Lindau
> Fon +49 (0)8382 975844 | Fax +49 (0)8382 975855
> [EMAIL PROTECTED] | http://www.tomcom.de
> 
> This document should only be read by those persons to whom it is addressed
> and is not intended to be re

[Zope-dev] Re: [ZODB-Dev] Getting rid of ZODB versions (was Re: [ZWeb] Are Versions evil?)

2004-07-16 Thread Christian Robottom Reis
On Thu, Jul 15, 2004 at 06:09:29PM -0400, Jim Fulton wrote:
> >Locks are important, however, in cases such as generating unique IDs
> >based on integer attributes in a database.
> 
> I don't know what this is.

Well, let's say I wanted to have a unique ID for payments (people want
to refer to them for number) -- each payment instance created should
have its own ID.

> > This is something we never
> >managed to sort out in IndexedCatalog, and I wonder if anyone else
> >ever has.
> 
> In the regular catalog, we pick ids and let normal time-stamp-based
> concurrency control tell us when there is a conflict.

Yes, but then you need to change IDs at commit time. If I want to start
a transaction by showing the user a certain unique ID that was
allocated, I run the risk of having to tell him "oh, sorry, we
conflicted on that ID, I need to give you another one".

> The database itself uses a short-lived lock to generate oids.

Functionality which would be interesting if it were publically available
to solve the aforementioned problem.

Take care,
--
Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 3361 2331
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Granularity of Persistent Objects

2004-07-16 Thread Florent Guillaume
In article <[EMAIL PROTECTED]> you write:
> > > Or shall I wrap each one in a custom class that subclasses Persistent?
> > 
> > That is usually an even better idea. And for big dictionaries, you may
> > want to use the BTree objects for storage.
> 
> So in my containing class, I just have
> 
> class MyContainer( Persistent ):
> subObject = None
> def __init__( self ):
> self.subObject = BTree()
> 
> and etc.? That's all there is to it??

Yes, that's it. You can even store BTree's in BTree's if you fancy :)

Florent
> 


-- 
Florent Guillaume, Nuxeo (Paris, France)
+33 1 40 33 79 87  http://nuxeo.com  mailto:[EMAIL PROTECTED]
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Making a ZSQL.DA fully multi-threaded?

2004-07-16 Thread Brad Clements
On 16 Jul 2004 at 8:57, Chris Withers wrote:

> This often means that many more database connections are opened than are
> actually necessary. And if you start timing out inactive database
> connectiosn on the database side, you're in for a world of pain and
> suffering.
> 
> I branched ZOracleDA some time ago to move away from this model for that
> very reason...
> 
> What's the actual problem you're experiencing?

I have set the SAPDB timeout to 32400 seconds. However when running with more than 1 
thread I still get "mysterious segfaults" in the sapdbapi component.

The SAP  folks say their adapter is "multi-thread capable", but I've come to believe 
that only 
means that it's ok to open a connection in one thread and use it in another, but NOT 
to have 
2 threads make requests on the same connection at the same time.

Also, two threads can' t open a connection "at the same time" because their connection 
table 
management isn't "thread safe".

What I need, I suppose, is a DB connection pool mechanism of some kind. I also have 
Python extensions that need a connection as well. Getting the actual database 
connection 
from a DA stinks (ie, it's not really possible). I'd like to see an API extension to 
ZopeDA's to 
allow Pythonscripts, Products and external methods get an actual db connection. But 
that I 
suppose is a problem to solve later.

I think I will take a look at ZOracleDA to see what you did. 


-- 
Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
http://www.wecanstopspam.org/   AOL-IM: BKClements

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] zope 2.7.1 on xp profesional

2004-07-16 Thread Chris Johnson
 <> 

I get this error on running runzope installed on xp profesional ibm
thinkpad.

Any idea what is happening ?

cj
C:\Zope-Instance\bin>runzope.bat>c:\zopeError.txt
C:\Program Files\Zope-2.7.1\bin\lib\fcntl.py:7: DeprecationWarning: the FCNTL mo
dule is deprecated; please use fcntl
  DeprecationWarning)
--
2004-07-16T21:50:47 INFO(0) ZServer HTTP server started at Fri Jul 16 21:50:47 2
004
Hostname: IBM-CD24ABFA02F
Port: 8080
--
2004-07-16T21:50:47 INFO(0) ZServer FTP server started at Fri Jul 16 21:50:47 20
04
Hostname: IBM-CD24ABFA02F
Port: 8021
Traceback (most recent call last):
  File "C:\Program Files\Zope-2.7.1\lib\python\Zope\Startup\run.py", line 50, in
 ?
run()
  File "C:\Program Files\Zope-2.7.1\lib\python\Zope\Startup\run.py", line 19, in
 run
start_zope(opts.configroot)
  File "C:\Program Files\Zope-2.7.1\lib\python\Zope\Startup\__init__.py", line 4
9, in start_zope
starter.makeLockFile()
  File "C:\Program Files\Zope-2.7.1\lib\python\Zope\Startup\__init__.py", line 2
51, in makeLockFile
lock_file(self.lockfile)
  File "C:\Program Files\Zope-2.7.1\lib\python\Zope\Startup\misc\lock_file.py",
line 40, in lock_file
fcntl.flock(file, fcntl.LOCK_EX | fcntl.LOCK_NB)
AttributeError: 'module' object has no attribute 'flock'

C:\Zope-Instance\bin>






C:\Zope-Instance\bin>"C:\Program Files\Zope-2.7.1\bin\python.exe" "C:\Program 
Files\Zope-2.7.1\lib\python\Zope\Startup\run.py" -C "C:\Zope-Instance\etc\zope.conf"   
 
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Making a ZSQL.DA fully multi-threaded?

2004-07-16 Thread Andy Dustman
On Fri, 16 Jul 2004 10:36:27 -0400, Brad Clements <[EMAIL PROTECTED]> wrote:

> The SAP  folks say their adapter is "multi-thread capable", but I've come to believe 
> that only
> means that it's ok to open a connection in one thread and use it in another, but NOT 
> to have
> 2 threads make requests on the same connection at the same time.

I would be surprised to find any database API that allowed that.
Generally "thread-safe" means that there are no global state
variables, i.e. all connection state is encapsulated in the connection
object/struct. Generally I would not try to share connections between
threads at all. To do it, you'd need to ensure that a thread performs
a commit or rollback on the connection before another thread can use
it, i.e. performs a complete transaction or none at all. Otherwise you
will have all sorts of interesting problems.

> Also, two threads can' t open a connection "at the same time" because their 
> connection table
> management isn't "thread safe".

That does suck, but it doesn't seem like an insurmountable problem for
a DA. You just need a per-DA instance mutex which you acquire before
opening a connection release afterwards.
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] zope 2.7.1 on xp profesional

2004-07-16 Thread Chris Johnson


I get this error on running runzope installed on xp profesional ibm
thinkpad.

Any idea what is happening ?

cj


C:\Zope-Instance\bin>runzope.bat>c:\zopeError.txt
C:\Program Files\Zope-2.7.1\bin\lib\fcntl.py:7: DeprecationWarning: the
FCNTL mo
dule is deprecated; please use fcntl
  DeprecationWarning)
--
2004-07-16T21:50:47 INFO(0) ZServer HTTP server started at Fri Jul 16
21:50:47 2
004
Hostname: IBM-CD24ABFA02F
Port: 8080
--
2004-07-16T21:50:47 INFO(0) ZServer FTP server started at Fri Jul 16
21:50:47 20
04
Hostname: IBM-CD24ABFA02F
Port: 8021
Traceback (most recent call last):
  File "C:\Program Files\Zope-2.7.1\lib\python\Zope\Startup\run.py", line
50, in
 ?
run()
  File "C:\Program Files\Zope-2.7.1\lib\python\Zope\Startup\run.py", line
19, in
 run
start_zope(opts.configroot)
  File "C:\Program Files\Zope-2.7.1\lib\python\Zope\Startup\__init__.py",
line 4
9, in start_zope
starter.makeLockFile()
  File "C:\Program Files\Zope-2.7.1\lib\python\Zope\Startup\__init__.py",
line 2
51, in makeLockFile
lock_file(self.lockfile)
  File "C:\Program
Files\Zope-2.7.1\lib\python\Zope\Startup\misc\lock_file.py",
line 40, in lock_file
fcntl.flock(file, fcntl.LOCK_EX | fcntl.LOCK_NB)
AttributeError: 'module' object has no attribute 'flock'

C:\Zope-Instance\bin>
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Making a ZSQL.DA fully multi-threaded?

2004-07-16 Thread sathya
sqlrelay seems to hold some promise for connection pooling although I am
not sure if theres support for sapdb
Brad Clements wrote:
On 16 Jul 2004 at 8:57, Chris Withers wrote:
 

This often means that many more database connections are opened than are
actually necessary. And if you start timing out inactive database
connectiosn on the database side, you're in for a world of pain and
suffering.
I branched ZOracleDA some time ago to move away from this model for that
very reason...
What's the actual problem you're experiencing?
   

I have set the SAPDB timeout to 32400 seconds. However when running with more than 1 
thread I still get "mysterious segfaults" in the sapdbapi component.

The SAP  folks say their adapter is "multi-thread capable", but I've come to believe that only 
means that it's ok to open a connection in one thread and use it in another, but NOT to have 
2 threads make requests on the same connection at the same time.

Also, two threads can' t open a connection "at the same time" because their connection table 
management isn't "thread safe".

What I need, I suppose, is a DB connection pool mechanism of some kind. I also have 
Python extensions that need a connection as well. Getting the actual database connection 
from a DA stinks (ie, it's not really possible). I'd like to see an API extension to ZopeDA's to 
allow Pythonscripts, Products and external methods get an actual db connection. But that I 
suppose is a problem to solve later.

I think I will take a look at ZOracleDA to see what you did. 

 



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] zope 2.7.1 on xp profesional

2004-07-16 Thread Tim Peters
[Chris Johnson]
> I get this error on running runzope installed on xp profesional ibm
> thinkpad.
>
> Any idea what is happening ?
> 
> cj
> 
>
> C:\Zope-Instance\bin>runzope.bat>c:\zopeError.txt
> C:\Program Files\Zope-2.7.1\bin\lib\fcntl.py:7: DeprecationWarning: the FCNTL module 
> is deprecated; please use fcntl

You're in trouble there already.  There shouldn't be a module named

 fcntl.py

in your installation.  There *should* be a module named

 FCNTL.py

instead.  The case is important.  Here from a fresh 2.7.1 installation
on Windows:

C:\Program Files\Zope-2.7.1\bin\Lib>dir/b fc*
FCNTL.py
FCNTL.pyc

C:\Program Files\Zope-2.7.1\bin\Lib>

That's correct.

Can't guess how you got into this trouble.  Unlikely:  if you have an
environment variable named PYTHONCASEOK, get rid of it.
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Making a ZSQL.DA fully multi-threaded?

2004-07-16 Thread Brad Clements
On 16 Jul 2004 at 11:38, Andy Dustman wrote:

> > Also, two threads can' t open a connection "at the same time" because
> > their connection table management isn't "thread safe".
> 
> That does suck, but it doesn't seem like an insurmountable problem for a
> DA. You just need a per-DA instance mutex which you acquire before opening
> a connection release afterwards.

Someone else said that every thread has it's own copy of ZODB, hence their own copies 
of 
each DA. So putting the mutex on the DA won't help this, will it?


-- 
Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
http://www.wecanstopspam.org/   AOL-IM: BKClements

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Where are all the good docs?

2004-07-16 Thread Bryan Simmons
I've recently persuaded my company and our clients that Zope is THE
way to go for Portal software.  Now I find myself having to hack away
at sources more and more to meed their needs.  With that in mind, how
can I find out something like what functions can be called from the
context object?
I've noticed context.absolute_url() and a few others but I find myself
sorely lacking the ability to look up member methods for Zope objects.

Where do I go for info?

-- 

Regards,

Bryan Simmons
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 What is this "sleep" of which you speak?
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: "RewriteMap"s inefficient (was: [Zope-dev] Apache Mod_rewrite question)

2004-07-16 Thread Dieter Maurer
Ganesha Shanmuganathan wrote at 2004-7-15 15:57 -0500:
> ... RewriteMap files with the same name are identified ...
>That is strange! It looks like a bug in mod_rewrite then. I checked the
>source and found that it does compare by map name. Thanks for your
>feedback

But the cache is not taken from a global variable but resolved
via a local resource.

I am not sure what this local resource is (I am no Apache expert).
But, I expect that it is virtual host specific.

-- 
Dieter
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] How to add sections to zope.conf?

2004-07-16 Thread Dieter Maurer
Chris Withers wrote at 2004-7-16 08:52 +0100:
>Dieter Maurer wrote:
>> You must extend the "zopeschema.xml" or let your process use
>> a schema derived from "zopeschema.xml" (schema support some form
>> of inheritance).
>
>Is there any way for a Product to do this or do I actually have to go and 
>manually spank zopeschema.xml when I install my product?

Hm: was the sentence not clear?

Yes, you either must change "zopeschema.xml" or use a different one
(which may inherit from "zopeschema.xml").

There is also a way for the class interpreting the schema
to add configuration options not present in the schema.
See the "add" method in "zdaemon.zdoptions.ZDOptions".
Zope currently does not provide a registration facility
to use this way by products. Of course, you can change
the code...


-- 
Dieter
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] manage_afterAdd +webdav + two times called

2004-07-16 Thread Dieter Maurer
Kai Hoppert wrote at 2004-7-16 10:54 +0200:
>zope2.7.2-RC1
>cmf 1.4.4
>
>i tried and tested a bit around with webdav and noticed that manage_afterAdd is 
>called two times in putting a file into Plone . Yea i know this is not the list for 
>Plone but i think this is more a problem from zope, webdav and cmf. 
>
> File "/var/lib/zope271/lib/python/webdav/NullResource.py", line 110, in PUT
>ob = factory(name, typ, body)
>
>__
> 
>File "/var/lib/zope271/lib/python/webdav/NullResource.py", line 127, in PUT
>self.__parent__._setObject(name, ob)
>
>These two lines from the traceback are the mainproblem i think. First manage 
>manage_afterAdd will be called after creating the Object and second it is called 
>after writing the object into zodb. 

I am sure "manage_afterAdd" is only called in "_setObject" (which writes
the object to ZODB -- in some sense; the actual write happens only during
commit). "manage_afterAdd" is not called before "_setObject".

-- 
Dieter
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: [ZODB-Dev] Getting rid of ZODB versions (was Re: [ZWeb] Are Versions evil?)

2004-07-16 Thread Dieter Maurer
Jim Fulton wrote at 2004-7-15 17:18 -0400:
>Dieter Maurer wrote:
>I don't think anyone find versions useful in cases where
>locks matter.  With versions, if you get resource contention,
>someone loses.

Yes, but hopefully the short running (inexpensive) and not the long running 
(expensive) process...

>Long-running subtransactions as I'm proposing would rely on mult-version
>concurrency control, rather than locks.

MVCC is nice (we already use it) but its help for write
contention is limited. The locks used by the current "Version"s
are better suited for long running transactions.

> In either case, if you have
>resource contention, you are probably out of luck.

Luck is not a binary concept ;-)

Our current most essential use case for "Version"s is reindexing
large catalogs. Reindexing can take hours. It is bad when
the reindexing fails due to a write conflict. It is much
more acceptable when an intervening occational catalog update
fails with a "VersionLockError".

-- 
Dieter
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: [ZODB-Dev] Getting rid of ZODB versions (was Re: [ZWeb] Are Versions evil?)

2004-07-16 Thread Dieter Maurer
Christian Robottom Reis wrote at 2004-7-16 10:27 -0300:
> ...
>> The database itself uses a short-lived lock to generate oids.
>
>Functionality which would be interesting if it were publically available
>to solve the aforementioned problem.

The functionality to get OIDs is there.
It is the "new_oid" method of "Storages".
You can abuse OIDs for "identifies".

-- 
Dieter
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: [ZODB-Dev] Getting rid of ZODB versions (was Re: [ZWeb] Are Versions evil?)

2004-07-16 Thread Christian Robottom Reis
On Fri, Jul 16, 2004 at 07:50:48PM +0200, Dieter Maurer wrote:
> Christian Robottom Reis wrote at 2004-7-16 10:27 -0300:
> > ...
> >> The database itself uses a short-lived lock to generate oids.
> >
> >Functionality which would be interesting if it were publically available
> >to solve the aforementioned problem.
> 
> The functionality to get OIDs is there.
> It is the "new_oid" method of "Storages".
> You can abuse OIDs for "identifies".

Yes, this has been discussed a few times on the list before -- I even
coded up a prototype once.

But, say, wouldn't it be nice if we had a method which we could use
without needing to refer to this as "abuse" ?

Take care,
--
Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 3361 2331
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: [ZODB-Dev] Getting rid of ZODB versions (was Re: [ZWeb] Are Versions evil?)

2004-07-16 Thread Christian Robottom Reis
On Fri, Jul 16, 2004 at 08:39:52PM +0200, Dieter Maurer wrote:
> > In either case, if you have
> >resource contention, you are probably out of luck.
> 
> Luck is not a binary concept ;-)
> 
> Our current most essential use case for "Version"s is reindexing
> large catalogs. Reindexing can take hours. It is bad when
> the reindexing fails due to a write conflict. It is much
> more acceptable when an intervening occational catalog update
> fails with a "VersionLockError".

I am so happy Dieter happens to come up with a perfect Zope-compatible
use-case to justify this.

This is *so* true for any application that isn't a Web application. When
you have long-running transactions with lots of objects being modified,
it is certainly better to deny access to someone else up-front ("This
resource is unavailable. Go get some coffee.") than to let this person
start and then have them either conflict at the end or have *you*
conflict at the end. Yes, it's not something to be used as a rule, but
for certain operations it is just *so* essential.

Take care,
--
Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 3361 2331
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Making a ZSQL.DA fully multi-threaded?

2004-07-16 Thread Ganesha Shanmuganathan
Hi,

On Fri, 2004-07-16 at 09:36, Brad Clements wrote:
> On 16 Jul 2004 at 8:57, Chris Withers wrote:
> 
> > This often means that many more database connections are opened than are
> > actually necessary. And if you start timing out inactive database
> > connectiosn on the database side, you're in for a world of pain and
> > suffering.
> > 
> > I branched ZOracleDA some time ago to move away from this model for that
> > very reason...
> > 
> > What's the actual problem you're experiencing?
> 
> I have set the SAPDB timeout to 32400 seconds. However when running with more than 1 
> thread I still get "mysterious segfaults" in the sapdbapi component.
> 
> The SAP  folks say their adapter is "multi-thread capable", but I've come to believe 
> that only 
> means that it's ok to open a connection in one thread and use it in another, but NOT 
> to have 
> 2 threads make requests on the same connection at the same time.
Yes. It is defined in DBAPI and breaking it is not a good idea as it
will cause problems like when one thread writes data, and another thread
on the same connection wants to read it before the first can commit. 
> 
> Also, two threads can' t open a connection "at the same time" because their 
> connection table 
> management isn't "thread safe".
> 
> What I need, I suppose, is a DB connection pool mechanism of some kind. I also have 
> Python extensions that need a connection as well. Getting the actual database 
> connection 
> from a DA stinks (ie, it's not really possible). I'd like to see an API extension to 
> ZopeDA's to 
> allow Pythonscripts, Products and external methods get an actual db connection. But 
> that I 
> suppose is a problem to solve later.

You have to change ZopeDA to do that. But I doubt if it will be
beneficial. We were experimenting with Pscopg and its Zope adapter.
Psycopg has an option of opening many physical connections (one physical
connection per cursor) to the DB using a non-serialize mode(yes that
part breaks compatibility from DBAPI and suffers from the problem
mentioned above)

When we bench marked using AB, it was found that non serialized mode is
very slow even though the threads were accessing the database in
parallel because of the overhead of setting up new connections. To
implement connection pooling, I think it is best to do it using an
externel product like SQLRelay than at the driver level.

thanks,
ganesh

Zeomega LLC
Open minds' Open Solutions

Plano, Texas, USA
Bangalore, India
phone: 972-731-6750
http://www.zeomega.com


> 
> I think I will take a look at ZOracleDA to see what you did. 
> 

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Where are all the good docs?

2004-07-16 Thread Paul Winkler
On Fri, Jul 16, 2004 at 02:53:20PM -0400, Bryan Simmons wrote:
> I've recently persuaded my company and our clients that Zope is THE
> way to go for Portal software.  Now I find myself having to hack away
> at sources more and more to meed their needs.  With that in mind, how
> can I find out something like what functions can be called from the
> context object?
> I've noticed context.absolute_url() and a few others but I find myself
> sorely lacking the ability to look up member methods for Zope objects.
> 
> Where do I go for info?

Install DocFinder, it's great.
For more info than that, use the source.

-- 

Paul Winkler
http://www.slinkp.com
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Where are all the good docs?

2004-07-16 Thread Paul Winkler
On Fri, Jul 16, 2004 at 05:44:46PM -0400, Paul Winkler wrote:
> On Fri, Jul 16, 2004 at 02:53:20PM -0400, Bryan Simmons wrote:
> > I've recently persuaded my company and our clients that Zope is THE
> > way to go for Portal software.  Now I find myself having to hack away
> > at sources more and more to meed their needs.  With that in mind, how
> > can I find out something like what functions can be called from the
> > context object?
> > I've noticed context.absolute_url() and a few others but I find myself
> > sorely lacking the ability to look up member methods for Zope objects.
> > 
> > Where do I go for info?
> 
> Install DocFinder, it's great.

err, i meant to say DocFinderEverywhere.

-- 

Paul Winkler
http://www.slinkp.com
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Where are all the good docs?

2004-07-16 Thread Bryan Simmons
That product sure does open up a wealth of information but it really
does me no good with understanding what context is and what functions
apply to it

On Fri, 16 Jul 2004 17:45:28 -0400, Paul Winkler <[EMAIL PROTECTED]> wrote:
> On Fri, Jul 16, 2004 at 05:44:46PM -0400, Paul Winkler wrote:
> > On Fri, Jul 16, 2004 at 02:53:20PM -0400, Bryan Simmons wrote:
> > > I've recently persuaded my company and our clients that Zope is THE
> > > way to go for Portal software.  Now I find myself having to hack away
> > > at sources more and more to meed their needs.  With that in mind, how
> > > can I find out something like what functions can be called from the
> > > context object?
> > > I've noticed context.absolute_url() and a few others but I find myself
> > > sorely lacking the ability to look up member methods for Zope objects.
> > >
> > > Where do I go for info?
> >
> > Install DocFinder, it's great.
> 
> err, i meant to say DocFinderEverywhere.
> 
> 
> 
> --
> 
> Paul Winkler
> http://www.slinkp.com
> ___
> Zope-Dev maillist  -  [EMAIL PROTECTED]
> http://mail.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists -
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope )
> 


-- 

Regards,

Bryan Simmons
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 What is this "sleep" of which you speak?
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: "RewriteMap"s inefficient (was: [Zope-dev] Apache Mod_rewrite question)

2004-07-16 Thread Ganesha Shanmuganathan
Hi Dieter,

On Fri, 2004-07-16 at 13:10, Dieter Maurer wrote:
> Ganesha Shanmuganathan wrote at 2004-7-15 15:57 -0500:
> > ... RewriteMap files with the same name are identified ...
> >That is strange! It looks like a bug in mod_rewrite then. I checked the
> >source and found that it does compare by map name. Thanks for your
> >feedback
> 
> But the cache is not taken from a global variable but resolved
> via a local resource.
> 
> I am not sure what this local resource is (I am no Apache expert).
> But, I expect that it is virtual host specific.

>From what I understand, it is stored as static global (as APR table with
APR mutex control for accessing by threads).

I changed it to use key,map_file_name and it works for me. I have a
writeup at http://www.izpug.org/Members/zeomega/mod_rewrite, for more
information in case you are interested.

thanks,
ganesh

Zeomega LLC
Open minds' Open Solutions

Plano, Texas, USA
Bangalore, India
phone: 972-731-6750
http://www.zeomega.com

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Where are all the good docs?

2004-07-16 Thread Paul Winkler
On Fri, Jul 16, 2004 at 07:37:01PM -0400, Bryan Simmons wrote:
> That product sure does open up a wealth of information but it really
> does me no good with understanding what context is and what functions
> apply to it

"context" is a generic name for the current, er, context.
e.g. if i visit http://www.some-zope-site.org/foo/bar/baz,
you could say i am calling baz in the context of bar.
so what methods bar has depends on what kind of object bar is.
That's where docfinder comes in... you visit bar in the ZMI and 
see what it says.

you should also read the zope book...
currently in progress version here:
http://www.plope.com/Books/2_7Edition

-- 

Paul Winkler
http://www.slinkp.com
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )