Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
W wendelin.core
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1
    • Issues 1
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge requests 4
    • Merge requests 4
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • nexedi
  • wendelin.core
  • Issues
  • #2

Closed
Open
Created Jul 15, 2016 by Ivan Tyagov@TyagovDeveloper

just created ZBigArray cannot be used before transaction.commit()

I tried fresh new tutorial (in same machine as NEO install, https://www.nexedi.com/wendelin-Core.Tutorial.2016)

It fails now with this below.

ivan@neo:~$ virtualenv test


ivan@neo:~$ . test/bin/activate

(test) ivan@neo:~$ pip list

pip (8.1.2)

setuptools (24.0.3)

wheel (0.29.0)

(test) ivan@neo:~$ pip install 'ZODB<4.4.0dev' wendelin.core

(test) ivan@neo:~$ pip list

BTrees (4.3.1)

futures (3.0.5)

numpy (1.11.1)

persistent (4.2.1)

pip (8.1.2)

psutil (4.3.0)

setuptools (24.0.3)

six (1.10.0)

transaction (1.6.1)

trollius (2.1)

wendelin.core (0.7)

wheel (0.29.0)

zc.lockfile (1.2.1)

ZConfig (3.1.0)

zdaemon (4.1.0)

ZEO (5.0.0a0)

ZODB (4.3.1)

ZODB3 (3.11.0)

zodbpickle (0.6.0)

zope.interface (4.2.0)

(test) ivan@neo:~$ pip install ipython

(test) ivan@neo:~$ pip install neoppod[client]

(test) ivan@neo:~$ ipython

Python 2.7.9 (default, Mar  1 2015, 12:57:24)
Type "copyright", "credits" or "license" for more information.

IPython 5.0.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: from wendelin.bigarray.array_zodb import ZBigArray
   ...: from wendelin.lib.zodb import dbopen, dbclose
   ...: import transaction
   ...: import numpy as np


In [2]: root = dbopen('neo://XXXX@[XXXXX]:2051')

In [3]: root['A'] = A = ZBigArray((10,), np.int)

In [4]: for i in range(2):
   ...:   A.append( np.arange(4*1024*1024) )
   ...:   print i, A.shape
   ...:   transaction.commit()
   ...:
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-4-d270ca8db4df> in <module>()
      1 for i in range(2):
----> 2   A.append( np.arange(4*1024*1024) )
      3   print i, A.shape
      4   transaction.commit()
      5

/home/ivan/test/local/lib/python2.7/site-packages/wendelin/bigarray/__init__.pyc in append(self, values)
    230             delta_idx = [slice(None)] * len(self.shape)
    231             delta_idx[M] = slice(-delta, None)
--> 232             self[tuple(delta_idx)] = values
    233         except:
    234             # in case of error - rollback the resize and re-raise

/home/ivan/test/local/lib/python2.7/site-packages/wendelin/bigarray/__init__.pyc in __setitem__(self, idx, v)
    423
    424         # represent changed area by ndarray via getitem, then leverage ndarray assignment
--> 425         a = self.__getitem__(idx)
    426         a[:] = v
    427

/home/ivan/test/local/lib/python2.7/site-packages/wendelin/bigarray/__init__.pyc in __getitem__(self, idx)
    394
    395             # ~~~ mmap file part corresponding to full major slice into memory
--> 396             vmaM = self._fileh.mmap(pageM_min, pageM_max-pageM_min+1)
    397
    398

/home/ivan/test/local/lib/python2.7/site-packages/wendelin/bigarray/array_zodb.pyc in _fileh(self)
     87     def _fileh(self):
     88         if self._v_fileh is None:
---> 89             self._v_fileh = self.zfile.fileh_open()
     90         return self._v_fileh

/home/ivan/test/local/lib/python2.7/site-packages/wendelin/bigfile/file_zodb.pyc in fileh_open(self)
    512     # bigfile-like
    513     def fileh_open(self):
--> 514         fileh = _ZBigFileH(self)
    515         self._v_filehset.add(fileh)
    516         return fileh

/home/ivan/test/local/lib/python2.7/site-packages/wendelin/bigfile/file_zodb.pyc in __init__(self, zfile)
    599
    600         # IDataManager requires .transaction_manager
--> 601         self.transaction_manager = zfile._p_jar.transaction_manager
    602
    603         # when connection will be reopened -> txn_manager.registerSynch(self)

AttributeError: 'NoneType' object has no attribute 'transaction_manager'



(test) ivan@neo:~$ pip list
backports.shutil-get-terminal-size (1.0.0)
BTrees (4.3.1)
decorator (4.0.10)
futures (3.0.5)
ipython (5.0.0)
ipython-genutils (0.1.0)
neoppod (1.6.3)
numpy (1.11.1)
pathlib2 (2.1.0)
persistent (4.2.1)
pexpect (4.2.0)
pickleshare (0.7.2)
pip (8.1.2)
prompt-toolkit (1.0.3)
psutil (4.3.0)
ptyprocess (0.5.1)
Pygments (2.1.3)
setuptools (24.0.3)
simplegeneric (0.8.1)
six (1.10.0)
traitlets (4.2.2)
transaction (1.6.1)
trollius (2.1)
wcwidth (0.1.7)
wendelin.core (0.7)
wheel (0.29.0)
zc.lockfile (1.2.1)
ZConfig (3.1.0)
zdaemon (4.1.0)
ZEO (5.0.0a0)
ZODB (4.3.1)
ZODB3 (3.11.0)
zodbpickle (0.6.0)
zope.interface (4.2.0) 
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7