BDB- Recno multiple key/data pairs retrieval

Hey,
I am new to BDB and have just started to work with Berkley DB (ver. 5.3.15) using the Linux C API.
I set up a simple Recno DB which is populated with sequential keys 1,2,3….100. DB Records are in variable length size, although, I am limiting them to a max size.
Below are the environment and DB open flags I am using:
dbenv->open(dbenv, DB_HOME_DIR, DB_SYSTEM_MEM | DB_INIT_LOCK | DB_CREATE | DB_INIT_MPOOL, 0)
dbp->open(dbp, NULL, NULL,DATABASE_NAME, DB_RECNO, DB_CREATE, 0664))
Single record get/put or using cursor to iterate over the all DB works well.
However, I would like to retrieve multiple records in a single get call.
These records can be non-sequential.
For example, retrieving 3 records with the keys 4,89,90. I prefer the bulk buffer to be as minimal as possible (avoiding stack or heap unnecessary memory allocation).
I was reading and saw few examples about using bulk retrieval. Though, I couldn’t find any example for racno bulk get on multiple specified keys.
From what I figured out till now, it seems that I should use:
Get flags: DB_SET_RECNO, DB_MULTIPLE_KEY. And the macros: DB_MULTIPLE_INIT and DB_MULTIPLE_RECNO_NEXT to iterate over a bulk buffer received.
But, I couldn’t figure it out where and how I should specify the list of Keys.
Beside, the BDB man says: "For DB_SET_RECNO to be specified, the underlying database must be of type Btree, and it must have been created with the DB_RECNUM flag."
Does the BDB open with DB_RECNO flag imply that the underlying database is Btree? If creating Btree instead of recno, wouldn’t I loss access performances?
I would appreciate if anyone could supply some guidelines or an example which will assist me to figure it out how to retrieve multiple key/data pairs from a recno DB.
Thanks in advance
Kimel

I am checking the BDB to see if it can suit my needs (mostly performance wise).
It should work on a simple home router device and should hold router runtime information (static/dynamic).
This information should be accessible for process in the system which can write or read the device info.
The DB is not require to be persistent and is recreated every reboot (memory only).
I believe the DB will hold not more then 200 parameters at max.
DB access rate is around 30 records per sec (write/read)...
Currently, I think of either BDB or maybe just use a normal Linux shared memory (random access + semaphore).
Cons and pros to each...
If I choose BDB, I will use the in memory DB and recno due to access performance considerations.
Getting back to my question, I would like to be able to read a list of parameters in a single get call.
In order to use recno, I will give every parameter a unique id (1 - ip, 2 - subnet , 3 - default gateway).
e.g: ip , subnet , default gateway. (get keys 1,2,3)
Hope you have the relevant info.
Thanks

Similar Messages

  • Multiple key-value pairs in JNLP file

    Dear All,
    I have a JNLP file with multiple key-value pairs :
    <resources>
         <j2se version="1.4+"/>
         <jar href="lib/myFile.jar"/>
         <property name="url" value="URL/db"/>
         <property name="default" value="10"/>
         <property name="m1_query" value="URL1"/>
         <property name="m2_query" value="URL2"/>
         <property name="m3_query" value="URL3"/>
         <property name="p1_query" value="URL4"/>
         <property name="p2_query" value="URL5"/>
         <property name="p3_query" value="URL6"/>
         <property name="p4_query" value="URL7"/>
       </resources> I dont know what the key names are in the JNLP file so I cant use getProperty(keyname) directly. Is it possible to read all the key-value pairs in a HashMap and iterate through the list?
    Or is there any other way of dealing with it?
    Many thanks in advance.
    Regards
    Anuj

    Hi Riem,
    Thanks for your help ...
    while waiting for a reply ... I managed to do sort out my problem.
                     Properties p = System.getProperties();
                     for (Enumeration enu = p.propertyNames() ; enu.hasMoreElements() ;) {            
                       String key = (String)enu.nextElement();
                       Object value = p.getProperty(key);
                       if(!value.equals("")) {
                              keyValues.put(key, value);
                     }Thanks for your help.
    Cheers
    Anuj

  • DB_NOTFOUND: No matching key/data pair

    Hello,
        I'm trying to index a container that has about 3000 XML documents, like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <BO>
    <cadastro>
      <id>15</id>
      <ano>06</ano>
      <hash>2446aaa904cf9a5e2748b48b378b28ac</hash>
      <inicio>
       <data>
        <d>18</d>
        <m>05</m>
        <a>2006</a>
        <date>2006-05-18</date>
       </data>
       <hora>
        <h>12</h>
        <m>45</m>
        <s>09</s>
        <time>12:45:09</time>
       </hora>
      </inicio>
      <fim>
       <data>
        <d>18</d>
        <m>05</m>
        <a>2006</a>
        <date>2006-05-18</date>
       </data>
       <hora>
        <h>12</h>
        <m>52</m>
        <s>15</s>
        <time>12:52:15</time>
       </hora>
      </fim>
      <numFlash />
      <remoteAddr>200.222.152.218</remoteAddr>
      <remotePort>60843</remotePort>
      <maquina />
      <sispol />
    </cadastro>
    <validacao>
      <situacao>REPROVADO</situacao>
      <validadores>
       <avaliador>
        <nome>NELSON MIRANDA MATTOS FILHO</nome>
        <cpf>
         <numero>47577517534</numero>
        </cpf>
        <matricula />
       </avaliador>
       <escrivao>
        <nome>FLÁVIO AMORIM DE BRITO</nome>
        <matricula>5555</matricula>
        <cpf>
         <numero>12345678909</numero>
        </cpf>
       </escrivao>
       <delegado>
        <nome>FRANCISCO MEDSON LIMA MAIA</nome>
        <matricula />
        <cpf>
         <numero>41728670306</numero>
        </cpf>
       </delegado>
      </validadores>
      <data>
       <d>18</d>
       <m>05</m>
       <a>2006</a>
       <date>2006-05-18</date>
      </data>
      <hora>
       <h>12</h>
       <m>53</m>
       <s>26</s>
       <time>12:53:26</time>
      </hora>
      <maquina>
       <dhCadastro>
        <data>
         <d>02</d>
         <m>05</m>
         <a>2006</a>
         <date>2006-05-02</date>
        </data>
        <hora>
         <h>14</h>
         <m>17</m>
         <s>58</s>
         <time>14:17:58</time>
        </hora>
       </dhCadastro>
       <nome>Maquina01-DI</nome>
       <descricao />
       <ip>10.1.26.57</ip>
      </maquina>
      <obs>TESTE</obs>
    </validacao>
    <fato>
      <natureza>FURTO</natureza>
      <uf>AL</uf>
      <cidade>MACEIÓ</cidade>
      <bairro>ANTARES</bairro>
      <lougradouro />
      <pontoReferencia />
      <data>
       <d>18</d>
       <m>05</m>
       <a>2006</a>
       <date>2006-05-18</date>
      </data>
      <periodo>MANHA</periodo>
      <descricaoFato />
      <outrosDocumentos />
    </fato>
    <pessoas>
      <vitima>
       <cpf>
        <numero>41728670306</numero>
       </cpf>
       <rg>
        <orgaoEmissor />
        <uf />
        <dExpedicao>
         <d>0</d>
         <m>0</m>
         <a>0</a>
         <date>0-0-0</date>
        </dExpedicao>
        <numero />
       </rg>
       <nome>FRANCISCO MEDSON MAIA</nome>
       <sexo>M</sexo>
       <dNasc>
        <d>01</d>
        <m>01</m>
        <a>1926</a>
        <date>1926-01-01</date>
       </dNasc>
       <lougradouro>RUA X</lougradouro>
       <numero>12</numero>
       <bairro>CENTRO</bairro>
       <compl />
       <cidade>MACEIÓ</cidade>
       <uf>AL</uf>
       <cep />
       <naturalidade>
        <cidade>MACEIÓ</cidade>
        <uf>AL</uf>
       </naturalidade>
       <filiacao>
        <pai />
        <mae>MARIA</mae>
       </filiacao>
       <fone>
        <numResidencial>8288338887</numResidencial>
        <numCelular />
       </fone>
       <email />
       <estadoCivil>1</estadoCivil>
       <grauInstrucao>0</grauInstrucao>
       <turista>n</turista>
      </vitima>
    </pessoas>
    <documentos>
      <cpf>
       <numero>41728670306</numero>
      </cpf>
      <outros>
       <descricao>carteira da ordem dos musicos</descricao>
      </outros>
    </documentos>
    <objetos />
    <historico>O DECLARANTE INFORMA QUE, NO LOCAL, DATA E HORA ACIMA CITADOS, FORAM EXTRAVIADOS 2 DOCUMENTOS , ABAIXO DISCRIMINADOS: CPF Nº 417.286.703-06;CARTEIRA DA ORDEM DOS MUSICOS; OBS.: ESTE BOLETIM NÃO SUBSTITUI O(S) DOCUMENTO(S) ACIMA CITADO.</historico>
    </BO>
        I tried to index the node:
        <date>2006-05-18</date>
        Which occurs in many places in the document. So I assumed it should be an edge-type index? So I added:
    dbxml> addIndex "" date edge-element-equality-string
       But when I perform some operation to update any document, I get this:
    com.sleepycat.dbxml.XmlException: Error: DB_NOTFOUND: No matching key/data pair found, errcode = DATABASE_ERROR
            at com.sleepycat.dbxml.dbxml_javaJNI.XmlModify_execute__SWIG_0(Native Method)
            at com.sleepycat.dbxml.XmlModify.execute(XmlModify.java:81)
            at br.gov.al.delegaciainterativa.controles.Update.atualizaXml(Update.java:146)
            at br.gov.al.delegaciainterativa.bo.GerenciaBO.mudarStatusBO(GerenciaBO.java:327)
            at br.gov.al.delegaciainterativa.bo.GerenciaBO.mudarStatusParaEmEspera(GerenciaBO.java:281)
            at org.apache.jsp.admin.boResponsavelAlterar_jsp._jspService(org.apache.jsp.admin.boResponsavelAlterar_jsp:340)
            at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
            at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
            at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
            at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
            at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:667)
            at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
            at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
            at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
            at java.lang.Thread.run(Thread.java:595)
         Is this related to the wrong choice for indexes-types? In this case I'm trying to perform a date-range search.
    cheers,
    -- Breno

    Breno,
    You seem to be using both the dbxml shell and a servlet.
    Are they active at the same time? Also, when you start the shell
    are you careful to join the environment your servlet uses? To
    be sure, use:
    dbxml -v -h "<path_to_environment>"
    The -v will tell you whether it joined correctly.
    I suspect that you modified your container improperly by using the shell directly.
    That said, if you want real date ranges to work, you need to use a date or dateTime;
    however, if you do so, the values need to have the correct syntax in order to work.
    You can see syntax by doing this:
    dbxml> query "current-date()"
    dbxml> print
    There are also functions for current-dateTime() and current-time().
    If your dates are not syntactically correct, they'll be silently ignored in
    the index.
    Regards,
    George

  • How to key in and retrieve data?

    now i got this code..can pls teach me how to key in the data n retrieve data from the databasE?wat code should i need to use..got any reference?how can i edit the data too?and how i retrieve the data from database( Access) and display in my table?can guide me pls?thounsand of thank you.
    now i can link the database already..i know to create column but dunno how to create row..and dunno how to insert the data to the column that i created..and do not know how to display the data on my table that i created by usign java....
    import java.sql.*;
    public class Test
    public static void main(String[] args)
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    /* the next 3 lines are Step 2 method 2 from above - you could use the direct
    access method (Step 2 method 1) istead if you wanted */
    String dataSourceName = "mdbTEST";
    String dbURL = "jdbc:odbc:" + dataSourceName;
    Connection con = DriverManager.getConnection(dbURL, "","");
    // try and create a java.sql.Statement so we can run queries
    Statement s = con.createStatement();
    s.execute("create table TEST ( column_name integer )"); // create a table
    s.execute("insert into another values(1)"); // insert some data into the table
    s.execute("select column_name from another"); // select the data from the table
    ResultSet rs = s.getResultSet(); // get any ResultSet that came from our query
    if (rs != null) // if rs == null, then there is no ResultSet to view
    while ( rs.next() ) // this will step through our data row-by-row
    /* the next line will get the first column in our current row's ResultSet
    as a String ( getString( columnNumber) ) and output it to the screen */
    System.out.println("Data from column_name: " + rs.getString(1) );
    //s.execute("drop table TEST12345");
    s.close(); // close the Statement to let the database know we're done with it
    con.close(); // close the Connection to let the database know we're done with it
    catch (Exception err) {
    System.out.println("ERROR: " + err);
    }

    i know how to insert the data already..
    but
    a b c d e f g( in Microsoft Access)
    h
    i
    j
    k
    l
    now i can create the column of a b c d e f g..but how to create the h i j k l?
    and how i retrieve the data and let the data disply on my table that i create?

  • Can we achieve data conversion for my scenario key value pair

    My data 
    create table test
    ( id int,name varchar(10),value int, color varchar(20))
    I would like to have data in the following format 
    where each id will combination of data set for each row for a id and separated by delimiter from another set
    like a key value pair
    ID Value
    1 |a,10,green|a,15,blue|
    2 |b,11,red|b,12,yellow|
    Please let me know if this can be achived in SSIS using trasnformation or in SQL ?
    And if so what is the best approach to hande this conversion
    Mudassar

    Thanks for your help.
    I can assume that it can only be handled in SQL and this cant be done in SSIS transformations.
    EXAMPLE 4 - Using XML PATH & correlated subquery for sublist
    -- Create comma delimited sublist
    SELECT   Subcategory = ps.[Name],
             ColorList = Stuff((SELECT DISTINCT  ',
    ' + Color AS [text()]
                                FROM AdventureWorks2008.Production.Product
    p
                                WHERE p.ProductSubcategoryID = ps.ProductSubcategoryID
                                FOR XML PATH ('')),1,1,'')
    FROM     AdventureWorks2008.Production.ProductSubcategory
    ps
    ORDER BY Subcategory;
    GO
    Subcategory             ColorList
    Helmets                 Black, Blue, Red
    Hydration Packs         Silver
    Jerseys                 Multi, Yellow
    Mudassar

  • How to retrieve the multiple rows data on PDF form in a web service method using WSDL DataConnection

    How to retrieve the multiple rows data on PDF form in a web service method using WSDL DataConnection.
    I have a multiple rows on PDF form. All rows have 4 textfields. I want to submit the multiple rows data to a method defiened in webservice.
    Unable to retrieve the data in multiple rows within webservice method.

    Hi Paul,
    I'm now able to save the retrieved xml in a hidden text field and create dynamic table, and I'm able to fill this table from the XML, but the problem is that I could not find the correct way to loop on the xml, what I'm trying to say, the table will have number of rows with the data of the first row only, so can you tell me the right way to loop on the xml!
    this is my code
    TextField1.rawValue=xmlData.document.rawValue;
    xfa.datasets.data.loadXML(TextField1.rawValue, true, false);
    for(var i=0; i<count; i++)
    xfa.form.resolveNode("form1.P1.Table1.Row1["+i+"].Num").rawValue = xfa.datasets.data.record.num.value;
    xfa.form.resolveNode("form1.P1.Table1.Row1["+i+"].Name").rawValue = xfa.datasets.data.record.name.value;
    Table1.Row1.instanceManager.addInstance(true);
    Thanks
    Hussam

  • Concept to retrieve GL for open at key date (back date)

    Dear All,
    Need help in finding the concept for retrieving the GL items for open at key date (back date).
    I have a  requirement to retrieve all the open items of GL at particular  date.Please help me to write a query to retrieve those items which are present in BSAS table opened till that particular date.
    For example : suppose I need to find all the open items of GL till date 01.01.2014.Then we need to retrieve from BSAS table also.What will be the fetching criteria to retrieve from BSAS table.
    Regards
    Sushant

    Hi,
    As Jelena & Nabheet mentioned, these details are already available in standard transactions  FBL3N or FAGLL03. 
    One question is why do you need this report.
    i) In case, you need  to display only selected fields, you can ask the user to create a layout variant. If you want additional fields, there are BTE's available to add extra fields in the transaction. Other option is to create a custom report, call FBL3N transaction using submit statement and then read the runtime ALV data in the calling program.
    ii) If you are using it in smartforms print program, It is always better to copy the logic from FBL3N  than extracting data from BSIS & BSAS tables as that won't always give correct results ( Explanation given below ).
    For some GL's ,  accounting data does not get stored in tables BSIS & BSAS.  Configuration in GL master decides whether accounting document's detail will get stored in indexed tables BSIS & BSAS or not.
    Transaction FS00 ( GL master data)
    If line item display checkbox is ticked- GL accounting details will get stored in BSEG, BSIS & BSAS.
    If line item display checkbox is not set - GL accounting details will be available only in BSEG.
    Regards,
    DPM

  • Retrieving random key-value pair

    I am storing a large number of items I want to randomly select from. Say for example I want to store a massive list of competition entrants (10-100 million) and I want to keep randomly pulling out winners (and removing them ideally).
    At the moment I'm using a cursor on a DH_HASH database (I have tried a BTREE too) as follows:
    g_db.cursor(NULL, &dbc, 0);
    int res = dbc->get(&key, &data, DB_LAST); // tried DB_FIRST too
    This works somewhat ok, depending how I'm adding entries in the first place. If I add names very randomly it works fine. If, however, I add names perfectly in order (say I'm entering them from a pre-sorted list) I consistently get similar results back, say a lot of entries beginning "John".
    I tried reversing the stored keys, which again helps with randomisation, but then I end up with a lot of senoJ (Jones) entries.
    What I really want is completely randomized retrieval, but google hasn't helped me.
    Any help gratefully received!
    Cheers.
    (Note: my example is purely fictitious!)

    Hello,
    Perhaps making use of the set_h_hash method to set a user-defined hash function documented in the Reference Guide at:
    http://www.oracle.com/technology/documentation/berkeley-db/db/api_reference/C/dbset_h_hash.html
    Or setting your own Btree comparison via the set_bt_compare method documented in the Reference Guide at:
    http://www.oracle.com/technology/documentation/berkeley-db/db/programmer_reference/bt_conf.html#am_conf_bt_compare
    would help achieve the desired results.
    Thanks,
    Sandra

  • Multiple key items for a single data item?

    hi all. In my application multiple key items may have the same data item, such as:
    key data
    1 abcd
    1 abcd
    1 abcd
    2 efg
    2 efg
    but it may lead to a lot of duplicate storage spaces. I can use two dbs by giving each data item an ID, just like:
    db1
    key data
    1 1
    1 1
    1 1
    2 2
    2 2
    db2
    key data
    1 abcd
    2 efg
    is there any other simple solutions? thanks in advance

    Hello,
    This sounds like a data modeling question. I think your solution is reasonable, though you'll get a lot of good ideas and info if you read up on normalization for relational schemas - there's a ton of literature out there. Just do a search for "database normalization".
    Normalization is intended to eliminate redundancy and also avoid various update anomalies.
    Warm regards.
    ashok

  • CRM7 EH1 ICI/CTI: Add Key-Value Pair to Call Attached Data

    We are CRM 7 EHP1 integrated to Genesys CTI (Communication Mangement Software) through ICI.
    Is it possible in web_ui to add a Key-Value Pair (kvp) to the Call Attached Data (CAD) that it is sent back to the CMS?
    For example: When an agent clicks Transfer to transfer a call to a queue, just prior to the transfer we would like to add a new kvp to the CAD that is sent back to Genesys via ICI.
    Any advice on how to do this is appreciated.

    Hi shiva
    Thanks for your help,
    Can you check this coding and revert me back ASAP Please.
    REPORT BDS_GOS_CONNECTION.
    DATA : logical_system LIKE BAPIBDS01-log_system.
           CLASSNAME LIKE BAPIBDS01-CLASSNAME
           OBJKEY LIKE SWOTOBJID-objkey.
    PARAMETERS: pa_lo_sys BAPIBDS01-log_system,
                pa_class like BPIBDS01-CLASSNAME,
                pa_objkey like swotobjidobjkey.
    AT SELECTION-SCREEN.
    CALL FUNCTION 'BDS_GOS_CONNECTIONS_GET'
             EXPORTING
                  bor_id             = bor_id
             IMPORTING
                  logical_sytem      = pa_lo_sys.
                  classname          = pa_class.
                  objkey            = pa_objkey.
             EXCEPTIONS
                  no_objects_found     = 1
                  internal_error       = 2
                  internal_gos_error   = 3.
       IF sy-subrc <> 0.
         MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
       ENDIF.
    clear v_attno1.
    i_object1-typeid = 'BUS2012'.
    i_object1-catid  = 'BO'.
    i_object1-instid = i_yItem-docno.
    call method cl_gos_attachment_query=>count_for_object
       exporting
        is_object = i_object1
        ip_arl    = space
       receiving
        rt_stat   = i_stat1.
    read table i_stat1 into wa_stat1 index 1.
    if sy-subrc eq c_0.
        move wa_stat1-counter to v_attno1.
    endif.             
    CALL METHOD cl_gos_attachment_query=>count_for_object
    EXPORTING
    is_object = object
    ip_arl =    space
    RECEIVING
    rt_stat = lt_stat.
    READ TABLE lt_stat INDEX 1 into ls_stat.
    count = ls_stat-counter.
    *The object has to be a concatenation of your document, like this:
    CONCATENATE object-instid tab-gjahr INTO object-instid.
    ELSE.
    CONCATENATE tab-bukrs tab-belnr tab-gjahr INTO
    object-instid.
    ENDIF.

  • SSL: how to use Multiple Private key/Certificate pair for authentication.

    Hi all,
    i am implementing SSL in java using X509 Certificate/private key combination.
    i have two set of private key/certificate pair.
    one is factory default and another is generated at run time.
    my problem is to try ssl connection with both pairs on same tcp/ip connection.
    e.g. on server side: first try ssl connection with factory default certificate, if it fails try connecting with generated certificate on same tcp/ip connection.
    on client side: if generated certificate(this certificate was generated at server side) is present first perform server authentication using this certificate otherwise authenticate server with factory default certificate.
    can someone please help and let me know how do i need to configure both ends(client and server) for achieving the same.
    Thanks In Advance
    Saurabh Ahuja

    Client code does not contain any default truststore and needs a certificate for authentication.Of course it does. OpenSSL has a way of doing that: some kind of equivalent for the truststore. None of the stuff you've posted here about generating certificates at runtime has any bearing on that problem.
    It's like this. The idea of PKI with SSL is as follows:
    - the server has a private key and a signed certificate. Preferably it's signed by a CA that the client already trusts, otherwise if it's self-signed it has to be exported from the server's keystore and imported into the truststores of all the clients.
    - the client has a truststore that trusts the server, one way or the other, see above.
    - the server's private key is private to it. Nobody else has it. Nobody else can ever get it. If it ever leaks, the server is compromised, and server authentication via that private key now means absolutely nothing. You have lost security.
    - the server sends its cert to the client along with a digital signature signed by its private key.
    - the client (a) decides whether it trusts the cert, via its truststore, and (b) verifies the digital signature, which establishes that the server owns the certificate.
    At this point the server is authenticated to the client and the SSL connection is open. It can now be used as an ordinary socket connection.
    If you want client authentication too, you need all the above in reverse as well, i.e. reading server for client and client for server throughout. Note particularly that each client must have its own private key. Otherwise the private key isn't private, so signing something with it doesn't establish ownership, so client authentication isn't valid.
    You need to understand all this stuff and relate it to the apparently broken security design of your application. Generating a private key and a certificate at runtime is complete nonsense within the context of PKI and SSL. It proves nothing, establishes nothing, authenticates nothing; it just wastes time.

  • Maximum number of key/value pairs in btree or hash database

    It's not clear to me from the documentation what the limit is on the number of key/value pairs in a Btree or hash database. The documentation on logical record numbers says that the db_recno_t type is a 32-bit unsigned type, "which limits the number of logical records in a Queue or Recno database, and the maximum logical record which may be directly retrieved from a Btree database, to 4,294,967,295". What does "directly retrieved" mean in this sentence? Does this mean that Btree is limited to 4,294,967,295 key/vaue pairs? If so, is this also the limit for a hash database?

    Hi mcgarvek,
    In case of Queue, Recno and Btree configured for logical record numbers - you can do that by setting DB_RECNUM flag: http://www.oracle.com/technology/documentation/berkeley-db/db/api_c/db_set_flags.html#DB_RECNUM , the maximum number of records is 4,294,967,295 and after that limit, the next record will be inserted as record number 1.
    In case of Hash and Btree, the maximum database size depends on the page size selected by the application. Berkeley DB stores database file page numbers as unsigned 32-bit numbers and database file page sizes as unsigned 16-bit numbers. Using the maximum database page size of 65536, this results in a maximum database file size of 248 (256 terabytes).
    Database limits: http://www.oracle.com/technology/documentation/berkeley-db/db/ref/am_misc/dbsizes.html
    Logical record numbers: http://www.oracle.com/technology/documentation/berkeley-db/db/ref/am_conf/logrec.html
    Regards,
    Bogdan Coman

  • How to query berkeley db with multiple keys

    Hi all,
    Is there a way to query a berkeleydb using multiple keys. For example, I want to query a order record with orderID and orderDirection, orderID is a string and orderDirection is a char.
    Is there a way to do so?
    Regards,
    -Bruce

    Hi Bruce,
    Yes, you would use the same approach with a join cursor.
    Here is a simple example, simplified for brevity. Suppose the primary database "books" stores information about books, and that these books could have multiple authors. Following is some example data and the structure of these databases:
    books.db (primary db -- ISBN is primary key)
    isbn_1 | {author_1, author_2; ...}
    isbn_2 | {author_2; ...}
    isbn_3 | {author_1, author_3; ...}
    booksAuthors.db (secondary db -- author is the secondary key, the secondary key extractor generates multiple keys)
    author_1 | isbn_1
    author_1 | isbn_3
    author_2 | isbn_1
    author_2 | isbn_2
    author_3 | isbn_3
    To get the books authored by author_1 and author_2 for example, you would do the following:
    - position a cursor in the booksAuthors.db secondary db, using DBcursor->get() with the DB_SET flag, on the records whose key (secondary key) is author_1;
    The cursor will be positioned on the duplicates list for author_1:
    author_1 | isbn_1
    author_1 | isbn_3
    - position a cursor in the booksAuthors.db secondary db, using DBcursor->get() with the DB_SET flag, on the records whose key (secondary key) is author_2, hence duplicates list for author_2:
    author_2 | isbn_1
    author_2 | isbn_2
    - create a join cursor using DB->join, using the previous two cursors.
    An excerpt from the above documentation page explains the way a join cursor works:
    "Joined values are retrieved by doing a sequential iteration over the first cursor in the curslist parameter, and a nested iteration over each secondary cursor in the order they are specified in the curslist parameter. This requires database traversals to search for the current datum in all the cursors after the first."
    Hence, the data item (primary key from the primary db) that results is isbn_1.
    Regards,
    Andrei

  • G/L account key date

    Hi Experts,
            I need to generte a report for open items in the G/L account , based on the 
    <b>key date field..</b>
    please guide me.. from which table i need to retrieve the data.
    Not based on posting date or document date.. it should be key date
    input parameters are : company code,
                                      house bank,
                                      key date.
    Thanks in Advance,
    Regards,
    Sabari.

    Hi Sabari,
           All the G/L accounts transaction details u can see the tables.
              BKPF : - Accounting Document header table.
              BSEG: - Accounting Document  Item table.
              BSIS - G/L Accounts
    Check the table BSIS.
    Hope its useful for you.
    Thanks and regards
    Nisar.

  • No data to retrieve error

    Hi ,
    I have a Webi document with 4 queries and I merged all of them with org unit dimension.When I am refreshing this Webi document I am getting a message saying that "no data to retrieve <Query name>".
    When I created a new document by using same Universe I am able to see data.
    can any one let me know why this is happening and the way to resolve this please.
    Thanks,
    Rakesh

    Hi,
    When we use multiple queries in our report it just run queries parallely and give us the result.
    Please check if you have added some objects from other query by mistake.
    Do one thing take only one dimention objetc from the universe which is not giving data and test it with other query.
    I think this is how you could find out the reason why its happening.
    But i still belive there might be a objetc witch is restricing the data let me know the status.
    Cheers,
    Ravichandra K

Maybe you are looking for