dbTalk Databases Forums  

dbxml on Win32: Error in native libraries with certain queries from Python API

comp.databases.berkeley-db comp.databases.berkeley-db


Discuss dbxml on Win32: Error in native libraries with certain queries from Python API in the comp.databases.berkeley-db forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Petra Chong
 
Posts: n/a

Default dbxml on Win32: Error in native libraries with certain queries from Python API - 06-06-2006 , 03:57 AM






Hello,

Am observing a bizarre problem with dbxml and Python on Windows XP.
Versions as follows:

dbxml 2.2.13
bsddb3-4.3.3
python 2.4.1

Code as follows:

ENV_NAME = "C:/dbxml"
DB_NAME = "RefData"
ENV = DBEnv()
ENV.open (ENV_NAME,
DB_CREATE|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|D B_INIT_TXN, 0)
MGR = XmlManager(ENV, 0)


exists = MGR.existsContainer(DB_NAME)

if not exists:
CONTAINER = MGR.createContainer (DB_NAME)
else:
CONTAINER = MGR.openContainer (DB_NAME)

try:
print "Before query"
query = 'collection("RefData")/instrument[security_typ="Common
Stock"]'
#query = 'collection("RefData")/instrument'

qc = MGR.createQueryContext()
print "Created query context"
preparedQuery = MGR.prepare (query, qc)
print "prepared query"
results = preparedQuery.execute (qc) ***************
except .....

In the above query I am doing the equivalent of an SQL "where" clause:
I want to get all the documents which have the following pattern

<instrument>
<security>Common Stock</security>
....
</instrument>

This query fails at the starred line; it prints the error "Error: Could
not fetch DOM element for doc id: xx" and Python exits with a windows
appilcation error "The instruction at xxxxx referenced memory at xxxx.
The memory could not be written".

The very odd thing is that if I do the query which is commented out,
that is, a generic query for all instruments, it succeeds without any
errors.

I'm at my wits' end; have reinstalled everything. To make matters worse
a colleague can run the same code with no errors. Before I try
rebuilding Python and dbxml on my machine I thought I would post this
here.

Any help appreciated.

Regards,

PC


Reply With Quote
  #2  
Old   
Petra Chong
 
Posts: n/a

Default Re: dbxml on Win32: Error in native libraries with certain queries from Python API - 06-06-2006 , 05:18 AM






This has been solved.

The following stack of stuff

Quote:
dbxml 2.2.13
bsddb3-4.3.3
python 2.4.1
depends on libdb43.dll version 4.0.3.29.

I also have Subversion installed, and that has its own libdb43.dll
whose version is 4.0.3.28; Subversion is on my path before Sleepycat,
so that was being picked up. Of course, my colleague had a different
version of Subversion installed which uses libdb42.dll

Posting this here so it shows up for future searches, in case anyone
else runs into it in future.

Regards

PC


Petra Chong wrote:

Quote:
Hello,

Am observing a bizarre problem with dbxml and Python on Windows XP.
Versions as follows:

dbxml 2.2.13
bsddb3-4.3.3
python 2.4.1

Code as follows:

ENV_NAME = "C:/dbxml"
DB_NAME = "RefData"
ENV = DBEnv()
ENV.open (ENV_NAME,
DB_CREATE|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|D B_INIT_TXN, 0)
MGR = XmlManager(ENV, 0)


exists = MGR.existsContainer(DB_NAME)

if not exists:
CONTAINER = MGR.createContainer (DB_NAME)
else:
CONTAINER = MGR.openContainer (DB_NAME)

try:
print "Before query"
query = 'collection("RefData")/instrument[security_typ="Common
Stock"]'
#query = 'collection("RefData")/instrument'

qc = MGR.createQueryContext()
print "Created query context"
preparedQuery = MGR.prepare (query, qc)
print "prepared query"
results = preparedQuery.execute (qc) ***************
except .....

In the above query I am doing the equivalent of an SQL "where" clause:
I want to get all the documents which have the following pattern

instrument
security>Common Stock</security
...
/instrument

This query fails at the starred line; it prints the error "Error: Could
not fetch DOM element for doc id: xx" and Python exits with a windows
appilcation error "The instruction at xxxxx referenced memory at xxxx.
The memory could not be written".

The very odd thing is that if I do the query which is commented out,
that is, a generic query for all instruments, it succeeds without any
errors.

I'm at my wits' end; have reinstalled everything. To make matters worse
a colleague can run the same code with no errors. Before I try
rebuilding Python and dbxml on my machine I thought I would post this
here.

Any help appreciated.

Regards,

PC


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.