dbTalk Databases Forums  

Want to insert records into a primary over RPC w/ secondary update

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


Discuss Want to insert records into a primary over RPC w/ secondary update in the comp.databases.berkeley-db forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
tegonzalez@gmail.com
 
Posts: n/a

Default Want to insert records into a primary over RPC w/ secondary update - 08-15-2006 , 11:31 AM






I'd like to support a simple insert into a primary w/ a secondary key
update over RPC. One should be able to perform this from the
client-side and just wrap both put operations into a transaction. (?)

In the sample below, secondary_ is set to the secondary index (sdbp)
from Ron Cohen's basic associate example and
secondary_associate_callback_ is the getname function. What I'm after
is obtaining same index/key creation over RPC.

pdb->associate w/ a callback is not supported over RPC, so here's a
mock up of what I believe the associate does for you on an insert:

void
insert(int id, char *name)
{
Dbt key, data;
char idbuf[10];

sprintf(idbuf, "%05d", id);
key.set_data(idbuf);
key.set_size(strlen(idbuf));
data.set_data(name);
data.set_size(strlen(name));
printf("insert: %s\n", name);
assert(put(NULL, &key, &data, 0) == 0);
if (secondary_ != NULL)
{
if (secondary_associate_callback_ != NULL)
{
// reuse Dbt key, data;
Dbt skey;

assert(secondary_associate_callback_(this, &key, &data, &skey) == 0);
assert(secondary_->put(NULL, &skey,
&data, 0) == 0);
}
}

}

The part I'm unsure about is the put to the secondary. Will this
produce the same results as using an associate? Will this store &data
redundantly in secondary_?

Thanx,

-Tomas


Reply With Quote
  #2  
Old   
Michael Cahill
 
Posts: n/a

Default Re: Want to insert records into a primary over RPC w/ secondary update - 08-15-2006 , 07:35 PM






Hi Tomas,

I've responded on the new forum for Berkeley DB discussion on OTN:

http://forums.oracle.com/forums/thre...hreadID=413452

Regards,
Michael.


Reply With Quote
  #3  
Old   
Paul Marquess
 
Posts: n/a

Default Oracle Forums (was Re: Want to insert records into a primary over RPC w/ secondary update) - 08-16-2006 , 02:49 AM



Michael Cahill wrote:

Quote:
Hi Tomas,

I've responded on the new forum for Berkeley DB discussion on OTN:

http://forums.oracle.com/forums/thre...hreadID=413452
Michael, I might be reading too much between the lines here, but does you
responding via an oracle forum signify a shift in policy from the sleepycat
folk about how they will use this group?

Unless I've missed something, the only way to get the Berkeley DB Oracle
forum sent to you is via RSS, and that doesn't work very well (you only get
the first line of a response).

Paul



Reply With Quote
  #4  
Old   
Michael Cahill
 
Posts: n/a

Default Re: Oracle Forums (was Re: Want to insert records into a primary over RPC w/ secondary update) - 08-16-2006 , 08:12 AM



Hi Paul,

Quote:
Michael, I might be reading too much between the lines here, but does you
responding via an oracle forum signify a shift in policy from the sleepycat
folk about how they will use this group?
I didn't intend to signify anything significant by posting the reponse
on OTN. The Berkeley DB, DB XML and DB JE engineers are all still
scanning the newsgroup as well.

Quote:
Unless I've missed something, the only way to get the Berkeley DB Oracle
forum sent to you is via RSS, and that doesn't work very well (you only get
the first line of a response).
It would be nice to get more text in the RSS feeds from OTN, and that
has been requested of the folks who run OTN. Is that the only reason
why you prefer the newsgroup?

Michael.



Reply With Quote
  #5  
Old   
Paul Marquess
 
Posts: n/a

Default Re: Oracle Forums (was Re: Want to insert records into a primary over RPC w/ secondary update) - 08-16-2006 , 09:44 AM



Michael Cahill wrote:

Quote:
Hi Paul,

Michael, I might be reading too much between the lines here, but does you
responding via an oracle forum signify a shift in policy from the
sleepycat folk about how they will use this group?

I didn't intend to signify anything significant by posting the reponse
on OTN. The Berkeley DB, DB XML and DB JE engineers are all still
scanning the newsgroup as well.
OK.

Quote:
Unless I've missed something, the only way to get the Berkeley DB Oracle
forum sent to you is via RSS, and that doesn't work very well (you only
get the first line of a response).

It would be nice to get more text in the RSS feeds from OTN, and that
has been requested of the folks who run OTN. Is that the only reason
why you prefer the newsgroup?
Yep.

Paul


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.