Re: [Zope-dev] [ZODB-Dev] when did transaction lose the ability to be usable as a context manager?

2013-02-06 Thread Arfrever Frehtes Taifersar Arahesis
2013-02-06 09:57:14 Chris Withers napisał(a):
> I used to do this:
> 
>  >>> import transaction
>  >>> with transaction:
> ...   print 'hello'
> ...
> Traceback (most recent call last):
>File "", line 1, in 
> AttributeError: __exit__
> 
> When did that stop working and what should I now do instead?

http://bugs.python.org/issue9220

-- 
Arfrever Frehtes Taifersar Arahesis


signature.asc
Description: This is a digitally signed message part.
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] [ZODB-Dev] Progress report: porting persistent, BTrees to Python3

2012-12-17 Thread Lennart Regebro
On Mon, Dec 17, 2012 at 10:05 AM, Chris McDonough  wrote:
> On Sun, 2012-12-16 at 22:10 +0100, Godefroid Chapelle wrote:
>> Le 15/12/12 01:52, Tres Seaver a écrit :
>> > I fixed the remainig issues in persistent and released 4.0.5 today:  its
>> > tests properly exercise the C extensions Under Python 3.2 / 3.3.
>>
>> I want to express my thanks to you, Tres, for taking care of that work !
>>
>> This port of ZODB to Python 3 is really a crucial step for the ZTK
>> ecosystem. After the work already done on zope.interface and zope.component.
>>
>> Further, I'd like to also thank Jim for his work on porting buildout.
>>
>> When this will be finished, porting the rest of the ZTK should be much
>> easier, which hopefully implies that more of us will be able to
>> participate.
>
> Hear, hear!

+lots
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] [ZODB-Dev] Progress report: porting persistent, BTrees to Python3

2012-12-17 Thread Chris McDonough
On Sun, 2012-12-16 at 22:10 +0100, Godefroid Chapelle wrote:
> Le 15/12/12 01:52, Tres Seaver a écrit :
> > I fixed the remainig issues in persistent and released 4.0.5 today:  its
> > tests properly exercise the C extensions Under Python 3.2 / 3.3.
> 
> I want to express my thanks to you, Tres, for taking care of that work !
> 
> This port of ZODB to Python 3 is really a crucial step for the ZTK 
> ecosystem. After the work already done on zope.interface and zope.component.
> 
> Further, I'd like to also thank Jim for his work on porting buildout.
> 
> When this will be finished, porting the rest of the ZTK should be much 
> easier, which hopefully implies that more of us will be able to 
> participate.

Hear, hear!

- C


___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] [ZODB-Dev] [announce] NEO 1.0 - scalable and redundant storage for ZODB

2012-08-29 Thread Jim Fulton
On Tue, Aug 28, 2012 at 12:31 PM, Vincent Pelletier  wrote:
...
> I forgot in the original mail to mention that NEO does all conflict
> resolutions on client side rather than server side. The same happens in
> relStorage, but this is different from ZEO.

That's good.  I'd like to move ZEO in this direction.  I'd also
like to stop hanging conflict-resolution on classes and have
some kind of registry, so that people can set CR policies
independent of class implementation.

I didn't realize that relstorage did client side CR, but thinking
about it, it has to work that way, since there's no relstorage
server.

Jim

-- 
Jim Fulton
http://www.linkedin.com/in/jimfulton
Jerky is better than bacon! http://zo.pe/Kqm
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] [ZODB-Dev] [announce] NEO 1.0 - scalable and redundant storage for ZODB

2012-08-29 Thread Jim Fulton
On Wed, Aug 29, 2012 at 2:29 AM, Marius Gedminas  wrote:
> On Tue, Aug 28, 2012 at 06:31:05PM +0200, Vincent Pelletier wrote:
>> On Tue, 28 Aug 2012 16:31:20 +0200,
>> Martijn Pieters  wrote :
>> > Anything else different? Did you make any performance comparisons
>> > between RelStorage and NEO?
>>
>> I believe the main difference compared to all other ZODB Storage
>> implementation is the finer-grained locking scheme: in all storage
>> implementations I know, there is a database-level lock during the
>> entire second phase of 2PC, whereas in NEO transactions are serialised
>> only when they alter a common set of objects.
>
> This could be a compelling point.  I've seen deadlocks in an app that
> tried to use both ZEO and PostgreSQL via the Storm ORM.  (The thread
> holding the ZEO commit lock was blocked waiting for the PostgreSQL
> commit to finish, while the PostgreSQL server was waiting for some other
> transaction to either commit or abort -- and that other transaction
> couldn't proceed because it was waiting for the ZEO lock.)

This sounds like an application/transaction configuration problem.
To avoid this sort of deadlock, you need to always commit in a
a consistent order.  You also need to configure ZEO (or NEO)
to time-out transactions that take too long to finish the second phase.

I don't think NEO's locking strategy mitigates the deadlock problem
much, if at all.

The strategy should provide greater transaction throughput and
reduce latency.  It's a strategy I'd like to implement for ZEO at some
point.

Jim

-- 
Jim Fulton
http://www.linkedin.com/in/jimfulton
Jerky is better than bacon! http://zo.pe/Kqm
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] [ZODB-Dev] [announce] NEO 1.0 - scalable and redundant storage for ZODB

2012-08-28 Thread Marius Gedminas
On Tue, Aug 28, 2012 at 06:31:05PM +0200, Vincent Pelletier wrote:
> On Tue, 28 Aug 2012 16:31:20 +0200,
> Martijn Pieters  wrote :
> > Anything else different? Did you make any performance comparisons
> > between RelStorage and NEO?
> 
> I believe the main difference compared to all other ZODB Storage
> implementation is the finer-grained locking scheme: in all storage
> implementations I know, there is a database-level lock during the
> entire second phase of 2PC, whereas in NEO transactions are serialised
> only when they alter a common set of objects.

This could be a compelling point.  I've seen deadlocks in an app that
tried to use both ZEO and PostgreSQL via the Storm ORM.  (The thread
holding the ZEO commit lock was blocked waiting for the PostgreSQL
commit to finish, while the PostgreSQL server was waiting for some other
transaction to either commit or abort -- and that other transaction
couldn't proceed because it was waiting for the ZEO lock.)

Marius Gedminas
-- 
People who think, "Oh this is a one-off," need to be offed, or perhaps politely
removed from the project.
-- George Neville-Neil


signature.asc
Description: Digital signature
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] [ZODB-Dev] [announce] NEO 1.0 - scalable and redundant storage for ZODB

2012-08-28 Thread Vincent Pelletier
On Tue, 28 Aug 2012 16:31:20 +0200,
Martijn Pieters  wrote :
> Anything else different? Did you make any performance comparisons
> between RelStorage and NEO?

I believe the main difference compared to all other ZODB Storage
implementation is the finer-grained locking scheme: in all storage
implementations I know, there is a database-level lock during the
entire second phase of 2PC, whereas in NEO transactions are serialised
only when they alter a common set of objects.
This removes an argument in favour of splitting databases (ie, using
mountpoints): evading the tpc_vote..tpc_finish database-level locking.

Also, NEO distributes objects over several servers (aka, some or all
servers might not contain the whole database), for load balancing/
parallelism purposes. This is not possible if one relies on relational
database replication alone.

I forgot in the original mail to mention that NEO does all conflict
resolutions on client side rather than server side. The same happens in
relStorage, but this is different from ZEO. Packing on client side
makes it easier to get the setup right: with ZEO you will get more
conflicts than normal if it cannot load some class which implements
conflict resolution, and this might go unnoticed until someone worries
about a performance drop or so. With client-side resolution, if you
don't see Broken Objects, conflict resolution for those classes works.

Some comments on some points you mentioned:
> * NEO supports MySQL and sqlite, RelStorage MySQL, PostgreSQL and
> Oracle.

It should be rather easy to adapt to more back-ends.
We (Nexedi) are not interested in proprietary software, so we will
probably not implement Oracle support ourselves. For PostgreSQL, it's
just that we do not have a setup at hand and the experience to
implement a client properly. I expect that it would not take more than a
week to get PostgreSQL implemented by someone used to it and knowing
python, but new to NEO.

Just to demonstrate that NEO really does not rely on fancy features of
SQL servers, you may dig in older revisions in NEO's git repository. You
can find a "btree.py"[1] test storage, which is based on ZODB.BTree
class. It was just a toy, without persistence support (I initially
intended to provide it, but never finished it) and hence limited by
the available amount of RAM. But it was otherwise a fully functional NEO
storage backend. I think it took me a week-end to put it together,
while discovering ZODB.Btree API and adapting NEO's storage backend
API along the way (this was the first non-MySQL backend ever
implemented, so API was a bit too ad-hoc at that time).

sqlite was chosen as a way to get rid of the need to setup a
stand-alone SQL server in addition to NEO storage process. We are not
sure yet of how well our database schema holds when there are several
(10+) GB of data in each storage node.

> * RelStorage can act as a BlobStorage, NEO can not.

I would like to stress that this has nothing to do with design, rather
it's just not implemented. We do not wish to rely on filesystem-level
sharing, so we consider something along the lines of providing a
FUSE-based to share blob storage, which then can abstract the blobs
being distributed over several servers. This is just the general idea,
we don't have much experience with blob handling ourselves (which is
why we preferred to leave it asides rather than providing an
unrealistic - and hence unusable - implementation).

[1]http://git.erp5.org/gitweb/neoppod.git/blob/75d83690bd4a34cfe5ed83c949e4a32c7dec7c82:/neo/storage/database/btree.py

Regards,
-- 
Vincent Pelletier
ERP5 - open source ERP/CRM for flexible enterprises
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] [ZODB-Dev] [announce] NEO 1.0 - scalable and redundant storage for ZODB

2012-08-28 Thread Martijn Pieters
On Mon, Aug 27, 2012 at 2:37 PM, Vincent Pelletier  wrote:
> NEO aims at being a replacement for use-cases where ZEO is used, but
> with better scalability (by allowing data of a single database to be
> distributed over several machines, and by removing database-level
> locking), with failure resilience (by mirroring database content among
> machines). Under the hood, it relies on simple features of SQL
> databases (safe on-disk data structure, efficient memory usage,
> efficient indexes).

How does NEO compare to RelStorage? NEO appears to implement the
storage roughly in the same way; store pickles in tables in a SQL
database.

Some differences that I can see from reading your email:

* NEO takes care of replication itself; RelStorage pushes that
responsibility to the database used.
* NEO supports MySQL and sqlite, RelStorage MySQL, PostgreSQL and Oracle.
* RelStorage can act as a BlobStorage, NEO can not.

Anything else different? Did you make any performance comparisons
between RelStorage and NEO?

-- 
Martijn Pieters
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] [ZODB-Dev] [announce] NEO 1.0 - scalable and redundant storage for ZODB

2012-08-28 Thread Vincent Pelletier
On Mon, 27 Aug 2012 14:37:37 +0200,
Vincent Pelletier  wrote :
> Under the hood, it relies on simple features of SQL databases

To make things maybe a bit clearer, from the feedback I get:
You can forget about SQL presence. NEO usage of SQL is as a relational
as a handful of python dicts is. Except there is no way to load only
part of a pickled dict, or do range searches (ZODB's BTrees are much
better in this regard), or writable to disk atomically without having to
implement this level of atomicity ourselves.

Ideally, NEO would use something like libhail, or maybe even simpler
like kyotocabinet (except that we need composed keys, and kyotocabinet
b-trees have AFAIK no such notion).
SQL as a data definition language was simply too convenient during
development (need a new column ? easy, even if you have a 40GB table),
and it stuck - and we have yet to find a significant drawback to
implement a new storage backend.

As a side effect, SQL allows gathering some statistics over the data
contained in a database very efficiently. Number of current objects,
number of revisions per object, number of transactions, when
transactions occured in base history, average object size, largest
object, you name it.

-- 
Vincent Pelletier
ERP5 - open source ERP/CRM for flexible enterprises
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] [ZODB-Dev] [announce] NEO 1.0 - scalable and redundant storage for ZODB

2012-08-27 Thread Lennart Regebro
On Mon, Aug 27, 2012 at 2:37 PM, Vincent Pelletier  wrote:
> Hi,
>
> We've just tagged the 1.0 NEO release.
>
> NEO aims at being a replacement for use-cases where ZEO is used, but
> with better scalability (by allowing data of a single database to be
> distributed over several machines, and by removing database-level
> locking), with failure resilience (by mirroring database content among
> machines). Under the hood, it relies on simple features of SQL
> databases (safe on-disk data structure, efficient memory usage,
> efficient indexes).

That sounds pretty cool!
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] [ZODB-Dev] SVN: ZODB/trunk/ Note split of persistent.

2012-08-25 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 08/25/2012 10:24 AM, Hanno Schlichting wrote:
> Could you add zope.wineggbuilder on PyPi as a maintainer to the new 
> standalone persistent package? That way we can automatically build 
> Windows eggs for it, the same way we do for all other packages with C 
> extensions.

Done.

>> type(1073741697 * 1024)
>>> 
>>> 
>>> What does that yield on the Windows box?
> 
>  sys.maxint is 2**31 - 1


FWIW, 1073741697 * 1024 requires 40-bits, which obviously won't fit into
an int on 32-bit Windows.  It is also an absurdly large size for a
pickle:  we could probably just use 1073741697 * 4 for that test.



Tres.
- -- 
===
Tres Seaver  +1 540-429-0999  tsea...@palladion.com
Palladion Software   "Excellence by Design"http://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlA5JvsACgkQ+gerLs4ltQ6GRACgvzYP+t4ifDS6E1kZDtIXcJtd
d8AAnj0RwHopptEbEh9wb3f0DWiYJKsu
=gBVm
-END PGP SIGNATURE-
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] [ZODB-Dev] RFC: release persistent as a standalone package

2012-07-03 Thread Lennart Regebro
On Mon, Jul 2, 2012 at 7:35 PM, Alan Runyan  wrote:
>> I would like to release a '4.0.0' version of the package, and switch
>> the ZODB trunk to pull it in as a dependency (deleting the currently
>> included (older) copy of persistent).  One possible issue is that I
>> have not (yet) made the C extensions work under Python 3.2:  I don't
>> know whether that should be a blocker for a release.
>
> I do not believe its a blocker. That is a "feature" that could be added.
>
>> Comments?
>
> You rock.

+1
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] [ZODB-Dev] RFC: release persistent as a standalone package

2012-07-02 Thread Alan Runyan
> I would like to release a '4.0.0' version of the package, and switch
> the ZODB trunk to pull it in as a dependency (deleting the currently
> included (older) copy of persistent).  One possible issue is that I
> have not (yet) made the C extensions work under Python 3.2:  I don't
> know whether that should be a blocker for a release.

I do not believe its a blocker. That is a "feature" that could be added.

> Comments?

You rock.

-- 
Alan Runyan

Skype/Twitter:: runyaga
Office:: 713.942.2377 ext 111
http://ploud.com/  Plone site in less than 10 seconds
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] [ZODB-Dev] RFC: release persistent as a standalone package

2012-07-01 Thread Laurence Rowe
On 1 July 2012 02:16, Leonardo Rochael Almeida  wrote:
> I'm +1 on the change even without the answer to my next question, but
> can you elaborate on what is the advantage of releasing persistent
> appart from ZODB?

As well as the clearer separation of concerns it opens up the
possibility for other persistence systems to adopt persistent for
detecting changes to mapped objects, gaining the benefit of its fast C
implementation. The BTrees package is also useful outside the context
of the ZODB.

Laurence
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] [ZODB-Dev] RFC: release persistent as a standalone package

2012-06-30 Thread Leonardo Rochael Almeida
Hi Tres,

I'm +1 on the change even without the answer to my next question, but
can you elaborate on what is the advantage of releasing persistent
appart from ZODB?

Regards,

Leo

On Sat, Jun 30, 2012 at 8:02 PM, Tres Seaver  wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> I have completed the work needed to make 'persistent' distributable
> as a standalone package.  The effort (begun almost four years ago!)
> includes the following highlights:
>
> Platform Changes
> - 
>
> - - Added explicit support for Python 3.2 and PyPy.
>
>  - Note that the C implementations of Persistent, PickleCache, and
>    Timestamp are not built (yet) on these platforms.
>
> - - Dropped explicit support for Python < 2.6.
>
> - - Completed pure-Python reference implementations of 'Persistent',
>  'PickleCache', and 'TimeStamp'.
>
> Testing Changes
> - ---
>
> - - 100% unit test coverage.
>
> - - All covered platforms tested under 'tox'.
>
> - - Refactored some doctests as unittests.
>
> - - Removed all 'ZODB'-dependent tests:
>
>  - Rewrote some to avoid the dependency
>
>  - Cloned the remainder into new 'ZODB.tests' modules on the ZODB
>    trunk.
>
> - - Added support for continuous integration using 'tox' and 'jenkins'.
>
> - - Added 'setup.py dev' alias (installs 'nose' and 'coverage').
>
> - - Dropped dependency on 'zope.testing' / 'zope.testrunner':  tests now
>  run with 'setup.py test'.
>
> Documentation Changes
> - -
>
> - - Refactored many doctests as Sphinx documentation
>  (snippets are exercised via 'tox').
>
> - - Added 'setup.py docs' alias (installs 'Sphinx' and
>  'repoze.sphinx.autointerface').
>
>
> I would like to release a '4.0.0' version of the package, and switch
> the ZODB trunk to pull it in as a dependency (deleting the currently
> included (older) copy of persistent).  One possible issue is that I
> have not (yet) made the C extensions work under Python 3.2:  I don't
> know whether that should be a blocker for a release.
>
> Comments?
>
>
> Tres.
> - --
> ===
> Tres Seaver          +1 540-429-0999          tsea...@palladion.com
> Palladion Software   "Excellence by Design"    http://palladion.com
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.11 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAk/vPyMACgkQ+gerLs4ltQ4DsgCfRsKhBzvTWHehVI86I5sryhjF
> whQAoL3evyI6GKOfa7eDVjTUVh7B8Q+/
> =82vd
> -END PGP SIGNATURE-
>
> ___
> For more information about ZODB, see http://zodb.org/
>
> ZODB-Dev mailing list  -  zodb-...@zope.org
> https://mail.zope.org/mailman/listinfo/zodb-dev
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] ZODB Mountpoint broken?

2012-02-29 Thread Suresh V.

On Wednesday 29 February 2012 07:31 PM, Tres Seaver wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 02/28/2012 09:56 PM, Suresh V. wrote:

ZODB Mountpoint distributed with Plone 4.1.2 always seems to create
OFS.Folder even if the container-class is specified.

Also getting a "KeyError: item already present wih same id" due to
_setObject and _setOb both being called.



Can you post the full traceback for that error?


2012-03-01 09:40:22 ERROR Zope.SiteErrorLog 1330575022.340.697799684491 
http://localhost:8080/Plone/AllContent/manage_addProduct/ZODBMountPoint/manage_addMounts

Traceback (innermost last):
  Module ZPublisher.Publish, line 126, in publish
  Module ZPublisher.mapply, line 77, in mapply
  Module ZPublisher.Publish, line 46, in call_object
  Module Products.ZODBMountPoint.MountedObject, line 387, in 
manage_addMounts

  Module plone.folder.ordered, line 63, in _setOb
  Module Products.BTreeFolder2.BTreeFolder2, line 244, in _setOb
KeyError: 'There is already an item named "plant".'





___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] ZODB Mountpoint broken?

2012-02-29 Thread Suresh V.

On Wednesday 29 February 2012 07:31 PM, Tres Seaver wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 02/28/2012 09:56 PM, Suresh V. wrote:

ZODB Mountpoint distributed with Plone 4.1.2 always seems to create
OFS.Folder even if the container-class is specified.

Also getting a "KeyError: item already present wih same id" due to
_setObject and _setOb both being called.



Can you post the full traceback for that error?



In Products.ZODBMountPoint.MountedObject.py around line 373:

# Add a faux object to avoid generating manage_afterAdd() events
# while appeasing OFS.ObjectManager._setObject(), then discreetly
# replace the faux object with a MountedObject.
faux = Folder()
faux.id = mo.id
faux.meta_type = loaded.meta_type
container._setObject(faux.id, faux)
# DM 2005-05-17: we want to keep our decision about automatic
#  mount point creation
#del mo._create_mount_points
container._setOb(faux.id, mo)
setMountPoint(container, faux.id, mo)

The error was raised on the _setOb() line.

Removing the whole faux dance made everything work correctly. May be 
this is not necessary any more. Should I create a ticket?







Am trying to mount a plone.app.folder.folder.ATFolder from a separate
  Data.fs using instructions in:

http://plone.org/documentation/kb/mount-zeo-into-plonesite



Tres.
- --
===
Tres Seaver  +1 540-429-0999  tsea...@palladion.com
Palladion Software   "Excellence by Design"http://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9OL8AACgkQ+gerLs4ltQ6KXgCfUSmkU98w0QP3++tzXnmqdClr
0eMAn0XmTpASam2I2zD80b+IF9ONhoTk
=hNK7
-END PGP SIGNATURE-

___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
  https://mail.zope.org/mailman/listinfo/zope-announce
  https://mail.zope.org/mailman/listinfo/zope )




___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] ZODB Mountpoint broken?

2012-02-29 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 02/28/2012 09:56 PM, Suresh V. wrote:
> ZODB Mountpoint distributed with Plone 4.1.2 always seems to create 
> OFS.Folder even if the container-class is specified.
> 
> Also getting a "KeyError: item already present wih same id" due to 
> _setObject and _setOb both being called.


Can you post the full traceback for that error?


> Am trying to mount a plone.app.folder.folder.ATFolder from a separate
>  Data.fs using instructions in:
> 
> http://plone.org/documentation/kb/mount-zeo-into-plonesite


Tres.
- -- 
===
Tres Seaver  +1 540-429-0999  tsea...@palladion.com
Palladion Software   "Excellence by Design"http://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9OL8AACgkQ+gerLs4ltQ6KXgCfUSmkU98w0QP3++tzXnmqdClr
0eMAn0XmTpASam2I2zD80b+IF9ONhoTk
=hNK7
-END PGP SIGNATURE-

___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] ZODB Mountpoint broken?

2012-02-28 Thread Suresh V.
ZODB Mountpoint distributed with Plone 4.1.2 always seems to create 
OFS.Folder even if the container-class is specified.


Also getting a "KeyError: item already present wih same id" due to 
_setObject and _setOb both being called.


Am trying to mount a plone.app.folder.folder.ATFolder from a separate 
Data.fs using instructions in:


http://plone.org/documentation/kb/mount-zeo-into-plonesite

___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] [ZODB-Dev] transaction as context manager, exception during commit

2011-02-24 Thread Chris Withers
On 24/02/2011 11:38, Laurence Rowe wrote:
>> Hi Jim,
>>
>> The current __exit__ for transaction managers looks like this:
>>
>>  def __exit__(self, t, v, tb):
>>  if v is None:
>>  self.commit()
>>  else:
>>  self.abort()
>>
>> ..which means that if you're using the transaction package as a context
>> manager and, say, a relational database integrity constraint is
>> violated, then you're left with a hosed transaction that still needs
>> aborting.
>>
>> How would you feel about the above changing to:
>>
>>  def __exit__(self, t, v, tb):
>>  if v is None:
>>  try:
>>  self.commit()
>>  except:
>>  self.abort()
>>  raise
>>  else:
>>  self.abort()
>>
>> If this is okay, I'll be happy to write the tests and make the changes
>> provided someone does a release when I have...
>
> Looking at the way ZPublisher handles this, I think you're right.

Cool, I'll wait for Jim's verdict (and some time to implement it ;-)) 
before diving in...

> I
> think you might also need to modify the __exit__ in Attempt, which
> additionally handles retrying transactions that fail.

Yeah, I see a bug relating to this was reported yesterday:

https://bugs.launchpad.net/bugs/724332

I know it's a different problem, but sounds like the code for attempt 
needs some love...

cheers,

Chris

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


Re: [Zope-dev] [ZODB-Dev] transaction as context manager, exception during commit

2011-02-24 Thread Laurence Rowe
On 24 February 2011 10:17, Chris Withers  wrote:
> Hi Jim,
>
> The current __exit__ for transaction managers looks like this:
>
>     def __exit__(self, t, v, tb):
>         if v is None:
>             self.commit()
>         else:
>             self.abort()
>
> ..which means that if you're using the transaction package as a context
> manager and, say, a relational database integrity constraint is
> violated, then you're left with a hosed transaction that still needs
> aborting.
>
> How would you feel about the above changing to:
>
>     def __exit__(self, t, v, tb):
>         if v is None:
>             try:
>                 self.commit()
>             except:
>                 self.abort()
>                 raise
>         else:
>             self.abort()
>
> If this is okay, I'll be happy to write the tests and make the changes
> provided someone does a release when I have...

Looking at the way ZPublisher handles this, I think you're right. I
think you might also need to modify the __exit__ in Attempt, which
additionally handles retrying transactions that fail.

Laurence
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] [ZODB-Dev] Bug (?) in zope/publisher/publish.py:unwrapMethod

2011-01-26 Thread Vincent Pelletier
Le mercredi 26 janvier 2011 08:54:02, Vincent Pelletier a écrit :
> For some reason, I didn't see your mail on zope-dev

As this mail reached the list, I think Tres' mail got caught by some filter. 
Original mail was:

In publish.py[1], unwrapMethod tried to find what can be used to publish an 
object. In a site, I had someone create a very-badly-named "func_code" 
external method in a place accessible by acquisition from every page on the 
site (this bad by itself, and I corrected it already). This caused 
unwrapMethod to think it can use any object directly for publishing, because 
of:

elif getattr(unwrapped, 'func_code', None) is not None:
break

and "unwrapped" is still in an acquisition context.

Shouldn't the checks be done on unwrapped (from acquisition context) objects 
instead, to prevent such stupid mistake to have such a wide impact.

I have the intuition that this could even be a security problem, allowing an 
unexpected object to be called instead of another, but I cannot come out with 
an example.

Do you think there is anything to fix in zope.publisher[2] ? If so, I'll open 
a bug.

[1] 
http://svn.zope.org/zope.publisher/trunk/src/zope/publisher/publish.py?view=markup
[2] following Tres' answer, make this "Zope2's mapply"

Regards,
-- 
Vincent Pelletier
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] [ZODB-Dev] Bug (?) in zope/publisher/publish.py:unwrapMethod

2011-01-26 Thread Vincent Pelletier
Le mardi 25 janvier 2011 19:08:11, Tres Seaver a écrit :
> The Zope2-specific version of 'mapply()' (in 'ZPublisher.mapply') is the
> right place to fix this issue, if it is to be fixed:

Thanks for the info.

> P.S. This issue is off-topic for the ZODB list:  I have cross-posted
>  to 'zope-dev':  please follow up there.

Woops, lazy typing and wrong mail client completion. I indeed intended it for 
zope-dev.
For some reason, I didn't see your mail on zope-dev (I checked the archives 
too, but they might be lagging).

-- 
Vincent Pelletier
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] ZODB replication and high-availability across data centers

2010-10-21 Thread Benji York
On Thu, Oct 21, 2010 at 11:32 AM, Andreas Jung  wrote:
> we are currently investigating options for a large-scale solution
> where the machines (ZEO clients and ZEO server) should be separated
> across two data centers. Incoming traffic should be balanced between
> both data centers. Automatic failover and online-replication are
> desirable - "high-performance" is a must.

Do you need to have each data center write to the database(s)?
-- 
Benji York
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] ZODB replication and high-availability across data centers

2010-10-21 Thread Andreas Jung
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

sorry, wrong list :>

Andreas Jung wrote:
> Hi there,
> 
> we are currently investigating options for a large-scale solution
> where the machines (ZEO clients and ZEO server) should be separated
> across two data centers. Incoming traffic should be balanced between
> both data centers. Automatic failover and online-replication are
> desirable - "high-performance" is a must.
> 
> The well-known options are:
> 
> ZRS
> (ZEO)
> Relstorage on top of some RDBMS-related clustering/replication mechanism
> NEO
> DRDB
> ZEORaid
> 
> Has anyone worked on such a setup or may share some experiences -
> especially by using one of the options above across data-centers
> (with a limited bandwidth inbetween and a higher latency compared to LAN).
> 
> Andreas
> 
> -- ZOPYX Limited   | zopyx group
> Charlottenstr. 37/1 | The full-service network for Zope & Plone
> D-72070 Tübingen| Produce & Publish
> www.zopyx.com   | www.produce-and-publish.com
> 
> E-Publishing, Python, Zope & Plone development, Consulting
> 
> 

___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


- -- 
ZOPYX Limited   | zopyx group
Charlottenstr. 37/1 | The full-service network for Zope & Plone
D-72070 Tübingen| Produce & Publish
www.zopyx.com   | www.produce-and-publish.com
- 
E-Publishing, Python, Zope & Plone development, Consulting


-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQGUBAEBAgAGBQJMwF+lAAoJEADcfz7u4AZjIkALvR503XjqmYeV16kgcOtgHdGR
siQWM3UMniZQ2ztamUF6d13pDl28HRvfgf8eQMLMHXQ76n0GH6zpK6I53nq88xbH
7K5kqc82GHDnG/SzwwKOEusQrnNdbjIGxLGbEQ7w3kiKy+DdAZG1cBpc/PSQDWFj
opHVVozJ6R7HNldiAoghPR3gORqTYy71txdQNttUxGJXi+nMW0z+G2pN2OUrbb76
QY6F1p5nXrDsotXu6IEePGqBbQNltWOnSZOzDavqF5Fa5rnoD8xMCU8LsA7l+vCS
mLGMHLEs4pCcZuxA0rU/zaWJOl+xMFkvP1jMSlmlX8hF4poPpfIsQ+zSEFlhdECo
6Qncx+2DyrTjPS0SyOOgSCFH+L3rwIIqPaiFgslk0Md+gS1u+rITMn4w+QXKbaTM
7s5PKAaCK0KFDmDO1l+1meeSqgqtMd531swj4He8zCIO91BGnzcbck6p9LFeYHZl
4qXO/zgWFQdt2dsK6qDVF1Cj1Brv9m0=
=BKkk
-END PGP SIGNATURE-
<>___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] ZODB replication and high-availability across data centers

2010-10-21 Thread Andreas Jung
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi there,

we are currently investigating options for a large-scale solution
where the machines (ZEO clients and ZEO server) should be separated
across two data centers. Incoming traffic should be balanced between
both data centers. Automatic failover and online-replication are
desirable - "high-performance" is a must.

The well-known options are:

ZRS
(ZEO)
Relstorage on top of some RDBMS-related clustering/replication mechanism
NEO
DRDB
ZEORaid

Has anyone worked on such a setup or may share some experiences -
especially by using one of the options above across data-centers
(with a limited bandwidth inbetween and a higher latency compared to LAN).

Andreas

- -- ZOPYX Limited   | zopyx group
Charlottenstr. 37/1 | The full-service network for Zope & Plone
D-72070 Tübingen| Produce & Publish
www.zopyx.com   | www.produce-and-publish.com
- 
E-Publishing, Python, Zope & Plone development, Consulting


-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQGUBAEBAgAGBQJMwFz+AAoJEADcfz7u4AZjMVkLwMgvSXHn564MnY+sFRGPLzw9
QodFNHTtWkZ4m0GyCPbACMEdC3CuHjjO9nvitgSX/8Lg6xweFsly1XwBl6rbc4xO
KU1/mpjDrvUI4JRjpOge0DZAomRgOmsQYtw1555EV2VGqssvCb3u12J6/ivSLA4v
AdRbAAvrErVX/tIZzqVV2X95KUqg/6UUfGt6BWYx7v5UXzHN4IUnKvGO41bY2XVR
ykd8H0ZEetf1UVBb6nngr8PKhg22HKre6Q8zhyv4dcMoIyOxJHTKQbhnbYkv33VO
CmEa2wUKd9oMN1LvPX+3/TtQm+EB/iQ8uSPFtubwJNkk5M/M3v8vAnlqwj16WfLL
vwgwRjm/N5NxyYZGvWYG3ipEnAv7SNBtbnVd4Y1gVCQHqOV/HpWIWuIm5iAbnWRG
qRI/KExIhZ1dSZJDNXPXNyPcThvL9DoJDhHJE8nkeBLHYd+tI5X0djWAgFiMaabc
2tSJkA/oeHM/ItZB4FwW6c/pIip//5A=
=oZxs
-END PGP SIGNATURE-
<>___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] ZODB history problem with Zope 2.12.7

2010-09-28 Thread Chris Withers
On 28/09/2010 12:55, Tres Seaver wrote:
> On 09/28/2010 03:36 AM, Chris Withers wrote:
>> On 28/09/2010 00:12, Marius Gedminas wrote:
>>> --- ./OFS/History.py.orig   2010-09-28 02:11:56.535745440 +0300
>>> +++ ./OFS/History.py2010-09-28 02:12:00.043764683 +0300
>>> @@ -151,6 +151,9 @@
>>>base = aq_base(self)
>>>base._p_activate()   # make sure we're not a ghost
>>>base.__setstate__(state) # change the state
>>> +for attr in dir(base):
>>> +if attr.startswith('_v_'):
>>> +delattr(base, attr)
>>>base._p_changed = True   # marke object as dirty
>>>self.manage_afterHistoryCopy()
>>
>> Thanks, I guess I'll monkey patch for now, here's the bug:
>>
>> https://bugs.launchpad.net/zope2/+bug/649605
>>
>> However, I'm curious, so the above will fix the object in the current
>> thread, but what about objects in other threads?
>>
>> (or do _v_ attributes get killed off at the start of each transaction?)
>
> Only when objects are ghostified (due to an invalidation from another
> thread or process) or evicted from the cache.  I'm not quite sure how
> the case you are triggering occurs, but if that code saves the new-old
> version of the template to the ZODB, then any instances in other
> threads' connection caches should be invalidated.

Feel free to repeat the steps I originally posted and are in the bug 
description ;-)

Looks like the History.py code isn't doing something it should, but I 
don't know when or what changed to make this so. I'll CC zodb-dev in 
case Jim knows of any changes in ZODB (I'm using 3.9.6) that might be 
relevant...

cheers,

Chris

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


Re: [Zope-dev] [ZODB-Dev] attempting to undo an un-undoable transaction gives "NotImplementedError" with ZODB 3.9.5

2010-09-10 Thread Jim Fulton
On Fri, Sep 10, 2010 at 2:27 AM, Chris Withers  wrote:
> On 09/09/2010 21:47, Jim Fulton wrote:
>>>
>>> 2010-08-26 22:49:01 ERROR txn.-1338986496 Failed to abort resource
>>> manager:>> object at 0x2d509f0>  at 47516176>
>>> Traceback (most recent call last):
>>>   File "transaction-1.1.0-py2.6.egg/transaction/_transaction.py", line
>>> 475, in abort
>>>     rm.abort(self)
>>>   File "transaction-1.1.0-py2.6.egg/transaction/_transaction.py", line
>>> 548, in abort
>>>     self.manager.abort(o, txn)
>>>   File "ZODB3-3.9.5-py2.6-macosx-10.3-fat.egg/ZODB/DB.py", line 985, in
>>> abort
>>>     raise NotImplementedError
>>> NotImplementedError
>>>
>>> This used to give a meaningful error message.
>>
>> In 3.7 and earlier.
>>
>>>
>>> Anyone know why it no longer does?
>>
>> The resource manager abort method used to be a pass. In 3.9 in raises
>> an exception, which hides the undo exception.
>
> That's bad, right?

It's affect on zope users is, but arguably because Zope 2 is(/was?)
misshandling the exception.  It shouldn't let an exception raised while
handling the original exception hide the original exception. (Of course,
this is a common mistake. I've made it many times myself. :)

>> An app should capture
>> the undo exception information before calling abort.
>
> "the app" here is Zope 2's publisher process, right?

I guess. :)

>
>> My guess is that this works much better in ZODB 3.10.
>
> Any particular reason?

Because the undo handling was rewritten for 3.10. It was a mess for some time
before.

Jim

-- 
Jim Fulton
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] [ZODB-Dev] attempting to undo an un-undoable transaction gives "NotImplementedError" with ZODB 3.9.5

2010-09-09 Thread Chris Withers
On 09/09/2010 21:47, Jim Fulton wrote:
>> 2010-08-26 22:49:01 ERROR txn.-1338986496 Failed to abort resource
>> manager:> object at 0x2d509f0>  at 47516176>
>> Traceback (most recent call last):
>>File "transaction-1.1.0-py2.6.egg/transaction/_transaction.py", line
>> 475, in abort
>>  rm.abort(self)
>>File "transaction-1.1.0-py2.6.egg/transaction/_transaction.py", line
>> 548, in abort
>>  self.manager.abort(o, txn)
>>File "ZODB3-3.9.5-py2.6-macosx-10.3-fat.egg/ZODB/DB.py", line 985, in
>> abort
>>  raise NotImplementedError
>> NotImplementedError
>>
>> This used to give a meaningful error message.
>
> In 3.7 and earlier.
>
>>
>> Anyone know why it no longer does?
>
> The resource manager abort method used to be a pass. In 3.9 in raises
> an exception, which hides the undo exception.

That's bad, right?

> An app should capture
> the undo exception information before calling abort.

"the app" here is Zope 2's publisher process, right?

> My guess is that this works much better in ZODB 3.10.

Any particular reason?

Chris

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


Re: [Zope-dev] [ZODB-Dev] attempting to undo an un-undoable transaction gives "NotImplementedError" with ZODB 3.9.5

2010-09-09 Thread Jim Fulton
On Thu, Aug 26, 2010 at 5:51 PM, Chris Withers  wrote:
> Here's an example:
>
> 2010-08-26 22:49:01 ERROR txn.-1338986496 Failed to abort resource
> manager:  object at 0x2d509f0> at 47516176>
> Traceback (most recent call last):
>   File "transaction-1.1.0-py2.6.egg/transaction/_transaction.py", line
> 475, in abort
>     rm.abort(self)
>   File "transaction-1.1.0-py2.6.egg/transaction/_transaction.py", line
> 548, in abort
>     self.manager.abort(o, txn)
>   File "ZODB3-3.9.5-py2.6-macosx-10.3-fat.egg/ZODB/DB.py", line 985, in
> abort
>     raise NotImplementedError
> NotImplementedError
>
> This used to give a meaningful error message.

In 3.7 and earlier.

>
> Anyone know why it no longer does?

The resource manager abort method used to be a pass. In 3.9 in raises
an exception, which hides the undo exception.  An app should capture
the undo exception information before calling abort.

My guess is that this works much better in ZODB 3.10.

Jim


-- 
Jim Fulton
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] ZODB Book Project

2010-06-29 Thread Alan Runyan
http://zodbdocs.blogspot.com/ - ZODB Book Project

Hello zope-dev,

I wanted to provide a status update for the upcoming ZODB book.  We have
achieved our initial financial goal to get an advance to Carlos de la Guardia.
He will begin planning and writing.

We need more money.  Please take this opportunity to goto the blog, review
the book outline, provide feedback and click on the paypal link and add
to the pot.

I will be contacting companies who are absent from the donor roster.  Please
contribute.

Both individuals and companies can contribute by becoming authors on the blog
and writing articles.  I've gotten a fairly luke-warm reception from the
community on writing articles.  If you have any experience - let me know.
Email me an article, I will put it up and credit you.

This project will succeed only by pulling the resources together from our
communities.

http://zodbdocs.blogspot.com/ - ZODB Book Project

cheers,
alan runyan
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] ZODB Documentation Fundraising

2010-06-25 Thread Alan Runyan
> "So if you want to donate. Send us some money. You can use Paypal or send
> us a check."
>
> I don't do Paypal and I couldn't send you a cheque if I wanted to. IBAN,
> please.

Let's see how many other people want to do IBAN/wires xfers.  We could offer it.
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] ZODB Documentation Fundraising

2010-06-25 Thread Andreas Jung
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

j...@nexedi.com wrote:
> Hi,
> 
> If you want a chapter on NEO (http://www.neoppod.org/) or book review, let us 
> know, we can write or help. NEO is probably the fastest and most scalable 
> storage for ZODB. We also have lots of benchmarks (we use ZODB for huge 
> transactional banking applications and for the largest CRM operation  in 
> Ireland).
> 

Could you please post the benchmark results?

- -aj
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkwkg0wACgkQCJIWIbr9KYx3xgCgs61Uzkl/MnLucJ4V2eHCnCbA
sOMAoMWbxkJxjkKZe5lPwfL03OnT+1gS
=8YWt
-END PGP SIGNATURE-
<>___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] ZODB Documentation Fundraising

2010-06-25 Thread Charlie Clark
Am 24.06.2010, 21:19 Uhr, schrieb Alan Runyan :

> I am open for any feedback.  I desperately want to get the larger
> community support and feedback early as possible.  Please feel free to
> send comments, concerns, criticisms.

Great idea Alan, but

"So if you want to donate. Send us some money. You can use Paypal or send  
us a check."

I don't do Paypal and I couldn't send you a cheque if I wanted to. IBAN,  
please.

Charlie
-- 
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-600-3657
Mobile: +49-178-782-6226
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] ZODB Documentation Fundraising

2010-06-24 Thread jp
Hi,

If you want a chapter on NEO (http://www.neoppod.org/) or book review, let us 
know, we can write or help. NEO is probably the fastest and most scalable 
storage for ZODB. We also have lots of benchmarks (we use ZODB for huge 
transactional banking applications and for the largest CRM operation  in 
Ireland).

Regards,

JPS.



> The blog: http://zodbdocs.blogspot.com/
> 
> I am coordinating an effort to have a ZODB book written by one of our
> Zope clan, Carlos de la Guardia. He has completed a recent book for
> Packt publishing on Grok.  He showed interested in writing a ZODB book
> if it were under Creative Commons.  I have set up a blog and focused
> on behind-the-scenes coordination required to make the book happen.
> 
> We are now at a point where:
> 
> - There is an initial outline of topics to cover.
> - There is a way to contribute financially on the ZODB Docs Blog
> (through paypal).
> - If you can contribute to the book with written material and
> experience.  Let me know.  I will make a contributor on the blog and
> you can post articles.  Carlos is more than happy to consolidate/pinch
> material (and of course give the original author credit) and put it
> into the final book.  One of the thoughts would be to write ZODB
> mini-howtos/articles on the blog.  Some initial ideas: transaction
> module (datamanagers, aftercommithook, etc), debugging scenarios (how
> to debug a record being mutated accidentally), conflict resolution
> (writing your own custom impl, btree bucket splits, etc), concurrency,
> any benchmarking information you have, relstorage, writing your own
> persistence format (keas.pbpersist?), or query strategies for ZODB.
> There is a lot of material to cover in this book.
> - There are also contribution/funding levels available which correlate
> to recognition of your donation in the book.  That is right.  Give
> money and you go down in history in the documentation *wink*
> 
> We will have a revised outline of the book by Monday evening from
> Carlos.  If you want to contribute material to the Blog -- let me
> know.  You have a channel to  voice your experience.
> 
> More information is on the blog and will be updated as more progress
> is made. Again the blog is at, http://zodbdocs.blogspot.com/ -- please
> sign up and subscribe to the RSS feed.
> 
> I am open for any feedback.  I desperately want to get the larger
> community support and feedback early as possible.  Please feel free to
> send comments, concerns, criticisms.
> 
> cheers,
> alan runyan
> ___
> Zope-Dev maillist  -  Zope-Dev@zope.org
> https://mail.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists - 
>  https://mail.zope.org/mailman/listinfo/zope-announce
>  https://mail.zope.org/mailman/listinfo/zope )
> ___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] ZODB Documentation Fundraising

2010-06-24 Thread Chris McDonough
Thanks for organizing this Alan.  Hopefully folks will follow your lead
and contribute.  Agendaless put some money into the pot today.

On Thu, 2010-06-24 at 14:19 -0500, Alan Runyan wrote:
> The blog: http://zodbdocs.blogspot.com/
> 
> I am coordinating an effort to have a ZODB book written by one of our
> Zope clan, Carlos de la Guardia. He has completed a recent book for
> Packt publishing on Grok.  He showed interested in writing a ZODB book
> if it were under Creative Commons.  I have set up a blog and focused
> on behind-the-scenes coordination required to make the book happen.
> 
> We are now at a point where:
> 
> - There is an initial outline of topics to cover.
> - There is a way to contribute financially on the ZODB Docs Blog
> (through paypal).
> - If you can contribute to the book with written material and
> experience.  Let me know.  I will make a contributor on the blog and
> you can post articles.  Carlos is more than happy to consolidate/pinch
> material (and of course give the original author credit) and put it
> into the final book.  One of the thoughts would be to write ZODB
> mini-howtos/articles on the blog.  Some initial ideas: transaction
> module (datamanagers, aftercommithook, etc), debugging scenarios (how
> to debug a record being mutated accidentally), conflict resolution
> (writing your own custom impl, btree bucket splits, etc), concurrency,
> any benchmarking information you have, relstorage, writing your own
> persistence format (keas.pbpersist?), or query strategies for ZODB.
> There is a lot of material to cover in this book.
> - There are also contribution/funding levels available which correlate
> to recognition of your donation in the book.  That is right.  Give
> money and you go down in history in the documentation *wink*
> 
> We will have a revised outline of the book by Monday evening from
> Carlos.  If you want to contribute material to the Blog -- let me
> know.  You have a channel to  voice your experience.
> 
> More information is on the blog and will be updated as more progress
> is made. Again the blog is at, http://zodbdocs.blogspot.com/ -- please
> sign up and subscribe to the RSS feed.
> 
> I am open for any feedback.  I desperately want to get the larger
> community support and feedback early as possible.  Please feel free to
> send comments, concerns, criticisms.
> 
> cheers,
> alan runyan
> ___
> Zope-Dev maillist  -  Zope-Dev@zope.org
> https://mail.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists - 
>  https://mail.zope.org/mailman/listinfo/zope-announce
>  https://mail.zope.org/mailman/listinfo/zope )
> 


___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] ZODB Documentation Fundraising

2010-06-24 Thread Alan Runyan
The blog: http://zodbdocs.blogspot.com/

I am coordinating an effort to have a ZODB book written by one of our
Zope clan, Carlos de la Guardia. He has completed a recent book for
Packt publishing on Grok.  He showed interested in writing a ZODB book
if it were under Creative Commons.  I have set up a blog and focused
on behind-the-scenes coordination required to make the book happen.

We are now at a point where:

- There is an initial outline of topics to cover.
- There is a way to contribute financially on the ZODB Docs Blog
(through paypal).
- If you can contribute to the book with written material and
experience.  Let me know.  I will make a contributor on the blog and
you can post articles.  Carlos is more than happy to consolidate/pinch
material (and of course give the original author credit) and put it
into the final book.  One of the thoughts would be to write ZODB
mini-howtos/articles on the blog.  Some initial ideas: transaction
module (datamanagers, aftercommithook, etc), debugging scenarios (how
to debug a record being mutated accidentally), conflict resolution
(writing your own custom impl, btree bucket splits, etc), concurrency,
any benchmarking information you have, relstorage, writing your own
persistence format (keas.pbpersist?), or query strategies for ZODB.
There is a lot of material to cover in this book.
- There are also contribution/funding levels available which correlate
to recognition of your donation in the book.  That is right.  Give
money and you go down in history in the documentation *wink*

We will have a revised outline of the book by Monday evening from
Carlos.  If you want to contribute material to the Blog -- let me
know.  You have a channel to  voice your experience.

More information is on the blog and will be updated as more progress
is made. Again the blog is at, http://zodbdocs.blogspot.com/ -- please
sign up and subscribe to the RSS feed.

I am open for any feedback.  I desperately want to get the larger
community support and feedback early as possible.  Please feel free to
send comments, concerns, criticisms.

cheers,
alan runyan
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] [ZODB-Dev] Problem with handling of data managers that join transactions after savepoints

2010-05-11 Thread Chris Withers
Jim Fulton wrote:
>>> I plan to implement A soon if there are no objections.
>>>
>>> Unless someone somehow convinced me to do D, I'll also add an
>>> assertion in the Transaction.join method to raise an error if a
>>> data manager joins more than once.
>> Option A sounds sensible. It also means I won't have to change
>> anything in the zope.sqlalchemy data manager.
> 
> Very cool. I was hoping non-ZODB-data-manager authors
> were paying attention. :)
> 
> If anyone knows of any other, I would appreciate someone forwarding
> this thread to them.

zope.sendmail and MaildropHost have data managers.
I've seen some file-based things that was a data manager and a few 
others in people's BFG stacks, maybe they can pipe up and/or let the 
others of those wsgi components know.

I'm also likely about to write one, but I'm dumb, so can't comment 
meaningfully on the options ;-)

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk

___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] ZODB issue

2010-02-05 Thread Jim Fulton
On Thu, Feb 4, 2010 at 8:00 PM, Roger  wrote:
...
> But probably this is a problem and should't get released as is.
> Any hints?

You need to rerun your buildout. There are new (C) methods on fsBuckets.

Jim

-- 
Jim Fulton
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] ZODB issue

2010-02-04 Thread Roger
Hi Jim,

I've got an error with the latest ZODB3 trunk:

Traceback (most recent call last):
  File "D:\XPortal\trunk\bin\app-script.py", line 171, in 
]+sys.argv[1:])
  File
"d:\home\.buildout\eggs\pastescript-1.7.3-py2.5.egg\paste\script\command.py"
, line 84, in run
invoke(command, command_name, options, args[1:])
  File
"d:\home\.buildout\eggs\pastescript-1.7.3-py2.5.egg\paste\script\command.py"
, line 123, in invoke
exit_code = runner.run(args)
  File
"d:\home\.buildout\eggs\pastescript-1.7.3-py2.5.egg\paste\script\command.py"
, line 218, in run
result = self.command()
  File
"d:\home\.buildout\eggs\pastescript-1.7.3-py2.5.egg\paste\script\serve.py",
line 276, in command
relative_to=base, global_conf=vars)
  File
"d:\home\.buildout\eggs\pastescript-1.7.3-py2.5.egg\paste\script\serve.py",
line 313, in loadapp
**kw)
  File
"d:\home\.buildout\eggs\pastedeploy-1.3.3-py2.5.egg\paste\deploy\loadwsgi.py
", line 204, in loadapp
return loadobj(APP, uri, name=name, **kw)
  File
"d:\home\.buildout\eggs\pastedeploy-1.3.3-py2.5.egg\paste\deploy\loadwsgi.py
", line 225, in loadobj
return context.create()
  File
"d:\home\.buildout\eggs\pastedeploy-1.3.3-py2.5.egg\paste\deploy\loadwsgi.py
", line 625, in create
return self.object_type.invoke(self)
  File
"d:\home\.buildout\eggs\pastedeploy-1.3.3-py2.5.egg\paste\deploy\loadwsgi.py
", line 177, in invoke
next_app = context.next_context.create()
  File
"d:\home\.buildout\eggs\pastedeploy-1.3.3-py2.5.egg\paste\deploy\loadwsgi.py
", line 625, in create
return self.object_type.invoke(self)
  File
"d:\home\.buildout\eggs\pastedeploy-1.3.3-py2.5.egg\paste\deploy\loadwsgi.py
", line 110, in invoke
return fix_call(context.object, context.global_conf,
**context.local_conf)
  File
"d:\home\.buildout\eggs\pastedeploy-1.3.3-py2.5.egg\paste\deploy\util\fixtyp
eerror.py", line 57, in fix_call
val = callable(*args, **kw)
  File "d:\dev\trunk\externals\xpo\src\xpo\wsgi\__init__.py", line 36, in
application_factory
APPLICATION = zope.app.wsgi.getWSGIApplication(configfile, schemafile)
  File "d:\dev\trunk\externals\zope.app.wsgi\src\zope\app\wsgi\__init__.py",
line 158, in getWSGIApplication
db = config(configfile, schemafile, features)
  File "d:\dev\trunk\externals\zope.app.wsgi\src\zope\app\wsgi\__init__.py",
line 150, in config
db = appsetup.multi_database(options.databases)[0][0]
  File
"d:\dev\trunk\externals\zope.app.appsetup\src\zope\app\appsetup\appsetup.py"
, line 213, in multi_database
db = factory.open()
  File "d:\dev\trunk\externals\zodb3\src\ZODB\config.py", line 101, in open
storage = section.storage.open()
  File "d:\dev\trunk\externals\zodb3\src\ZODB\config.py", line 169, in open
return FileStorage(config.path, **options)
  File "d:\dev\trunk\externals\zodb3\src\ZODB\FileStorage\FileStorage.py",
line 188, in __init__
self._save_index()
  File "d:\dev\trunk\externals\zodb3\src\ZODB\FileStorage\FileStorage.py",
line 249, in _save_index
self._index.save(self._pos, tmp_name)
  File "d:\dev\trunk\externals\zodb3\src\ZODB\fsIndex.py", line 104, in save
pickler.dump((k, v.toString()))
AttributeError: 'BTrees.fsBTree.fsBucket' object has no attribute 'toString'


I just started an custom instance using an empty ZODB and added some
objects,
after that I coudn't restart zope.

Switching to the latest released ZODB3 package solved the problem
for now. The existing ZODB works well with the latest release.
Don't worry this is just a development trunk I don't need help.

But probably this is a problem and should't get released as is.
Any hints?


Regards
Roger Ineichen
_
END OF MESSAGE

___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] [ZODB-Dev] Splitting a large ZODB file storage - any light-weight approach?

2009-12-30 Thread Hanno Schlichting
On Wed, Dec 30, 2009 at 9:16 AM, Andreas Jung  wrote:
> Delete operations will trigger events modifying other global metadata
> related
> to the those objects. So this approach requires modification to the
> application in
> order to avoid such side effects.

But if you do it from a debug prompt, you can easily prevent those
events from being fired.

For a normal ObjectManager you do:

delattr(root, 'A')  # this is what _delOb does
root._objects = tuple([i for i in root._objects if i['id'] != 'A'])

That's the actually important part of _delObject method, without
firing any events or calling any manage_ methods.

Hanno
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] [ZODB-Dev] Splitting a large ZODB file storage - any light-weight approach?

2009-12-30 Thread Andreas Jung
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Jens Vagelpohl wrote:
>
> - copy the old Data.fs into three new storage server buildouts.
> Attach to each with a ZEO client and delete the folders you do not
> need in that particular storage in the ZMI or via zopectl debug.
Delete operations will trigger events modifying other global metadata
related
to the those objects. So this approach requires modification to the
application in
order to avoid such side effects.

Andreas
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAks7DFEACgkQCJIWIbr9KYxIcACgonZfwXWmTqguW2tlcoEsLfNv
9KMAn0+h5EZ59ConlsKUNa1BWn2+bTt2
=bP9X
-END PGP SIGNATURE-

<>___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] [ZODB-Dev] Splitting a large ZODB file storage - any light-weight approach?

2009-12-30 Thread Jens Vagelpohl
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Andreas Jung wrote:
> Hi there,
> 
> we have some huge ZODB file storage (60-80 GB each) and we want
> to split the storage into a number of smaller storage (easier
> to handle for backup and packing). The storages themselves only
> contain a few (Zope 2) folders  - let's say folders A, B, C -
> within the root and we want to create seperate storages for A, B, C.
> 
> Is there some easier approach than using the Zope 2 CopyManager API
> for moving data around. The ZODB storage iterator API comes to my mind...
> is this a suitable approach or is there some other light-weight approach
> (compared to using CopyManager API)?

Why move any data between ZODBs at all? In this situation I would try
the following:

 - create a new empty ZODB. This one holds the root.

 - copy the old Data.fs into three new storage server buildouts. Attach
to each with a ZEO client and delete the folders you do not need in that
particular storage in the ZMI or via zopectl debug.

 - pack each storage so the deleted data gets trashed and the files shrink.

 - mount the "folder" storages into the new empty root using mount
points on the clients that will use the storages.

jens

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.8 (Darwin)

iEYEARECAAYFAks7CpEACgkQRAx5nvEhZLKjYgCdGI71f/yNJS3EIpZxkyFVBmSe
qhMAoJ8RBK2eq27P67Iki4h4MYMZ1kZB
=FC8f
-END PGP SIGNATURE-
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] ZODB Competing read/writes: How to find out which attribute?

2009-10-12 Thread Jim Fulton
On Sun, Oct 11, 2009 at 3:27 PM, Marius Gedminas  wrote:
...
> Sadly, the ZODB doesn't track backreferences, so there only way to find
> out for sure what points to your object is to do a full graph traversal.

The zc.zodbdgc package has a database verification scripts that
optionally creates a backreference database.

Jim

-- 
Jim Fulton
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] ZODB Competing read/writes: How to find out which attribute?

2009-10-11 Thread Marius Gedminas
On Sat, Oct 10, 2009 at 10:56:09AM +0200, Hermann Himmelbauer wrote:
> Am Freitag 09 Oktober 2009 19:12:09 schrieb Shane Hathaway:
> > Hermann Himmelbauer wrote:
> > > Hi,
> > > I once in the while get the following warning in my Zope 3 log, which I'd
> > > like to resolve:
> > >
> > > 2009-10-07T14:35:41 WARNING ZopePublication Competing writes/reads
> > > at
> > > /BSPSite/act/++vh++http:zis.act.at:80/bankneu/++/c/acc/booklist/index.htm
> > >l: database conflict error (oid 0x7a5d, class BTrees.OOBTree.OOBTree,
> > > serial this txn started with 0x0381388ca6804966 2009-10-07
> > > 12:28:39.023700, serial currently committed 0x03813893b087d0cc 2009-10-07
> > > 12:35:41.374343)
> >
> > That URL looks like it should only be reading the database, but the fact
> > that you get a conflict error suggests that the code behind that URL is
> > writing to the database.  If I were you, I would first ensure that read
> > operations never write to the database.
> 
> That's exactly the problem - it's a read operation and there should not be 
> any 
> write operation involved. However, it's hard to find out where the write 
> operation in my code occurs, I can't find it in the view, maybe there's 
> something in the authentication code, but I'd have to dig deep through my 
> source. So It would be extremely helpful to know a faster way to find out 
> what code triggered this warning.

Sometimes looking at the object in question can provide some hints.  You
have the OID, start up zodbbrowser (http://pypi.python.org/pypi/zodbbrowser),
go to @@zodbbrowser?oid=0x7a5d and see if the data sheds some link.
Some things, e.g. annotations, stand out pretty clearly (and the default
adapter for IAttributeAnnotatable is one of the things that has
write-on-read semantics.)

Sadly, the ZODB doesn't track backreferences, so there only way to find
out for sure what points to your object is to do a full graph traversal.

Cheers!
Marius Gedminas
-- 
http://pov.lt/ -- Zope 3 consulting and development


signature.asc
Description: Digital signature
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] ZODB Competing read/writes: How to find out which attribute?

2009-10-11 Thread Jim Fulton
On Sat, Oct 10, 2009 at 10:00 PM, Shane Hathaway  wrote:
> Hermann Himmelbauer wrote:
>> That's exactly the problem - it's a read operation and there should not be 
>> any
>> write operation involved. However, it's hard to find out where the write
>> operation in my code occurs, I can't find it in the view, maybe there's
>> something in the authentication code, but I'd have to dig deep through my
>> source. So It would be extremely helpful to know a faster way to find out
>> what code triggered this warning.
>
> The code that modifies something will indirectly call the register()
> method of the ZODB.Connection class.  If you arrange for
> Connection.register() to raise an exception when the transaction is not
> supposed to modify anything, you should get a traceback that pinpoints
> what is doing the modification.  Unfortunately, there is no API for
> that, so the easiest thing to do is modify the source code of the
> register() method in ZODB.Connection.  Fortunately, this is Python, so
> modifying someone else's code is usually quite easy. :-)

Easier yet, in a development environment, add a breakpoint in register
and make a read-only request to see what's causing it to be called and
why.

Jim

-- 
Jim Fulton
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] ZODB Competing read/writes: How to find out which attribute?

2009-10-10 Thread Shane Hathaway
Hermann Himmelbauer wrote:
> That's exactly the problem - it's a read operation and there should not be 
> any 
> write operation involved. However, it's hard to find out where the write 
> operation in my code occurs, I can't find it in the view, maybe there's 
> something in the authentication code, but I'd have to dig deep through my 
> source. So It would be extremely helpful to know a faster way to find out 
> what code triggered this warning.

The code that modifies something will indirectly call the register() 
method of the ZODB.Connection class.  If you arrange for 
Connection.register() to raise an exception when the transaction is not 
supposed to modify anything, you should get a traceback that pinpoints 
what is doing the modification.  Unfortunately, there is no API for 
that, so the easiest thing to do is modify the source code of the 
register() method in ZODB.Connection.  Fortunately, this is Python, so 
modifying someone else's code is usually quite easy. :-)

Shane

___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] ZODB Competing read/writes: How to find out which attribute?

2009-10-10 Thread Hermann Himmelbauer
Am Freitag 09 Oktober 2009 19:12:09 schrieb Shane Hathaway:
> Hermann Himmelbauer wrote:
> > Hi,
> > I once in the while get the following warning in my Zope 3 log, which I'd
> > like to resolve:
> >
> > 2009-10-07T14:35:41 WARNING ZopePublication Competing writes/reads
> > at
> > /BSPSite/act/++vh++http:zis.act.at:80/bankneu/++/c/acc/booklist/index.htm
> >l: database conflict error (oid 0x7a5d, class BTrees.OOBTree.OOBTree,
> > serial this txn started with 0x0381388ca6804966 2009-10-07
> > 12:28:39.023700, serial currently committed 0x03813893b087d0cc 2009-10-07
> > 12:35:41.374343)
>
> That URL looks like it should only be reading the database, but the fact
> that you get a conflict error suggests that the code behind that URL is
> writing to the database.  If I were you, I would first ensure that read
> operations never write to the database.

That's exactly the problem - it's a read operation and there should not be any 
write operation involved. However, it's hard to find out where the write 
operation in my code occurs, I can't find it in the view, maybe there's 
something in the authentication code, but I'd have to dig deep through my 
source. So It would be extremely helpful to know a faster way to find out 
what code triggered this warning.

Best Regards,
Hermann

-- 
herm...@qwer.tk
GPG key ID: 299893C7 (on keyservers)
FP: 0124 2584 8809 EF2A DBF9  4902 64B4 D16B 2998 93C7
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] ZODB Competing read/writes: How to find out which attribute?

2009-10-10 Thread Hermann Himmelbauer
Am Freitag 09 Oktober 2009 21:44:12 schrieb Roger Ineichen:
> Hi Hermann
>
> > Betreff: Re: [Zope-dev] ZODB Competing read/writes: How to
> > find out which attribute?
> >
> > Hermann Himmelbauer wrote:
> > > Hi,
> > > I once in the while get the following warning in my Zope 3
> >
> > log, which
> >
> > > I'd like to resolve:
> > >
> > > 2009-10-07T14:35:41 WARNING ZopePublication Competing
> >
> > writes/reads at
> >
> > /BSPSite/act/++vh++http:zis.act.at:80/bankneu/++/c/acc/booklis
>
> t/index.html:
> > > database conflict error (oid 0x7a5d, class BTrees.OOBTree.OOBTree,
> > > serial this txn started with 0x0381388ca6804966 2009-10-07
> > > 12:28:39.023700, serial currently committed 0x03813893b087d0cc
> > > 2009-10-07 12:35:41.374343)
> >
> > That URL looks like it should only be reading the database,
> > but the fact that you get a conflict error suggests that the
> > code behind that URL is writing to the database.  If I were
> > you, I would first ensure that read operations never write to
> > the database.
>
> just a hint, sometimes session get accessed with session[key]
> wich will force a write operation. If so, you can prevent creating
> a new session by using session.get(key, someDefaultValue)

Thanks for the info - but why is that? I always had the impression, that 
mydict['mykey'] does the same as mydict.get('mykey')?

What exactly is written during session['mykey']?

Moreover, does that concurrent read/write problem with sessions apply to one 
user only or to anyone who accesses the session?

Best Regards,
Hermann

-- 
herm...@qwer.tk
GPG key ID: 299893C7 (on keyservers)
FP: 0124 2584 8809 EF2A DBF9  4902 64B4 D16B 2998 93C7
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] ZODB Competing read/writes: How to find out which attribute?

2009-10-09 Thread Roger Ineichen
Hi Hermann

> Betreff: Re: [Zope-dev] ZODB Competing read/writes: How to 
> find out which attribute?
> 
> Hermann Himmelbauer wrote:
> > Hi,
> > I once in the while get the following warning in my Zope 3 
> log, which 
> > I'd like to resolve:
> > 
> > 2009-10-07T14:35:41 WARNING ZopePublication Competing 
> writes/reads at 
> > 
> /BSPSite/act/++vh++http:zis.act.at:80/bankneu/++/c/acc/booklis
t/index.html:
> > database conflict error (oid 0x7a5d, class BTrees.OOBTree.OOBTree, 
> > serial this txn started with 0x0381388ca6804966 2009-10-07 
> > 12:28:39.023700, serial currently committed 0x03813893b087d0cc 
> > 2009-10-07 12:35:41.374343)
> 
> That URL looks like it should only be reading the database, 
> but the fact that you get a conflict error suggests that the 
> code behind that URL is writing to the database.  If I were 
> you, I would first ensure that read operations never write to 
> the database.

just a hint, sometimes session get accessed with session[key]
wich will force a write operation. If so, you can prevent creating
a new session by using session.get(key, someDefaultValue)

Regards
Roger Ineichen

> Shane
> 
> ___
> Zope-Dev maillist  -  Zope-Dev@zope.org
> https://mail.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  ** (Related lists -  
> https://mail.zope.org/mailman/listinfo/zope-announce
>  https://mail.zope.org/mailman/listinfo/zope )
> 

___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] ZODB Competing read/writes: How to find out which attribute?

2009-10-09 Thread Shane Hathaway
Hermann Himmelbauer wrote:
> Hi,
> I once in the while get the following warning in my Zope 3 log, which I'd 
> like 
> to resolve:
> 
> 2009-10-07T14:35:41 WARNING ZopePublication Competing writes/reads 
> at 
> /BSPSite/act/++vh++http:zis.act.at:80/bankneu/++/c/acc/booklist/index.html: 
> database conflict error (oid 0x7a5d, class BTrees.OOBTree.OOBTree, serial 
> this txn started with 0x0381388ca6804966 2009-10-07 12:28:39.023700, serial 
> currently committed 0x03813893b087d0cc 2009-10-07 12:35:41.374343)

That URL looks like it should only be reading the database, but the fact 
that you get a conflict error suggests that the code behind that URL is 
writing to the database.  If I were you, I would first ensure that read 
operations never write to the database.

Shane

___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] ZODB Competing read/writes: How to find out which attribute?

2009-10-09 Thread Hermann Himmelbauer
Hi,
I once in the while get the following warning in my Zope 3 log, which I'd like 
to resolve:

2009-10-07T14:35:41 WARNING ZopePublication Competing writes/reads 
at /BSPSite/act/++vh++http:zis.act.at:80/bankneu/++/c/acc/booklist/index.html: 
database conflict error (oid 0x7a5d, class BTrees.OOBTree.OOBTree, serial 
this txn started with 0x0381388ca6804966 2009-10-07 12:28:39.023700, serial 
currently committed 0x03813893b087d0cc 2009-10-07 12:35:41.374343)

I wonder how I can find out, to which attribute this applies, I do know the 
view and the class, probably BTrees.OOBTree.OOBTree, but don't know the 
attribute itself.

Any clues?

Best Regards,
Hermann

-- 
herm...@qwer.tk
GPG key ID: 299893C7 (on keyservers)
FP: 0124 2584 8809 EF2A DBF9  4902 64B4 D16B 2998 93C7
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] ZODB moved class upgrade script Was: zope.testrunner import location notifications

2009-06-23 Thread Christian Theune
Hi,

On Mon, 2009-06-08 at 09:49 +0200, Christian Theune wrote:
> Hi,
> 
> On Tue, 2009-05-26 at 12:42 +0200, Martijn Faassen wrote:
> > Hi there,
> > 
> > (in particular Christian Theune)
> > 
> > What's the status of the 'import location' notification functionality in 
> > zope.testrunner?
> > 
> > What's the status of the ZODB migration code?
> 
> Done. I just released the package `zodbupgrade` on PyPI providing a tool
> and some documentation how to apply it to your databases
> 
> I got the idea of also providing a way to describe renames/moves
> (possibly using entry points for hooking up the declaration) and that
> can manipulate databases when the code is gone already so we can migrate
> in one go instead of using intermediate releases.

I've released the second version of this tool which I consider stable.
It is now called ``zodbupdate``.

The major shift is that it allows to provide a pre-defined set of
class-renaming rules and can rewrite pickles in ZODBs without having the
actual code activated in the Python interpreter. It does this by dis-
and re-assembling the pickles.

I consider the ZODB migration code project to be finished with this.

@Martijn: Did we have a place somewhere in the documentation that needs
to be updated to reference this?

Cheers,
Christian
-- 
Christian Theune · c...@gocept.com
gocept gmbh & co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 7 · fax +49 345 1229889 1
Zope and Plone consulting and development


signature.asc
Description: This is a digitally signed message part
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] [ZODB-Dev] Removing the unused and untested ZODB.Mount module

2009-06-11 Thread Jim Fulton

On Jun 11, 2009, at 2:19 PM, Tres Seaver wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Jim Fulton wrote:
>> It looking for the ZODBMountPoint object that Tarek refered to, I saw
>> that there is still  a Mount module in the ZODB package.  AFAIK, this
>> a fossil that never should have been included in ZODB in the first
>> place. I'm going to remove it from the trunk and from 3.8.
>
> A somewhat late follow up :) :
>
> I backported today the change from the Zope2 trunk to the 2.10 and  
> 2.11
> branches, moving that module from ZODB to the TemporaryStorage  
> product.
> It should now be easier for folks to experiment with using ZODB  
> 3.9.x in
> the earlier Z2 versions.

Cool. Thanks. :)

Jim

--
Jim Fulton
Zope Corporation


___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] ZODB moved class upgrade script Was: zope.testrunner import location notifications

2009-06-08 Thread Christian Theune
Hi,

On Tue, 2009-05-26 at 12:42 +0200, Martijn Faassen wrote:
> Hi there,
> 
> (in particular Christian Theune)
> 
> What's the status of the 'import location' notification functionality in 
> zope.testrunner?
> 
> What's the status of the ZODB migration code?

Done. I just released the package `zodbupgrade` on PyPI providing a tool
and some documentation how to apply it to your databases

I got the idea of also providing a way to describe renames/moves
(possibly using entry points for hooking up the declaration) and that
can manipulate databases when the code is gone already so we can migrate
in one go instead of using intermediate releases.

Christian

-- 
Christian Theune · c...@gocept.com
gocept gmbh & co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 7 · fax +49 345 1229889 1
Zope and Plone consulting and development


signature.asc
Description: This is a digitally signed message part
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] ZODB change notifications

2009-01-22 Thread Rowan Woodhouse
Laurence Rowe wrote:
> Rowan Woodhouse wrote:
>> Hi,
>>
>> I've got two clients accessing the same object at the same time (one is 
>> Zope and the other is a worker interfacing to another system). In the 
>> worker client I need to detect a change to the value of an attribute 
>> made by the Zope client. I can do this by polling the value of the 
>> attribute that I'm interested in but I am wondering if there is a more 
>> elegant and efficient way of doing this.
>>
>> Any ideas?
> 
> Perhaps try hooking into the ZEO cache invalidation mechanism.
> 
> Laurence

Thanks, I'll give that a go and get back to the list with what I work out.

Rowan

___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] ZODB change notifications

2009-01-20 Thread Laurence Rowe
Rowan Woodhouse wrote:
> Hi,
> 
> I've got two clients accessing the same object at the same time (one is 
> Zope and the other is a worker interfacing to another system). In the 
> worker client I need to detect a change to the value of an attribute 
> made by the Zope client. I can do this by polling the value of the 
> attribute that I'm interested in but I am wondering if there is a more 
> elegant and efficient way of doing this.
> 
> Any ideas?

Perhaps try hooking into the ZEO cache invalidation mechanism.

Laurence

___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] ZODB change notifications

2009-01-20 Thread Rowan Woodhouse
Hi,

I've got two clients accessing the same object at the same time (one is 
Zope and the other is a worker interfacing to another system). In the 
worker client I need to detect a change to the value of an attribute 
made by the Zope client. I can do this by polling the value of the 
attribute that I'm interested in but I am wondering if there is a more 
elegant and efficient way of doing this.

Any ideas?

Thanks,
Rowan

___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] ZODB 3.8.1 issue

2008-12-24 Thread Roger Ineichen
Hi Jim

Just found an issue in ZODB 3.8 branch. (3.8.1 release)

The line: 370 in blob.py uses *targetpath* (undefined)
This should be *path*.

The current 3.9 trunk is fixed.

I didn't fix and release that issue because I only have a 
MinGW compiler installed. Can you pick that up?

Regards
Roger Ineichen
_
END OF MESSAGE

___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] [ZODB-Dev] SVN woes.

2008-11-11 Thread Wichert Akkerman

On 11/11/08 4:10 PM, Izak Burger wrote:

Jim Fulton wrote:
   

I'm going to restore svn from a backup and see where that leaves us.
I'm going to disable svn access while I work on this.
 


Good luck :-) I know a little something about the hard work involved in
recovering subversion repos, in the last year we had TWO cases of
corrupted revisions in an svn repo we were managing. It had something to
do with concurrent commits and the fact that we were running
apache-mpm-worker (instead of prefork).
   


FWIW, the setup we have for svn.plone.org may be useful for others as 
well: we have two servers (svn.plone.org and svn-mirror.plone.org) with 
a svnsync setup to keep the mirror (almost) realtime in sync with the 
main server. There is an LDAP database which is replicated between the 
two servers as well which we use for authentication. This setup allows 
us to swich svn.plone.org to the other server in minutes if it dies, 
without any loss of data.


Wichert.

___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] [ZODB-Dev] svn.zope.org up again?

2008-11-11 Thread Christian Theune
On Tue, 2008-11-11 at 12:35 +0200, Marius Gedminas wrote:
> On Tue, Nov 11, 2008 at 08:51:28AM +0100, Adam GROSZER wrote:
> > Hello Stephan,
> > 
> > svn: Can't open file '/svn/repos/main/db/revs/70320': No such file or 
> > directory
> > program finished with exit code 1
> > 
> > Seems that one revision did not get restored.
> > It breaks also on "show log", where other folders with older revisions
> > seem to work.
> 
> I've a full svn mirror up to rev 92837 if it turns out to be needed.

Same here. :) 

It's publicly available at: http://svn.zope.de/zope.org

-- 
Christian Theune · [EMAIL PROTECTED]
gocept gmbh & co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 7 · fax +49 345 1229889 1
Zope and Plone consulting and development


signature.asc
Description: This is a digitally signed message part
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] [ZODB-Dev] svn.zope.org up again?

2008-11-11 Thread Marius Gedminas
On Tue, Nov 11, 2008 at 08:51:28AM +0100, Adam GROSZER wrote:
> Hello Stephan,
> 
> svn: Can't open file '/svn/repos/main/db/revs/70320': No such file or 
> directory
> program finished with exit code 1
> 
> Seems that one revision did not get restored.
> It breaks also on "show log", where other folders with older revisions
> seem to work.

I've a full svn mirror up to rev 92837 if it turns out to be needed.

Marius Gedminas
-- 
IBM motto: "If you can't read our assembly language, you must be
borderline dyslexic, and we don't want you to mess with it anyway"
-- Linus Torvalds


signature.asc
Description: Digital signature
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] [ZODB-Dev] svn.zope.org up again?

2008-11-10 Thread Adam GROSZER
Hello Stephan,

svn: Can't open file '/svn/repos/main/db/revs/70320': No such file or directory
program finished with exit code 1

Seems that one revision did not get restored.
It breaks also on "show log", where other folders with older revisions
seem to work.

Tuesday, November 11, 2008, 6:55:51 AM, you wrote:

SR> Hi all,

SR> it seems like Zope's SVN is back up again. However, when trying to checkout
SR> zope.app.container/trunk gives me an SVN error. Is anyone else seeing this?

SR> Regards,
SR> Stephan


-- 
Best regards,
 Adam GROSZERmailto:[EMAIL PROTECTED]
--
Quote of the day:
Mothers shouldn't make too many sacrifices

___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] [ZODB-Dev] Blobs and modes

2008-10-24 Thread Christian Theune
On Fri, 2008-10-24 at 15:50 -0400, Benji York wrote:
> On Fri, Oct 24, 2008 at 3:28 PM, Jim Fulton <[EMAIL PROTECTED]> wrote:
> >
> > On Oct 24, 2008, at 3:24 PM, Benji York wrote:
> >
> >> Is there a good reason blobs don't support "b" or "t" in the mode
> >> strings passed to "open"?  I'm refactoring some code that expects a
> >> file-like object to use blobs and it wants to pass "wb" as the mode
> >> (which is a sane thing to do).
> >
> > Blobs are implicitly binary. (Note the "B" in Blob.)
> >
> >> I'll add support for "b" and "t" to the blob code if no one objects.
> >
> > I object.
> >
> > BTW, this questions should have been asked o zodb-dev.
> 
> [yep, copied on this message]
> 
> For perpetuity:
> 
> In a private discussion Jim explained that the blob .open() method
> returns things intended to be file-like, but the method itself isn't
> intended to mimic Python's "open" function, and as-such doesn't support
> the additional mode variations.

It's intended to be similar but not identical.

We originally did support 'b' and 't' but decided, as Jim pointed out,
hat we only care for binary data and thus only the binary modes.

I can't remember the reason that drove us to actually rip it out. Maybe
the archive of zodb-dev knows.

> This distinction is similar to why __init__ methods aren't described in
> (zope.interface) interfaces; how you construct an object isn't
> prescribed by the interface exposed by the object itself.

I'm not sure what you're saying. It's not the __init__ problem,
as .open() is described on the Blob class.

Christian

-- 
Christian Theune · [EMAIL PROTECTED]
gocept gmbh & co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 7 · fax +49 345 1229889 1
Zope and Plone consulting and development


signature.asc
Description: This is a digitally signed message part
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] zodb session errors

2006-11-16 Thread Miles Waller

Hi,

We have a site that we've recently upgraded from 2.7.6 to 2.8.8 which 
has started exhibiting higher-than-average session errors.  The site 
consists of 2 zeo clients on 2 separate machines, with a shared session 
tempstorage mounted via the zeo server.


I expect some errors with sessions as a matter of course, but was trying 
to make the user experience a little less 'severe'.


Traceback (innermost last):

* Module ZPublisher.Publish, line 114, in publish

* Module DocumentTemplate.DT_Util, line 197, in eval
  __traceback_info__: portal_basket
* Module , line 1, in 
* Module Products.WFPlugins.ShopTool.BasketTool, line 74, in 
oneLineDetails

* Module Products.WFPlugins.ShopTool.BasketTool, line 54, in getBasket

line 54 reads:
sess = self.session_data_manager.getSessionData(create=create)

* Module Products.Sessions.SessionDataManager, line 93, in 
getSessionData
* Module Products.Sessions.SessionDataManager, line 180, in 
_getSessionDataObject

* Module Products.Transience.Transience, line 846, in new_or_existing
* Module Products.Transience.Transience, line 449, in __setitem__

KeyError: 1163679740

I don't understand is what's happening here (and in turn what to do 
about it).  It looks as if the session machinery detects there is not 
any sessiondata set up for this particular browser, goes to set one up 
and then can't find the current timeslice to put the new sessiondata into.


Does this mean that the timeslice has changed in-between working it out 
and assigning the sessiondata to it?  Or that the timeslice has been 
garbage-collected in-between?  Also, can the problem be solved (without 
side-effects!) by changing the period to match the timeout time - i.e. 
so it can always find the current timeslice?


Thanks for any wisdom!

Miles

___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] zodb "time-stamp reduction" error without time chaning on server

2006-10-04 Thread Dieter Maurer
Chris Withers wrote at 2006-10-4 18:23 +0100:
>Dieter Maurer wrote:
>
>>> 3. If repozo is not to blame, what could be?
>> 
>> One possibility would be a bad call.
>
>A bad call?

You should read my messages carefully!

  E.g. a call where the same incremental backup file
  is presented more than onces to "repozo" -- as
  mentioned several times in stripped part of
  the message you have reported to.



-- 
Dieter
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] zodb "time-stamp reduction" error without time chaning on server

2006-10-04 Thread Chris Withers

Dieter Maurer wrote:


3. If repozo is not to blame, what could be?


One possibility would be a bad call.


A bad call?

Chris

--
Simplistix - Content Management, Zope & Python Consulting
   - http://www.simplistix.co.uk
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] zodb "time-stamp reduction" error without time chaning on server

2006-10-04 Thread Dieter Maurer
Chris Withers wrote at 2006-10-4 15:06 +0100:
> ...
>The interesting thing is that it looks like the transactions where the 
>time appears to go backwards are duplicates of earlier transactions:
>
>position in file   tid time from tid
>310253762330x03689abb582f1311  2006-10-03 04:43:20.668098
>310253765080x03689abdbbe5f000  2006-10-03 04:45:44.038639
>310253767830x03689abddbe6be55  2006-10-03 04:45:51.539377
>
>...lots of transactions...
>
>310256469130x03689abb582f1311  2006-10-03 04:43:20.668098
>310256471880x03689abdbbe5f000  2006-10-03 04:45:44.038639
>310256474630x03689abddbe6be55  2006-10-03 04:45:51.539377
>
>Would this seem to be an accurate reading of the attached log?

It looks as if you had given the same incremental file twice
to "repozo".

>1. Could repozo have a bug that resulted in this?

Maybe, especially when the same file is twice integrated

>2. If repozo has no bug, should it have checking that makes sure it
>doesn't build insane .fs files, or is fstest the way to go for that?

As "fstest" found this problem, it was not too bad.

>3. If repozo is not to blame, what could be?

One possibility would be a bad call.



-- 
Dieter
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] zodb "time-stamp reduction" error without time chaning on server

2006-10-04 Thread Chris Withers

Hi All,

One of my customers has a large (21GB) production zodb which they back 
up onto a contingency server using repozo and rsync. The process is 
roughly as follows:


1. pack the production database to 3 days once a day.

2. create a full backup with repozo and rsync this to the contingency
   storage server once day.

3. on the contingency server, use repozo to turn the backup back into a
   zodb and run fstest to make sure it's sane.

4. every 2 hrs throughout the day, create an incremental backup with
   repozo and rsync the increments to the contingency storage server.

5. once the increments have arrived on the contingency storage server,
   use repozo there to turn the full backup and the increments back into
   a zodb and run fstest to make it

The process has worked fine for several months now. However, yesterday, 
after repozo had combined the full backup with two increments, fstest.py 
spat out the following:


Data.fs.restore
time-stamp reduction at 3102046:
0x03689aa5aa40e444 <= 0x03689aea40d19233

First thought was that the times on the production storage server had 
screwed up, but a lot of digging has failed to show any evidence of 
this, so it looks like the above error has occurred without the usual 
time slip ups.


One of the guys here applied the attached patch to fstest.py to get more 
info on what was happening. I've attached a section of the output of 
running this over the database.


The interesting thing is that it looks like the transactions where the 
time appears to go backwards are duplicates of earlier transactions:


position in file   tid time from tid
310253762330x03689abb582f1311  2006-10-03 04:43:20.668098
310253765080x03689abdbbe5f000  2006-10-03 04:45:44.038639
310253767830x03689abddbe6be55  2006-10-03 04:45:51.539377

...lots of transactions...

310256469130x03689abb582f1311  2006-10-03 04:43:20.668098
310256471880x03689abdbbe5f000  2006-10-03 04:45:44.038639
310256474630x03689abddbe6be55  2006-10-03 04:45:51.539377

Would this seem to be an accurate reading of the attached log?

If so:

1. Could repozo have a bug that resulted in this?

2. If repozo has no bug, should it have checking that makes sure it
   doesn't build insane .fs files, or is fstest the way to go for that?

3. If repozo is not to blame, what could be?

cheers,

Chris

--
Simplistix - Content Management, Zope & Python Consulting
   - http://www.simplistix.co.uk
--- fstest.py.original 2006-08-29 11:33:50.0 +0100
+++ fstest.py2006-10-04 13:57:37.0 +0100
@@ -1,2 +1,2 @@
 ##
 #
@@ -40,3 +40,4 @@
 import string
 import struct
 import sys
+from ZODB.utils import p64, readable_tid_repr as rtr

 class FormatError(ValueError):
 """There is a problem with the format of the FileStorage."""
+def __repr__(self):
+return self.msg

 class Status:
 checkpoint = 'c'
@@ -80,1 +83,1 @@
 return l

 def check(path):
 file = open(path, 'rb')

 file.seek(0, 2)
 file_size = file.tell()
 if file_size == 0:
-raise FormatError("empty file")
+print FormatError("empty file")
 file.seek(0)
 if file.read(4) != packed_version:
-raise FormatError("invalid file header")
+print FormatError("invalid file header")

 pos = 4L
 tid = '\000' * 8 # lowest possible tid to start
 i = 0
 while pos:
 _pos = pos
 pos, tid = check_trec(path, file, pos, tid, file_size)
 if tid is not None:
-chatter("%10d: transaction tid %s #%d \n" %
-(_pos, hexify(tid), i))
+chatter("%10d: transaction tid %s tid_as_date %s #%d \n" %
+(_pos, hexify(tid), rtr(p64(long(hexify(tid), 16))), i))
 i = i + 1
+if i > 100:
+break


 def check_trec(path, file, pos, ltid, file_size):
@@ -114,4 +123,4 @@
 if not h:
 return None, None
 if len(h) != TREC_HDR_LEN:
-raise FormatError("%s truncated at %s" % (path, pos))
+print FormatError("%s truncated at %s" % (path, pos))

 tid, stl, status, ul, dl, el = struct.unpack(">8s8scHHH", h)
 tmeta_len = TREC_HDR_LEN + ul + dl + el

 if tid <= ltid:
-raise FormatError("%s time-stamp reduction at %s: %s <= %s" %
+print FormatError("%s time-stamp reduction at %s: %s <= %s" %
   (path, pos, hexify(tid), hexify(ltid)))
 ltid = tid

 tl = U64(stl) # transaction record length - 8
 if pos + tl + 8 > file_size:
-raise FormatError("%s truncated possibly because of"
+print FormatError("%s truncated possibly because of"
   " damaged records at %s" % (path, pos))
 if status == Status.checkpoint:
-raise FormatError("%s checkpoint flag was not cleared at %s"
+print FormatError("%s checkpoint fla

[Zope-dev] [ZODB] probable small hole in transaction management

2006-09-24 Thread Dieter Maurer
ATT: Crosspost. Please reply to "zodb-dev@zope.org" ("Reply-To" header set).


We recently have had a problem that seems to indicate a small
hole in ZODB (3.4) transaction management.

Here is the sequence of events:

  We have got a repeated "ConflictError", until ZPublisher gave up.

  After this, the ZODB connection seems to be in a strange state:

We get continuous 

   ERROR ZODB.Connection Close callback failed for 

   ...
   ConnectionStateError: Cannot close a connection joined to a transaction


A 'Shared.DC.ZRDB.TM.TM' instance no longer registers with
Zope's transaction system (almost surely, because it "_registered" flag
is still set).

The relational database "behind" this TM gets very unhappy
with its never ending transaction


  No other entries in the logfile that could help to understand what
  happens.



-- 
Dieter
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] ZODB for Java?

2004-04-14 Thread Romain Slootmaekers
Ian Beatty wrote:
Greetings.

Does anyone know of a good (stable, reliable, fast enough for production 
use in a web app) ZODB-equivalent for persisting Java objects?
www.jdocentral.com


Thanks,

..Ian

-- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- --
Dr. Ian Beatty   [EMAIL PROTECTED]
Physics Education Researchvoice: 413.545.9483
Department of Physics   fax: 413.545.4884
Univ. of Massachusetts  AIM: (available upon request)
Amherst, MA 01003-9337 USA   http://umperg.physics.umass.edu/
-- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- --
___
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 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] ZODB for Java?

2004-04-14 Thread Andreas Jung
hi,

you should search on freshmeat.net.

-aj

--On Montag, 12. April 2004 16:05 Uhr -0400 Ian Beatty 
<[EMAIL PROTECTED]> wrote:

Greetings.

Does anyone know of a good (stable, reliable, fast enough for production
use in a web app) ZODB-equivalent for persisting Java objects?
Thanks,

..Ian

-- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- --
Dr. Ian Beatty   [EMAIL PROTECTED]
Physics Education Researchvoice: 413.545.9483
Department of Physics   fax: 413.545.4884
Univ. of Massachusetts  AIM: (available upon request)
Amherst, MA 01003-9337 USA   http://umperg.physics.umass.edu/
-- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- --
___
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 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] ZODB for Java?

2004-04-14 Thread Ian Beatty
Greetings.

Does anyone know of a good (stable, reliable, fast enough for 
production use in a web app) ZODB-equivalent for persisting Java 
objects?

Thanks,

..Ian

-- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- --
Dr. Ian Beatty   [EMAIL PROTECTED]
Physics Education Researchvoice: 413.545.9483
Department of Physics   fax: 413.545.4884
Univ. of Massachusetts  AIM: (available upon request)
Amherst, MA 01003-9337 USA   http://umperg.physics.umass.edu/
-- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- --
___
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] ZODB with twisted web.

2004-04-05 Thread Chris Withers
Syver Enstad wrote:

I am checking out how to use ZODB with twisted web. 
Not sure, but you could check the SchoolTool project, which I know uses ZODB and 
twisted, just not sure if it uses twisted.web or not...

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] ZODB with twisted web.

2004-04-04 Thread Kapil Thangavelu
On Fri, 2004-04-02 at 17:37, Dieter Maurer wrote:
> Syver Enstad wrote at 2004-4-2 11:38 +0200:
> >I am checking out how to use ZODB with twisted web. I thought that I
> >would have the DB instance globally accesible and call the open method
> >to get a connection on each request. I thought that if I use
> >connection.getTransaction().commit() before sending the response I
> >will commit on the connection for that request. Is this necesarily
> >true when using twisted web because it is single threaded and it seems
> >that ZODB finds the correct transaction by checking the thread.
> 
> This is true only, when you are working with "local transaction mode"
> (i.e. you are calling "connection.setLocalTransaction()").
> 
> Currently, this mode restricts you to a single transaction client.
> Neither relational databases nor other transactional clients
> understand this mode. Moreover, you cannot use "DBTab" to
> "mount" several ZODB storages.
> 

i wouldnt say it restricts you to a single txn client, local transaction
mode with twisted allows for the primary goal of using single threaded
twisted with zodb txn semantics bound to protocol instances/clients, and
the txn framework is still perfectly capable, just that the resource
integration of other txn aware resources needs to play well with zodb
conn based txns, which basically rules out most of the existing zope
products as they use a global accessor to the transaction as opposed to
call getTransaction on a conn which would still allow zodb to play a txn
authority/manager role. but at the level of using twisted and zodb
directly those products wouldn't likely be all that useful.

-cheers,

-kapil



___
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] ZODB with twisted web.

2004-04-02 Thread Dieter Maurer
Syver Enstad wrote at 2004-4-2 11:38 +0200:
>I am checking out how to use ZODB with twisted web. I thought that I
>would have the DB instance globally accesible and call the open method
>to get a connection on each request. I thought that if I use
>connection.getTransaction().commit() before sending the response I
>will commit on the connection for that request. Is this necesarily
>true when using twisted web because it is single threaded and it seems
>that ZODB finds the correct transaction by checking the thread.

This is true only, when you are working with "local transaction mode"
(i.e. you are calling "connection.setLocalTransaction()").

Currently, this mode restricts you to a single transaction client.
Neither relational databases nor other transactional clients
understand this mode. Moreover, you cannot use "DBTab" to
"mount" several ZODB storages.

Jeremy is working on a new transaction interface for Zope 2.8./ZODB 3.3
I expect that it will fully support a thread independent
transaction mode.

-- 
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] ZODB with twisted web.

2004-04-02 Thread Syver Enstad

I am checking out how to use ZODB with twisted web. I thought that I
would have the DB instance globally accesible and call the open method
to get a connection on each request. I thought that if I use
connection.getTransaction().commit() before sending the response I
will commit on the connection for that request. Is this necesarily
true when using twisted web because it is single threaded and it seems
that ZODB finds the correct transaction by checking the thread.

I am a bit confused here and would rather like to avoid having one
request commit changes for another request.


___
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] ZODB cache age

2004-02-28 Thread Dieter Maurer
Jeremy Hylton wrote at 2004-2-27 11:11 -0500:
> ... cache age ...
>I'd like to mark all of these APIs as deprecated.  That includes
>manage_cache_age in App.CacheManager and a handful of methods in
>ZODB.DB.

+1 

-- 
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] ZODB cache age

2004-02-27 Thread Jeremy Hylton
The old ZODB object cache had a notion of cache age.  Objects that
hadn't been accessed within a certain time were removed from the cache. 
This feature was removed in Zope 2.6, but all of the APIs that
controlled the age (sometimes called cacheDeactivateAfter) were kept
around.

I'd like to mark all of these APIs as deprecated.  That includes
manage_cache_age in App.CacheManager and a handful of methods in
ZODB.DB.  Does anyone have a problem with that?

Jeremy



___
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] ZODB load state error

2004-01-26 Thread Tim Peters
[Tibor Tolgyesi]
> I just found this in my Zope log file. After this error the Zope
> system stopped. No wonder, but certainly not because of physical
> memory error. What could be the problem?
>
> My config is:
> AiX 5.2
> Python 2.3.2
> Zope 2.7.0-b3
> Apache 1.3.26
>
> The error message:
> 2004-01-25T02:55:21 ERROR(200) ZODB Couldn't load state for
  3ef2
> Traceback (most recent call last):
>   File "/opt/freeware/zope/lib/python/ZODB/Connection.py",
   line 564, in setstate
> self._set_ghost_state(obj, p)
>   File "/opt/freeware/zope/lib/python/ZODB/Connection.py",
   line 603, in _set_ghost_state
> state = unpickler.load()
> MemoryError

If anyone has seen the same error, and especially if you have a reproducible
test case, please add your info to the collector issue Tibor opened about
it:

http://zope.org/Collectors/Zope/1204

It's most likely that "something got corrupted", but there's not enough info
about this kind of error yet to guess exactly where or how or why.


___
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] ZODB 3.3 in Zope 3 status

2004-01-26 Thread Jim Fulton
Fred Drake and I have been working on getting Zope 3 working
with ZODB 3.3.  See:
  http://zope.org/Wikis/ZODB/PersistentCodeImplementationPlan

(which is part of the Zope 2,8 plan)

We are currently working on milestone 2.  I *hope* to get this
done early this week. When we think everything is working, and
all the tests pass, we'll merge the changes into the head.
From that point on, both Zope 2 and Zope 3 will share:
- Common ZODB (3.3)

- Common interface package

This is a big enough change that it's bound to make things
interesting for Both Zope 2 and Zope 3, although the Zope 2
head is already in a rather unstable state.
Some additional notes:

- We will provide a script for converting ZODB 4 file storages
  to the ZODB 3 format.  All Zope 3 users that wish to continue
  using the head will need to run this script.
- We will cause some minor temporary breakage on the Zope 2 head.
  Specifically, broken object support will partially go away
  until we do milestone 3.
  Note that ZClasses are already broken on the Zope head.
  There were no tests to detect this when I merged the
  ExtensionClass rewrite and ZODB 3.3.
Jim

--
Jim Fulton   mailto:[EMAIL PROTECTED]   Python Powered!
CTO  (540) 361-1714http://www.python.org
Zope Corporation http://www.zope.com   http://www.zope.org
___
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] ZODB load state error

2004-01-26 Thread Toby Dickenson
On Monday 26 January 2004 12:08, Thyb wrote:

> What could be the problem?

That indicates that you are out of memory. If that doesnt seem right, maybe 
your storage is corrupt in a manner that the unpickler interprets as 
something with a huge memory footprint.


-- 
Toby Dickenson


___
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] ZODB load state error

2004-01-26 Thread Chris Withers
Thyb wrote:

The error message:
2004-01-25T02:55:21 ERROR(200) ZODB Couldn't load state for
3ef2
Traceback (most recent call last):
  File "/opt/freeware/zope/lib/python/ZODB/Connection.py", line 564, in
setstate
self._set_ghost_state(obj, p)
  File "/opt/freeware/zope/lib/python/ZODB/Connection.py", line 603, in
_set_ghost_state
state = unpickler.load()
MemoryError
Can someone please help me...
Sounds like you ran out of RAM.

Don't think it should cause Zope to hang, that might have been something else.

cheers,

Chris

PS: This should probably have been posted on [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 )


[Zope-dev] ZODB load state error

2004-01-26 Thread Thyb
Hi,

I just found this in my Zope log file. After this error the Zope system
stopped. No wonder, but certainly not because of physical memory error.
What could be the problem?

My config is:
AiX 5.2
Python 2.3.2
Zope 2.7.0-b3
Apache 1.3.26

The error message:
2004-01-25T02:55:21 ERROR(200) ZODB Couldn't load state for
3ef2
Traceback (most recent call last):
  File "/opt/freeware/zope/lib/python/ZODB/Connection.py", line 564, in
setstate
self._set_ghost_state(obj, p)
  File "/opt/freeware/zope/lib/python/ZODB/Connection.py", line 603, in
_set_ghost_state
state = unpickler.load()
MemoryError

Can someone please help me...

Tibor Tolgyesi


___
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] ZODB object upgrades

2003-11-05 Thread Dieter Maurer
alan milligan wrote at 2003-11-2 14:13 +:
 > ...
 > I now desperately need to write a parser to convert all of these nasties to 
 > ZCurrency types.   I've come up with the following ExternalMethod - whereby 
 > I've defined a __currency__ attribute in each obselete incantation's product 
 > ...
 > def repair(container, counter=0):
 > ...
 > counter += 1
 > ...
 > repair(object, counter)
 > return counter
 > ...
 > However, it doesn't seem to find anything to convert.  Does anyone have any 
 > ideas?

"counter" is an integer and integers are immutable.
Therefore, "counter += 1" does not change the integer object
but assigns a new one to "counter". This change is local to
the "repair" incarnation. The "counter" in the caller is not changed.

-- 
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] ZODB object upgrades

2003-11-04 Thread alan milligan
Thanks for the reply, you've raised a couple of points I need clarification 
upon...

Attributes added to product code are not automatically present in the 
objects defined by that code, only those created by that code. Methods, 
however, will be present on all instances of a given class. I won't bother 
to connect the dots for you.
These attrubutes whilst not stored in ZODB *are* still available as the 
persistent data is bound to the class during the setstate call.  Is this not 
so??

Are you sure that you have a product for all those potential orphans out 
there? Otherwise, the above won't work: you'll need to look for distinct 
signature somehow, presuming those objects even function: I don't know how 
true orphans behave.
Yes, if I am to believe the Logger in that it's not throwing up any nasty 
ZODB messages as it's unpickling all the storage.

So, has anyone got some ingenious way to upgrade this persistent data into 
the new object type??

Cheers, Alan

_
Gaming galore at  http://xtramsn.co.nz/gaming !
___
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] ZODB object upgrades

2003-11-03 Thread J. Cameron Cooper

I now desperately need to write a parser to convert all of these 
nasties to ZCurrency types.   I've come up with the following 
ExternalMethod - whereby I've defined a __currency__ attribute in each 
obselete incantation's product (Currency object's are used in the 
spirit of DateTime rather than within ObjectManager containment 
structures):
Attributes added to product code are not automatically present in the 
objects defined by that code, only those created by that code. Methods, 
however, will be present on all instances of a given class. I won't 
bother to connect the dots for you.

Are you sure that you have a product for all those potential orphans out 
there? Otherwise, the above won't work: you'll need to look for distinct 
signature somehow, presuming those objects even function: I don't know 
how true orphans behave.

from Acquisition import aq_base
from Products.BastionBanking.ZCurrency import ZCurrency
def repair(container, counter=0):
   for (k,v) in container.__dict__.items():
   if hasattr(v, '__currency__'):
   setattr(container, k, ZCurrency(v._currency, v._amount))
   counter += 1
   for object in container.objectValues():
   for (k,v) in object.__dict__.items():
   if  hasattr(v, '__currency__'):
   setattr(object, k, ZCurrency(v._currency, v._amount))
   counter += 1
   if hasattr(aq_base(object), 'objectValues'):
   repair(object, counter)
   return counter
I'll trust that your __dict__ stuff up there works: never tried it myself.

 --jcc

--
"My point and period will be throughly wrought,
Or well or ill, as this day's battle's fought."


___
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] ZODB object upgrades

2003-11-02 Thread alan milligan
Hi,

Over the last month or so, I've rather wonderfully managed to corrupt my 
ZODB with artifacts of my Currency class that no longer exist.

This is due to:
(i) moving the module to a different package (twice)
(ii) renaming the module
(iii) changing it's inheritance hierarchy (having removed all Zope-awareness 
from class has caused loads of setstate issues in regard to either 
__basicnew__ not found, AttributeErrors, and problems with non-derivation 
from AcquireImplicitWrapper)

I now desperately need to write a parser to convert all of these nasties to 
ZCurrency types.   I've come up with the following ExternalMethod - whereby 
I've defined a __currency__ attribute in each obselete incantation's product 
(Currency object's are used in the spirit of DateTime rather than within 
ObjectManager containment structures):

from Acquisition import aq_base
from Products.BastionBanking.ZCurrency import ZCurrency
def repair(container, counter=0):
   for (k,v) in container.__dict__.items():
   if hasattr(v, '__currency__'):
   setattr(container, k, ZCurrency(v._currency, v._amount))
   counter += 1
   for object in container.objectValues():
   for (k,v) in object.__dict__.items():
   if  hasattr(v, '__currency__'):
   setattr(object, k, ZCurrency(v._currency, v._amount))
   counter += 1
   if hasattr(aq_base(object), 'objectValues'):
   repair(object, counter)
   return counter
However, it doesn't seem to find anything to convert.  Does anyone have any 
ideas?

TIA, Alan

_
Surf the net and talk on the phone with Xtra Jetstream @  
http://www.xtra.co.nz/products/0,,5803,00.html !

___
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] ZODB 3.2 feedback

2003-09-29 Thread Jeremy Hylton
Has anyone had a chance to test ZODB 3.2b3?  We're hoping to do a
release candidate tomorrow, and it would be good to know if anyone has
tried to the beta release.  If you've got a current CVS checkout of Zope
2.7, that's got the same code.

Jeremy



___
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] ZODB 3.2b2 release

2003-06-17 Thread Jeremy Hylton
We have released ZODB 3.2b2 available from the usual place:
http://www.zope.org/Products/ZODB3.2

This release includes several critical bug fixes for ZEO.  The bugs are
more likely to affect sites that see a lot of read conflicts (resolved
or unresolved).  The bugs can cause data loss or corruption.  These are
the same bug fixes that went into ZODB 3.1.2b2 last week.

ZODB 3.2 has a number of new features and improvements over ZODB 3.1:
  - improve performance and stability of ZEO
  - new ZEO authentication protocol
  - new configuration language, ZConfig, for databases, storages, 
and ZEO servers
  - many bug fixes

I have included the release notes for 3.2b2 below.

Jeremy

What's new in ZODB3 3.2 beta 2
==
Release date: 16-Jun-2003

Fixed critical race conditions in ZEO's cache consistency code that
could cause invalidations to be lost or stale data to be written to
the cache.  These bugs can lead to data loss or data corruption.
These bugs are relatively unlikely to be provoked in sites with few
conflicts, but the possibility of failure existed any time an object
was loaded and stored concurrently.

Fixed a bug in conflict resolution that failed to ghostify an object
if it was involved in a conflict.  (This code may be redundant, but it
has been fixed regardless.)

The ZEO server was fixed so that it does not perform any I/O until all
of a transactions' invalidations are queued.  If it performs I/O in the
middle of sending invalidations, it would be possible to overlap a
load from a client with the invalidation being sent to it.

The ZEO cache now handles invalidations atomically.  This is the same
sort of bug that is described in the 3.1.2b1 section below, but it
affects the ZEO cache.

Fixed several serious bugs in fsrecover that caused it to fail
catastrophically in certain cases because it thought it had found a
checkpoint (status "c") record when it was in the middle of the file.

Two new features snuck into this beta release.

The ZODB.transact module provides a helper function that converts a
regular function or method into a transactional one.

The ZEO client cache now supports Adaptable Persistence (APE).  The
cache used to expect that all OIDs were eight bytes long.



___
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] ZODB 3.1.2b2 released

2003-06-13 Thread Jeremy Hylton
We have released ZODB 3.1.2b2 available from the usual place:
http://www.zope.org/Products/ZODB3.1

This release includes several critical bug fixes for ZEO.  The bugs are
more likely to affect sites that see a lot of read conflicts (resolved
or unresolved).  The bugs can cause data loss or corruption.  

I would strongly advise ZEO users to consider upgrading.  This release
has seen more internal stress testing that normal and should be fairly
stable for production use.  I hope to get a final release out as soon as
possible.

The release notes (below) describe the fixes in more detail.

Jeremy

What's new in ZODB3 3.1.2 beta 2?
=

Fixed critical race conditions in ZEO's cache consistency code that
could cause invalidations to be lost or stale data to be written to
the cache.  These bugs can lead to data loss or data corruption.
These bugs are relatively unlikely to be provoked in sites with few
conflicts, but the possibility of failure existed any time an object
was loaded and stored concurrently.

Fixed a bug in conflict resolution that failed to ghostify an object
if it was involved in a conflict.  (This code may be redundant, but it
has been fixed regardless.)

The ZEO server was fixed so that it does not perform any I/O until all
of a transactions' invalidations are queued.  If it performs I/O in the
middle of sending invalidations, it would be possible to overlap a
load from a client with the invalidation being sent to it.

The ZEO cache now handles invalidations atomically.  This is the same
sort of bug that is described in the 3.1.2b1 section below, but it
affects the ZEO cache.

Fixed several serious bugs in fsrecover that caused it to fail
catastrophically in certain cases because it thought it had found a
checkpoint (status "c") record when it was in the middle of the file.



___
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] ZODB: Are all handles closed?

2003-03-07 Thread Steve Alexander
Ulla Theiss wrote:
Hello list,

in our product (and additionally in an other process) we use separate
ZODB-Storages.
Opening and closing the ZODB several times the number of file-handles
increases.
You might want to post this to [EMAIL PROTECTED] instead of 
[EMAIL PROTECTED]

Also, be sure to say what version of python and zodb you are using.

--
Steve Alexander


___
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] ZODB: Are all handles closed?

2003-03-07 Thread Ulla Theiss
Hello list,

in our product (and additionally in an other process) we use separate
ZODB-Storages.

Opening and closing the ZODB several times the number of file-handles
increases.

We have separated the multiple openings and closings to the following
code.
It shows the increasing of the handles clearly.

Have we forgotten to clear anything or made anything wrong? 
If not, has anybody an idea, how to fix or work around the problem.

--snip--snap-
from ZODB import FileStorage, DB

for i in range (1,100):
storage=FileStorage.FileStorage("TestZODB.fs")
db = DB(storage)
db.open()
print "Open"
db.close()
print "Close"
storage.close()
--snip--snap-

Enother nice behaviour we can achieve with the following code:

--snip--snap-
from ZODB import FileStorage, DB

storage=FileStorage.FileStorage("TestZODB.fs")
db = DB(storage)

for i in range (1,100):
db.open()
print "Open"
db.close()
print "Close"
storage.close()
--snip--snap-

It works about seven times. Then the programm hangs completely.

Much thanks in advance,
Ulla.


___
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] ZODB 3.2 release plan posted

2002-11-05 Thread Jeremy Hylton
I have posted a tenative release plan for ZODB 3.2 in the ZODB Wiki at
http://www.zope.org/Wikis/ZODB/ZODB%203.2%20Release

There are a small set of proposed features centering around better
configuration and management of ZEO and ZODB.

Feedback is welcome.

Jeremy



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



Re: [Zope-dev] ZODB, Catalog and actually using it

2002-05-29 Thread Casey Duncan

[removed zodb-dev, don't cross post!]

If you are using plain catalogs then you need to store the path to the object 
somewhere (as metadata or as Zope does as the uid of the catalog record). 
Then traverse to it based on this path. In Zope you use (restrictedTraverse 
(or unrestrictedTraverse) to do this). You might need to roll your own 
traverser, but it shouldn't be too hard.

hth,

Casey

On Wednesday 29 May 2002 04:30 pm, Nicholas Henke wrote:
> On Wednesday 29 May 2002 04:20 pm, Casey Duncan wrote:
> > try:
> >
> >   ob = r.getObject()
> >   ob.function()
> 
> ob gets returned as None -- I think this is due to 
> AbstractCatalogBrain::getObject(). I don't believe self.aq_parent is set 
> correctly -- how is it supposed to be set ?
> 
> >
> > or if that doesn't work:
> >
> >   ob = catalog.getobject(r.data_record_id_)
> AttributeError -- getobject doesnt exist?
> 
> >   ob.function()
> >
> > Bear in mind that getObject traverses to the object which is expensive 
both
> > in time and memory if the number of results is large.
> 
> OK -- is there a better way to do all of this ?  What I am trying to do is 
> have ZODB store objects and Catalog maintain indexes on them. Now I can come 
> back and do a 'SELECT' on the objects, say for variable != 1, and somehow 
get 
> access to the original objects if I wish to. Is there somewhere that 
> documents using Catalog and PluginIndexes without all of the other Zope 
> stuff? Any documents on using it with the Zope stuff ?
> 
> Nic


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



Re: [Zope-dev] ZODB, Catalog and actually using it

2002-05-29 Thread Nicholas Henke

On Wednesday 29 May 2002 04:20 pm, Casey Duncan wrote:
> try:
>
>   ob = r.getObject()
>   ob.function()

ob gets returned as None -- I think this is due to 
AbstractCatalogBrain::getObject(). I don't believe self.aq_parent is set 
correctly -- how is it supposed to be set ?

>
> or if that doesn't work:
>
>   ob = catalog.getobject(r.data_record_id_)
AttributeError -- getobject doesnt exist?

>   ob.function()
>
> Bear in mind that getObject traverses to the object which is expensive both
> in time and memory if the number of results is large.

OK -- is there a better way to do all of this ?  What I am trying to do is 
have ZODB store objects and Catalog maintain indexes on them. Now I can come 
back and do a 'SELECT' on the objects, say for variable != 1, and somehow get 
access to the original objects if I wish to. Is there somewhere that 
documents using Catalog and PluginIndexes without all of the other Zope 
stuff? Any documents on using it with the Zope stuff ?

Nic
>

> hth,
>
> -Casey
>
> On Wednesday 29 May 2002 04:05 pm, Nicholas Henke wrote:
> > Hello~~
> > I am playing with using the Catalog class in ZCatalog along with
>
> CatalogQuery
>
> > to create a generic object layer on top of ZODB. I can index and search
> > til
>
> I
>
> > am blue in the face, and I always get the correct answers. Now for the
> > problems...
> >
> > Say I have the following obj:
> > class test(Persistent):
> > variable = 1
> > def function(self):
> > print self.__dict__
> >
> > now if I do:
> > catalog = Catalog()
> > catalog.addIndex('variable', Fieldindex('variable'))
> > catalog.addColumn('variable')
> > obj = test()
> > catalog.catalogObject(obj, id(obj))
> >
> > catalog_query = CatalogQuery(catalog, "variable==1")
> > results = catalog_query()
> > for r in results:
> > print r.variable  # ok
> > print r.getRID() # ok
> > print r.function # NameError
> >
> > ...so I can get an object (a mybrains instance )back that allows me to
> > print r.variable, but I cannot get r.function().
> > How does one do this? Is there a mapping between RIDs in the catalog and
>
> real
>
> > objects somewhere? Do I need to do that mapping in an IOBtree (it would
> > make the most sense since I am using id(obj) as the uid in the catalog)?
> > Is there somewhere in Zope/google/web that does this?
> >
> > Thanks for any help!!
> > Nic
> >
> >
> >
> > ___
> > Zope-Dev maillist  -  [EMAIL PROTECTED]
> > http://lists.zope.org/mailman/listinfo/zope-dev
> > **  No cross posts or HTML encoding!  **
> > (Related lists -
> >  http://lists.zope.org/mailman/listinfo/zope-announce
> >  http://lists.zope.org/mailman/listinfo/zope )



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



Re: [Zope-dev] ZODB, Catalog and actually using it

2002-05-29 Thread Casey Duncan

try:

  ob = r.getObject()
  ob.function()

or if that doesn't work:

  ob = catalog.getobject(r.data_record_id_)
  ob.function()

Bear in mind that getObject traverses to the object which is expensive both in 
time and memory if the number of results is large.

hth,

-Casey

On Wednesday 29 May 2002 04:05 pm, Nicholas Henke wrote:
> Hello~~
>   I am playing with using the Catalog class in ZCatalog along with 
CatalogQuery 
> to create a generic object layer on top of ZODB. I can index and search til 
I 
> am blue in the face, and I always get the correct answers. Now for the 
> problems...
> 
> Say I have the following obj:
> class test(Persistent):
>   variable = 1
>   def function(self):
>   print self.__dict__
> 
> now if I do:
> catalog = Catalog()
> catalog.addIndex('variable', Fieldindex('variable'))
> catalog.addColumn('variable')
> obj = test()
> catalog.catalogObject(obj, id(obj))
> 
> catalog_query = CatalogQuery(catalog, "variable==1")
> results = catalog_query()
> for r in results:
>   print r.variable  # ok
>   print r.getRID() # ok
>   print r.function # NameError
> 
> ...so I can get an object (a mybrains instance )back that allows me to print 
> r.variable, but I cannot get r.function(). 
> How does one do this? Is there a mapping between RIDs in the catalog and 
real 
> objects somewhere? Do I need to do that mapping in an IOBtree (it would make 
> the most sense since I am using id(obj) as the uid in the catalog)? Is there 
> somewhere in Zope/google/web that does this?
> 
> Thanks for any help!!
> Nic 
> 
> 
> 
> ___
> Zope-Dev maillist  -  [EMAIL PROTECTED]
> http://lists.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope )
> 



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



[Zope-dev] ZODB, Catalog and actually using it

2002-05-29 Thread Nicholas Henke

Hello~~
I am playing with using the Catalog class in ZCatalog along with CatalogQuery 
to create a generic object layer on top of ZODB. I can index and search til I 
am blue in the face, and I always get the correct answers. Now for the 
problems...

Say I have the following obj:
class test(Persistent):
variable = 1
def function(self):
print self.__dict__

now if I do:
catalog = Catalog()
catalog.addIndex('variable', Fieldindex('variable'))
catalog.addColumn('variable')
obj = test()
catalog.catalogObject(obj, id(obj))

catalog_query = CatalogQuery(catalog, "variable==1")
results = catalog_query()
for r in results:
print r.variable  # ok
print r.getRID() # ok
print r.function # NameError

...so I can get an object (a mybrains instance )back that allows me to print 
r.variable, but I cannot get r.function(). 
How does one do this? Is there a mapping between RIDs in the catalog and real 
objects somewhere? Do I need to do that mapping in an IOBtree (it would make 
the most sense since I am using id(obj) as the uid in the catalog)? Is there 
somewhere in Zope/google/web that does this?

Thanks for any help!!
Nic 



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



Re: [Zope-dev] ZODB thread safety issue.

2002-03-11 Thread Toby Dickenson

On Sun, 10 Mar 2002 11:52:24 +0100 (CET), Romain Slootmaekers
<[EMAIL PROTECTED]> wrote:

>This explains the problems we have with our system:
>we have a multithreaded system where each thread iteratese over a set of
>objects in the ZODB, and sees of something needs to be done... if so the
>thread does it. Now since each thread gets its own version of the object.
>our actions occur multiple times... 

I suggest one thread that scans the database. when it finds some work
to be done it adds a specification of the work into a work queue.
Seperate worker threads get thier work specification from the queue.

Exactly how you store the work queue depends on other factors, but I
suggest not in ZODB.

Toby Dickenson
[EMAIL PROTECTED]

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



Re: [Zope-dev] ZODB thread safety issue.

2002-03-10 Thread Dieter Maurer

Romain Slootmaekers writes:
 > Is there a way we can share the access to the objects, or do we have to
 > create a global lock ? And if we have to create a global lock, what's the
 > desired/standard approach in doing so.
You may have a look at "SharedResource" at

  



Dieter

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



  1   2   >