<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="country-region"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="place"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="City"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="address"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="Street"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
p
        {mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
</head>
<body lang=EN-AU link=blue vlink=blue>
<div class=Section1>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Hi,<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Your idea is interesting. That should
work.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>But, I am getting another small exception,
is there any work around this as well.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='margin-left:36.0pt'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>Exception
in search, case 0: (22, 'Invalid argument -- Cursor position must be set
before performing this operation')<o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:36.0pt'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>Traceback
(most recent call last):<o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:36.0pt'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'> File
"/…/Replica.py", line 282, in search<o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:36.0pt'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'> if
cur.count()>0:<o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:36.0pt'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>DBInvalidArgError:
(22, 'Invalid argument -- Cursor position must be set before performing this
operation')<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>I am using before invoking cur.count(), <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='margin-left:36.0pt'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>cur.pget(key=queries[i],
flags=DB_SET_RANGE)<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color="#333399" face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:#333399'>I can handle
this error, by catching this exception around. But seems like there is
something fundamentally wrong for this cursor implementation.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color="#333399" face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:#333399'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color="#333399" face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:#333399'>Regards,<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color="#333399" face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:#333399'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color="#333399" face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:#333399'>Sury<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span lang=EN-US style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 face=Tahoma><span lang=EN-US
style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span lang=EN-US style='font-size:10.0pt;font-family:Tahoma'>
pybsddb-bounces@argo.es [mailto:pybsddb-bounces@argo.es] <b><span
style='font-weight:bold'>On Behalf Of </span></b>phu<br>
<b><span style='font-weight:bold'>Sent:</span></b> Tuesday, 21 October 2008
12:11 PM<br>
<b><span style='font-weight:bold'>To:</span></b> Python bindings for Oracle
Berkeley DB<br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [pybsddb] BDB
Indexing and Joined Cursor issue</span></font><span lang=EN-US><o:p></o:p></span></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<div>
<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>A workaround (which I had
to use) is to ensure that any cursor you're going to join has at least one
result (via count(), I think it was), only join those that do, and be sure to
test for the case of having no such cursors.<o:p></o:p></span></font></p>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>On Mon, Oct 20, 2008 at 7:57 PM, Sury Soni <<a
href="mailto:ssoni@nextdigital.com">ssoni@nextdigital.com</a>> wrote:<o:p></o:p></span></font></p>
<div link=blue vlink=purple>
<div>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>Hi
All,</span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> </span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>I
am having issue in using joined cursor for indexed database.</span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> </span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>When,
there are no records for given joined cursor, ideally, jonedCursor.get(0)
should return None or raise some exception.</span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> </span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>But,
in my case, I am getting </span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> </span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>(-30975,
'DB_RUNRECOVERY: Fatal error, run database recovery -- PANIC: Invalid
argument')</span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>Traceback
(most recent call last):</span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
File "dbNode.py", line 71, in next</span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
data = self.joinedCursor.get(0)</span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> </span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>Later,
</span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> </span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>Exception
in destroy: (-30975, 'DB_RUNRECOVERY: Fatal error, run database recovery
-- PANIC: fatal region error detected; run recovery')</span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>Traceback
(most recent call last):</span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
File "dbNode.py", line 91, in destroy</span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
self.joinedCursor.close()</span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> </span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>Is
there any quick fix solution I can do?</span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> </span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>If
these exceptions are getting raised due to some other replication related
issue, there is no mechanism I can get that error code and handle the error
accordingly.</span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> </span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>When
I look into the source code, I can see following comments around this join
function wrapper API.</span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> </span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
/* FIXME: this is a buggy interface. The returned cursor</span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
contains internal references to the passed in cursors</span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
but does not hold python references to them or prevent</span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
them from being closed prematurely. This can cause</span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
python to crash when things are done in the wrong order. */</span></font><o:p></o:p></p>
<p><font size=1 color=silver face=Arial><span style='font-size:9.0pt;
font-family:Arial;color:silver'>____________________________________<br>
Sury Prakash Soni<br>
Developer</span></font><font color=silver><span style='color:silver'><br>
</span></font><font size=1 color=silver face=Arial><span style='font-size:9.0pt;
font-family:Arial;color:silver'>____________________________________<br>
<br>
<b><span style='font-weight:bold'>Next Digital<br>
</span></b>Level 8, <st1:address w:st="on"><st1:Street w:st="on">15 William St</st1:Street>,
<st1:City w:st="on">Melbourne</st1:City></st1:address> <br>
VIC 3000 <st1:country-region w:st="on"><st1:place w:st="on">Australia</st1:place></st1:country-region><br>
<b><i><span style='font-weight:bold;font-style:italic'>p</span></i></b> +61 3
8612 6888<br>
<b><i><span style='font-weight:bold;font-style:italic'>f</span></i></b>
+61 3 8612 6899<br>
<b><i><span style='font-weight:bold;font-style:italic'>m 0</span></i></b>433
661 327<br>
</span></font><font color=silver><span style='color:silver'><a
href="mailto:ssoni@nextdigital.com" target="_blank"
title="mailto:rmarshall@nextdigital.com mailto:agoldman@nextdigital.com"><font
size=1 color="#0066cc" face=Arial title="mailto:rmarshall@nextdigital.com"><span
title="mailto:rmarshall@nextdigital.com"><span style='font-size:9.0pt;
font-family:Arial;color:#0066CC'>ssoni@nextdigital.com</span></span></font></a></span></font><font
color="#0066cc" face=Arial><span style='font-family:Arial;color:#0066CC'><br>
</span></font><font color=silver><span style='color:silver'><a
href="http://www.nextdigital.com/" target="_blank"
title="http://www.nextdigital.com/"><font size=1 color="#0066cc" face=Arial
title="http://www.nextdigital.com/"><span title="http://www.nextdigital.com/"><span
style='font-size:9.0pt;font-family:Arial;color:#0066CC'>www.nextdigital.com</span></span></font></a></span></font><font
color=silver face=Arial><span style='font-family:Arial;color:silver'><br>
</span></font><font size=1 color=silver face=Arial><span style='font-size:9.0pt;
font-family:Arial;color:silver'>____________________________________</span></font><font
color=silver><span style='color:silver'><br>
<br>
</span></font><font size=1 color=gray face=Arial><span style='font-size:7.0pt;
font-family:Arial;color:gray'>This email and any attachments are intended only
for the use of the recipient and may be confidential and/or legally privileged.
Next Digital Group Pty Ltd ("Next Digital") disclaims liability for
any errors, omissions, viruses, loss and/or damage arising from using, opening
or transmitting this email. If you are not the intended recipient you must not
use, interfere with, disclose, copy or retain this email and you should notify
the sender immediately by return email or by contacting Next Digital by
telephone on +61 3 8612 6888.</span></font><o:p></o:p></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'> <o:p></o:p></span></font></p>
</div>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><br>
_______________________________________________<br>
pybsddb mailing list<br>
<a href="mailto:pybsddb@argo.es">pybsddb@argo.es</a><br>
<a href="http://mailman.argo.es/listinfo/pybsddb" target="_blank">http://mailman.argo.es/listinfo/pybsddb</a><br>
<a href="http://www.argo.es/%7Ejcea/programacion/pybsddb.htm" target="_blank">http://www.argo.es/~jcea/programacion/pybsddb.htm</a><o:p></o:p></span></font></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
</div>
</div>
</body>
</html>