dbTalk Databases Forums  

sequences and secondary DBs

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


Discuss sequences and secondary DBs in the comp.databases.berkeley-db forum.



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

Default sequences and secondary DBs - 11-08-2005 , 12:51 PM






Hi,

Looks like one can't use sequences in DBs that have a secondary DB.
This may or may not be reasonable, but it would be a good idea to
mention it in the docs or have a better error message. Right now it's
giving an "Invalid Argument Exception" with a 'null' detail message.

this is with 4.3.29

Best,
Boris


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

Default Re: sequences and secondary DBs - 11-08-2005 , 05:16 PM






Hi Boris,

Quote:
Looks like one can't use sequences in DBs that have a secondary DB.
This may or may not be reasonable, but it would be a good idea to
mention it in the docs or have a better error message.
This is kind of a strange thing to do -- how do you expect to look up
the sequence from the secondary index?

As far as I know, it is possible to put a sequence in a primary
database, but your secondary key callback needs to know about it and
either not generate a secondary key (by returning false in the Java
API), or by generating a secondary key solely on the basis of the
primary (not using the sequence data).

Quote:
Right now it's giving an "Invalid Argument Exception" with a 'null' detail message.
What is giving this exception? What operation is your application
performing when the exception occurs? What does your
createSecondaryKey method do? What does the stack trace look like?

Regards,
Michael.



Reply With Quote
  #3  
Old   
Borislav
 
Posts: n/a

Default Re: sequences and secondary DBs - 11-08-2005 , 06:20 PM



To be honest, I'm not expecting anything from the secondary index. I
didn't think I needed to worry about it. The way the API is defined,
one is led to believe that there's not interference b/w the main data
and the sequences associated with the DB.

The exception is thrown by the Database.openSequence method. It is not
thrown when a secondary database is not created.

So the proper/safe way would then be to create a "sequences" table in
an environment...

Thanks,
Boris


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.