DBT instantiation of the object using constant variables

Hello

I use bdb 4.7.25 on freebsd 7.

Here is my code snippet:

-----

Sub
set ( const char * pData) {}
...
TODO: Paths of unnecessary duplicates should be optimized.
size_t dataLen = strlen (pData);
char * dataBuffer = new char [dataLen + 1];
strcpy (dataBuffer, pData);

DBT key (& pKey, sizeof (unsigned long long)), given (dataBuffer, dataLen + 1);

DbTxn * txnobj = NULL;
env_.txn_begin (NULL, & txnobj, DB_TXN_NOSYNC);
try {}
DB [writeIndex]-> put (txnobj, & keys and data, 0);
txnobj-> commit (DB_TXN_NOSYNC);
} catch (...) {
txnobj-> abort();
}
Remove dataBuffer;
}
-----

Since then, the rest of my application, I use string c ++, I can get data as a const char *.

And to put the data in BDB or tree B +, I'll need object Dbt, which accepts the char * only. So, I have to copy data unnecessarily and to free the memory allocated for each investment transaction.

How we optimize it? How can we instantiate Dbt object using variables constant to use for the operation of investment on DB. "put" operation do not object of Dbt need to get the update, so it should there have supported the API for constant variables.

I hope my question is clear and simple.

You can do a 'const_cast(pData);"

DB::put will not change your data in all cases. If you need to make sure that the block of pData memory is not accessible by other threads/processes during the Db::put operation.

David

Tags: Database

Similar Questions

  • Iterate through rows in the object using the pageflowscope variable view

    I'm looking for a way to browse multiple lines of a view object and the transaction using a variable that is stored in a variable pageflowscope programmatically.

    I have two view objects that have a relationship of the master / detail.  The jsf page ADF Master table secondary table created by the control of data objects. The requirement is to have a single button that when pressed will update all the selected record of the master detail records.  One of the operations that must be done is a value that is stored in a variable PageFlowScope.

    The approach adopted to accomplish this was based on the following video:

    ADF Insider Essentials: Iteration through rows in a view object programmatically

    Author: Grant Ronald

    Link: http://download.oracle.com/otn_hosted_doc/jdeveloper/11gdemos/ADF_Insider_Essentials/IterateRows/IterateRows.html

    I created the Classes of line of sight for the two display objects and developed the method for updating the lines (code below).  The method that takes no parameters, has been added as a tool bar button to the page and works as expected when you use a hardcoded value.  I would add a second update statement in the while loop to update another column, but using the value of the variable PageFlowScope is stored a previous view in the taskflow.

    I thought I'd be able to use AdfFacesContext.getCurrentInstance () .getPageFlowScope().get("objectid") to get the value but I get a warning in the source editor, 'this guy or a variable 'AdfFacesContext' not found. "

    How can I do this?

    JDeveloper Studio Edition Version 11.1.2.4.0

    METHOD CODE:

    /**

    * Method to update the tool work order status

    */

    public void checkInTools() {}

    All lines wor (RowSet) = getWOToolAsg ();

    While (wor.hasNext ()) {}

    CurrentRow = (WOToolAsgVORowImpl) wor.next () WOToolAsgVORowImpl;

    currentRow.setToolActive("Y");

    Add code here to get OpNmb of pagescope variable and update record in table - type String

    }

    }

    Thank you.

    Scott

    You must import the class to use.

    Import oracle.adf.view.rich.context.AdfFacesContext;

    AdfFacesContext (Java QAnywhere for Oracle ADF Faces)

  • Applying the addEventListener method to the Clips using a variable for example appoints

    This project is in HTML5 Canvas using Javascript in Adobe animate.

    I have a lot of movie clip symbols of film, all with a single instance (for example name ('arms', 'head', 'leg', 'foot', etc.). I also have a display of graphics and text clip ("text") which has a keyframe labeled corresponding to each of these symbols instance names. When a symbol is clicked, I want the clip "displayText" to access the appropriate section.

    There are a large number of these clickable symbols in each of several animations, so I definitely want to be able to do this in a way auto-tableau, it is too many to write code for each.

    What I have is this:

    var objects = ['arms', 'head', 'leg', 'foot'];

    var clickObject = null;

    for (i = 0; i < objects.length; i ++) {}

    clickObject = (objects [i]);

    clickObject.addEventListener ("click", displayText.bind (this));

    }

    function displayText() {}

    this.displayAndSound.gotoAndStop (clickObject);

    }

    Console says "clickObject.addEventListener is not a function", and I have tried many variations of the scope, using onClick rather than a listener events, etc, etc. What I am doing wrong - something to do with the scope? Something to variables vs channels? Something to do with how javascript regarding instance names? Legally binding?

    I can get it works fine outside of the loop, using names of the current instance, fixed, so hopefully it's a clue to what goes wrong...

    Any help much appreciated.

    Look at what you do in the loop. You do not clickObject for an object reference, configure that you just want it set to a string value.

    Assuming that the objects are at the same level as the code, you should do instead:

    clickObject = this [object [i]];

    Property accessors - JavaScript | DND

    In addition, your event handler probably don't do what you hope, that he will, because the value of clickObject will be just what you set to last in the main code. You may need to use the event object.

    EaselJS tutorial: Mouse Interaction

    EaselJS v0.8.2 API Documentation: MouseEvent

  • Views of the object using

    I have a structure of type object as shown below:
    < pre >
    CREATE TYPE address_t AS OBJECT
    (
    Street VARCHAR2 (20).
    City VARCHAR2 (10),
    State CHAR (2),
    zip VARCHAR2 (10)
    );


    CREATE TYPE employee_t AS OBJECT
    (
    ENO NUMBER,
    Ename VARCHAR2 (20).
    NUMBER of salary
    );

    CREATE TYPE employee_list_t AS TABLE of employee_t;

    CREATE TYPE dept_t AS OBJECT
    (deptno NUMBER,
    deptName VARHCAR2 (20),
    address address_t,
    emp_list employee_list_t
    );

    CREATE VIEW dept_t WITH the IDENTIFIER of OBJECT (deptno) AS dept_view
    SELECT d.deptno, d.deptname,
    address_t (d.deptstreet, d.deptcity, d.deptstate, d.deptzip) AS deptaddr,
    CAST (TYPE MULTISET)
    SELECT e.empno, e.empname, e.salary
    FROM emp e
    WHERE e.deptno = d.deptno)
    AS employee_list_t)
    AS emp_list
    DEPT d;

    < / pre >

    What I want to do is to use a variable of type dept_view % ROWTYPE. How this can be done. I get the error as
    PL/SQL: ORA-00947: not enough values
    < pre >
    DECLARE
    y employee_list_t: = employee_list_t (employee_t (NULL, NULL, NULL));
    x dept_t: = dept_t (NULL, NULL, address_t (NULL, NULL, NULL, NULL), y);
    BEGIN
    SELECT *.
    X
    OF dept_view
    WHERE ROWNUM = 1;
    END;
    < / pre >

    In circumstances where Oracle treats attributes of type object as separate columns (tables of objects, views of the object, functions table), use the operator (VALUE or virtual OBJECT_VALUE) (previously SYS_NC_ROWINFO$) to access the entire object type, for example

    DECLARE
       x dept_t;
    BEGIN
       SELECT VALUE (dv)
         INTO x
         FROM dept_view dv
        WHERE ROWNUM = 1;
    END;
    /
    

    DECLARE
    x dept_t;
    BEGIN
    SELECT dv.object_value
    X
    THE dv dept_view
    WHERE ROWNUM = 1;
    END;
    /

    Note: of course you can rebuild the object type also Cool online did, but there is a risk of an additional burden and maintenance, not to mention the issue of substituted etc. builders.

    Padders

  • How to access the Non-space data of the object using the API of the HTML5

    Using the Oracle cards HTML5 API, is it possible to access the data an excerpt when generating a map?

    For example, my database has a table named ITEMS:

    Table: ELEMENTS

    COL_A

    COL_B

    COL_C

    COL_D

    COL_E

    COL_F

    GEOMETRY

    This table contains a number of objects point.  With the help of Mapviewer, I can successfully create a map by using the HTML5 API.  Here is an example of how I used the constructor 'OM.layer.VectorLayer.TYPE_JDBC' to retrieve the objects point of my database.

    pointLayer = new OM.layer.VectorLayer ("PointLayer",

    {

    infoWindow: true,

    def:

    {

    type: OM.layer.VectorLayer.TYPE_JDBC,.

    dataSource: "myDatabase",.

    SQL: "SELECT * FROM POINT."

    geometryColumn: "GEOMETRY."

    labelColumn: "COL_A."

    loadOnDemand: false,

    URL: baseURL

    },

    renderingStyle: circleMarker

    });

    How can I use the HTML5 API to access the data in the other columns (COL_A, COL_B, etc.) of my table?

    I know that the methods DisplayInfoWindow() and displayTabbedInfoWindow of the Map class to view this information by clicking on a specific point on the map.  But I would like to have access to all the points to create a table below my map showing all points (and their data) shown on the map.

    Hello

    You can try this code:

    functions var = pointLayer.getAllFeatures ();

    for (var i = 0; i)

    {

    Features [i]. GetAttributes() ["COL_A"];

    Features [i]. GetAttributes() ["COL_B"];

    ......

    }

  • How to check what are the objects using this public synonym?

    Hi Experts

    Currently, I have a public synonym, WORK that is created for WORK table in the schema of the BRAND: "synonym PUBLIC EMPLOYMENT BRAND. JOB. "
    SELECT THIS OPTION. WORK is granted to the TOM_UPDATE (a role): GRANT SELECT ON MARK. JOBS AT TOM_UPDATE;

    I am using TOAD 9.6.1.1 and I wanted to drop the public synonym but I am not able to see that another object in the database uses this public synonym, JOB.

    Help, please.

    moslee wrote:
    Hi Experts

    Currently, I have a public synonym, WORK that is created for WORK table in the schema of the BRAND: "synonym PUBLIC EMPLOYMENT BRAND. JOB. "
    SELECT THIS OPTION. WORK is granted to the TOM_UPDATE (a role): GRANT SELECT ON MARK. JOBS AT TOM_UPDATE;

    I am using TOAD 9.6.1.1 and I wanted to drop the public synonym but
    I am not able to see that another object in the database uses this public synonym, JOB.

    The objects are not "use the synonym".
    The code use synonym to access object.

    use grep allows you to browse the source code that resides in your repository

  • How can I spy on the properties of the object using oats 9.1

    Hi all

    How can I spy on the properties of the object in the oracle applications using oats9.1

    and also how to retrieve data from a database.

    Please help me on this point.

    Thank you
    Sudhir

    Hi sudhir,

    During recording, you can activate by clickign the icon 'Add Test object' object browser on the toolbar. You can highlight the object on the page and select by pressing F10. In the dialog box, and then choose the properties you want to test.

    See you soon,.
    Jamie

  • Properties of the object using nested in the dataField DataGrid

    I fill a DataGrid with an ArrayCollection of objects collection. Each of these objects has a property that is itself an object. I want to use a property of the object of the second (or "nested") as a dataField for one of my articles.

    No idea how to make this work? A rendering custom element would be the only way?

    ~ dimival:

    Thanks for the reminder. I use point made almost exclusively, so I forgot about the functions of label. I was able to make it work like this:

  • Question about the use of constant variables in forms

    As I am still very new to forms, please forgive my ignorance, if the answer to my question is very simple. I'm trying to understand how to use constant variables in my application Forms. For example, if I want the return code of constants for the configuration application (not, mind these are examples):

    RC_SUCCESS CONSTANT PLS_INTEGER: = 1;
    RC_FAILURE CONSTANT PLS_INTEGER: = 0;
    RC_YEAR_DATA_NOT_FOUND: = 50;

    Then in a module I created, if I wanted to check the return code against one of the constants I would do:

    DECLARE
    RC PLS_INTEGER;
    BEGIN
    GET_YEAR_DATA ('2000 ', rc);
    IF rc = RC_YEAR_DATA_NOT_FOUND THEN
    -Make an error handling
    END IF;
    END;

    I know that you can declare constants within the individual procedures or packages, but I can't find information on how to do it in the world for the application. I read on the use of global variables in forms, but only the CHAR data type and the fact that the value can be modified doesn't really fit for this purpose have I missed something? Is there a config file or something for the Web server that can be used to configure these?

    Any help would be appreciated.

    Thank you

    To declare constants create a Package specification in a pll and deifne all your vitals, something like:

    PACKAGE PK_CONSTANTS IS
      RC_SUCCESS CONSTANT PLS_INTEGER := 1;
      RC_FAILURE CONSTANT PLS_INTEGER := 0;
      RC_YEAR_DATA_NOT_FOUND := 50;
    END;
    

    Then attach this pll for all your forms-modules and use it as

    IF rc = PK_CONSTANTS.RC_YEAR_DATA_NOT_FOUND THEN
      ..
    END IF;
    

    A word on exceptions or errors: to me more clear (and in the case of exceptions even better) to throw an exception only to hide behind return-codes.

  • OOP - how to pass variables between the branches of the object, but not instances of VI

    I have a main VI where a thread object goes through some subVIs initialization and then branches off into several parallel loops. My understanding is that each branch becomes a separate instance of the object. Data is passed between the loops using global variables, wrapped in the accessors (I can change this if someone has a better approach - reducing to a minimum the memory and the CPU usage is very important).

    I need to have a large number of instances of the main VI running at the same time. What would be the best way to ensure that the data transmitted between the loops of one instance of VI do not interfere with the data transmitted between the loops of another instance of VI?

    Thank you for your understanding.

    Ah, you're right. Stupid mistake on my part. It's all working now. The corrected code is attached.

  • Get the name of the object raising the event

    If I have a change event for a checkbox that is declared like this:

    topmostSubform.Page2.Competitions_CB.Checkbox::change - (JavaScript, client)

    How can I get the path of the object in a variable to process and extract the part "Competitions_CB"? Same route to the top of the tree of objects would be nice, but I can't seem to find the property that returns the object names.

    I went through all properties that seemed likely, xfa.event, events and this, but nothing seems to be what I'm after.

    Hello

    With the help of 'this.somExpression' will return a string of the trajectory of the entire article;

    XFA [0] form [0] .topmostSubform [0]. Page 2 [0]. Competitions_CB [0]. Box [0]

    You can also use 'xfa.context.somExpression' to return to the same thing, using xfa.context is very convenient when the code is in a script object and called many events of the object.

    In addition, "parent.name" would return the "Competitions_CB" part, so parent.somExpression would return

    XFA [0] form [0] .topmostSubform [0]. Page 2 [0]. Competitions_CB [0]

    Concerning

    Bruce

  • Use a variable name in a function?

    Here's my function...

    myInterval = setInterval (TTMO, 15);

    function TTMO () {}
    InstanceNameOfMovieClip._x = (InstanceNameOfMovieClip._x - _xmouse) / 10;
    InstanceNameOfMovieClip._y = (InstanceNameOfMovieClip._y - _ymouse) / 10-2;
    }

    Can I use a variable name instead of using the "InstanceNameOfMovieClip"? I tried, but it does not work. I also tried to use the correct hierarchy, as this ._parent. VariableName too.

    you have to concat the link with the movieclip using your variable of string like this

    var mcName_str = "bigBox_mc";

    This [mcName_str] ._x = 20;

    You can use this method to loop through the objects named in an incremental way

    for (var i: Number = 0; i<>
    {
    This ["mc" + i] ._x = 20;
    }

    hope that helped

  • Assignment of the object through the ESD Styles

    Hi all

    Someone of you have made use of attribute object Styles in ESD?  We tried this and, apparently, is not the appropriate elements to do so. We use xDocbook based on the ESD delivered with frame 7.0 default :-)  I tried to look at the default Docbook EDD that comes with frame 12, but there not the right items - I think that these are InsetStyle, AnchoredFrame and AnchoredFrameStyle.  I found them in the Dita EDD, but when I tried to import them into my existing xDocbook EDD, they are obviously not in the DTD/schema do not always work this way.

    Do you know if this is actually supported in Frame 12 or in 2015?  The frame 12 Structure Dev Guide says that you just insert an InitialObjectFormat element, then insert the style of the object using two InsetStyle for a simple chart or AnchoredFrameStyle for an anchored frame. However, these elements do not exist in our ESD or DTD.

    Does anyone know a work around or how it should actually work?

    Thank you very much

    Shelley Hoose

    Rogue Wave Software

    Shelley,

    Don't forget that there are two sets of definitions of element associated with each ESD:

    1. Definitions of element uses a DSP defines the elements and attributes that you can insert into ESD itself: these have tags such as ElementCatalog, element, AttributeList, TextFormatRules, AutoInsertions and so on.
    2. Definitions of element that defines a DSP are those created by the content of ESD. In the case of DocBook, include bridgehead, ChapterInfo, glossary, ListItem and so on.

    The EDD xdocbook which comes with 12 FM is a binary 12 FM, but its content, including the definitions of element it uses has not been updated since 7 FM. That's why the first line of the file reads "ESD Version is 7.0.

    To use the ESD features that have been added in later versions, you must update the element definitions used by your EDD to the version you want. If you use FM 12, you will need to open a DSP that uses the new features of FM 12 EDD and importing element definitions to use in your own ESD. A 12 ESD FM will say "Version of ESD is 12.0" at the top. Here is a sequence that works:

    1. FM 12, use StructureTools > new ESD.
    2. Save the resulting.
    3. Save your DocBook EDD.
    4. Open your DocBook EDD.
    5. Make up the dialog element definitions Import with file > import > element definitions.
    6. In the import of Document pop-up, select the new FM 12 you created.
    7. Hold down the CTRL key and click on the import button (or press Ctrl + Enter)

    The use of the CTRL key in step 7 is essential. Without it, FM important definitions of elements defined in ESD. You just created the file and do not have definitions of element inside. If you try to import a set of definitions of empty element, FM crashes. Instead, you want to import the element definitions used by the new ESD. That's what the CTRL key.

    EDD that have been added since 7 FM offers descriptions of the item and the text in the banner.

    -Lynne

  • question about documenting the properties of the object

    The new version of the Designer has a tool that allows us to print a report that displays the properties of the object used in a form template? For example... showing all properties such as size, models, fonts, by default, if a field is required or not, etc...? I also check to see if this feature has been added to the Workbench for forms and for process cards too.

    Neal:

    This looks like a problem, you can solve with a designer macro.

    I have a sample macro that will summarize the properties for all objects in a form.

    You can customize the macro so that it reported on the selected objects

    The macro is described here:

    http://blogs.Adobe.com/formfeed/2011/05/updated-form-report-tool.html

    The latest version of the macro is here:

    http://blogs.Adobe.com/formfeed/2011/09/more-macro-goodies.html

    John

  • Page number: make the objects to stay

    Hello, I am working on a dress up game and I have a problem with it. There are so many articles of clothing (which are video clips with drag and drop code base) that I had to create different pages for them. I have buttons (labeled as "dresses", "pants", etc.) that appear when you click on make this group of items. So very well. It's just that when an item is dragged over to the doll and set up, I want to stay here. But as soon as you click on another page, the point disappears. Is it possible to do items remain on the doll, even if they are part of a page?

    Here is an example of a game that does what I want: see how you can drag a dress on the doll, go to 'underwear' and the dress is still there? That. xD


    http://savivi.deviantart.com/art/soulless-Victorian-dress-up-137124180

    If you are using AS3 you reparenting the object using something in the sense of... dollMC.addChild (droppedObject). If you need to manage the positioning by.  If the doll had the same saving compared to the scene as the pages location, then you wouldn't need to adjust when occurs the addChild.

Maybe you are looking for