HELP, about DB_AUTO_COMMIT

look at the following codes,
the compilation can be successful, but when executing it,
ret=dbp->put(dbp,txn,&key,&data,0); will return non-zero, if
db_flags is db_create|db_auto_commit, the execution can be normal,
I do not know why,
why can not I set the env to be non-auto commit?
#include <stdio.h>
#include <stdlib.h>
#include <db.h>
#include <string.h>
int main(void)
{ int ret;
u_int32_t db_flags,env_flags;
DB *dbp;
DB_ENV *envp;
DBT key,data;
DB_TXN *txn;
const char *db_home_dir="/home/oracle/env";
const char *file_name="mydb.db";
int k=1;
int d=2;
dbp=NULL;
envp=NULL;
ret=db_env_create(&envp,0);
if(ret!=0)
{fprintf(stderr,"Error create env\n",db_strerror(ret));
  return 0;
env_flags=DB_CREATE|DB_INIT_TXN|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL;
u_int32_t flags;
//ret=envp->set_flags(envp,DB_LOG_INMEMORY,1);
//envp->set_lg_bsize(envp,1024*1024);
//fprintf(stderr,"%s",db_strerror(ret));
ret=envp->open(envp,db_home_dir,env_flags,0);
if(ret!=0) {
fprintf(stderr,"Error open env\n",db_strerror(ret));
return 0;
ret=db_create(&dbp,envp,0);
if(ret!=0)
{ envp->err(envp,ret,"Database creation failed");
return 0;
db_flags=DB_CREATE;
ret=dbp->open(dbp,NULL,file_name,NULL,DB_BTREE,db_flags,0);
if(ret!=0) {
fprintf(stderr,"Error open database\n",db_strerror(ret));
dbp->close(dbp,0);
envp->close(envp,0);
return 0;
memset(&key,0,sizeof(DBT));
memset(&data,0,sizeof(DBT));
key.data=&k;
key.size=sizeof(int);
data.data=&d;
data.size=sizeof(int);
txn=NULL;
ret=envp->txn_begin(envp,NULL,&txn,0);
if(ret!=0)
{ envp->err(envp,ret,"Transaction begin failed");
dbp->close(dbp,0);
envp->close(envp,0);
return 0;
ret=0;
ret=dbp->put(dbp,txn,&key,&data,0);
if(ret!=0)
{ envp->err(envp,ret,"insert failed");
fprintf(stderr,"%s\n",db_strerror(ret));
txn->abort(txn);
dbp->close(dbp,0);
envp->close(envp,0);
return 0;
ret=txn->commit(txn,0);
if(ret!=0)
{ envp->err(envp,ret,"Transaction commit failed");
dbp->close(dbp,0);
envp->close(envp,0);
return 0;
DBC *cursorp;
dbp->cursor(dbp,NULL,&cursorp,0);
int *q;
while(cursorp->c_get(cursorp,&key,&data,DB_NEXT)==0)
{ q=key.data;
printf("%d",*q);
printf("/");
q=data.data;
printf("%d",*q);
printf("\n");
printf("dfdf");
//ret=txn->commit(txn,0);
if(ret!=0)
{envp->err(envp,ret,"Transaction commit failed");
dbp->close(dbp,0);
envp->close(envp,0);
return 0;
cursorp->c_close(cursorp);
dbp->close(dbp,0);
envp->close(envp,0);
return 0;
}

Hi Zhenhua,
The error message being reported is "Transaction specified for a non-transactional database", meaning that the database was not transaction-enabled.
To resolve this you'll have to either use the DB_AUTO_COMMIT flag when opening the database (therefore, an implicit txn) or use an explicit txn (transaction) which will encapsulate the DB->open() call (usually DB_AUTO_COMMIT is preferred for simplicity).
Note that turning on transactions for the environment where the database reside doesn't imply that the database is transaction-enabled.
Regards,
Andrei

Similar Messages

  • HELP about analog output video

    Hello, I´m need help about analog output video in Premiere CS5 using Matrox RTX2. I need to crop a video with resolution in 1440x1080 to 4:3 in output analog. But what happens is wrong (I think). My video is in format anamorphic and the other option is 16:9 letterbox. Is there any way to crop the video without using effects. Thanks a Lot and sorry my bad english (my native language is Portuguese).

    There are no 4:3 HD specifications.  You'll have to put the video into a normal SD sequence, and scale it down till the top and bottom of the video meet the frame.  That way the sides will be cut off.

  • Help about Warning Security IE 8.0

    Hello Guys,
    I need help about warning security IE 8.0.
    When I try install a software from my webserver is display the following message:
    I can't check the publisher.Are you sure install the software?
    This file does not have a valide digital signature that verifies its publisher.
    You should only install software from publishers you trust.
    Well, I already enable:
    Download signed ActiveX controls
    Download unsigned ActiveX controls
    Allow active content from CDs to run on user machines Enabled 
    Allow software to run or install even if the signature is invalid Enabled 
    Check for server certificate revocation Disabled 
    Check for signatures on downloaded programs Disabled 
    Is there somewhere I disable all settings warning's about IE or one specific GPO I need disable for this warning don't display for me?
    In the same installation a lot of about file .cab are installed, only one specifc I don't have sucess.
    I try some troubleshootings too:
    https://social.technet.microsoft.com/Forums/windows/en-US/8f8293c4-0920-462f-9c69-0a8e3f92aa02/unknown-publishers-warning
    https://www.youtube.com/watch?v=UknQn6tZZis
    http://windows-3322.blogspot.com.br/2011/02/how-to-repair-activex-error.html
    Thanks a lot who answer me or about any idea about my issue.

    This file does not have a valide digital signature that verifies its publisher.
    Did you see your result
    https://social.technet.microsoft.com/Forums/windows/en-US/8f8293c4-0920-462f-9c69-0a8e3f92aa02/unknown-publishers-warning
    <quote>
    Changing the time zone actually worked.
    </quote>
    Robert Aldwinckle

  • I installed teh update a few days ago but when I open Firefox it says :"You're not on the lastest version . . ", but at "Help" & "About Firefox" it shows 9.0.1 "latest release". There's a glitch somewhere.

    This is the message when I Open Firefox:
    "You're not on the latest version of Firefox. Upgrade today to get the best of the Web!"
    At <Help> & <About Firefox>, it shows
    Firefox
    9.0.1
    "Firefox is up to date"
    "You are currently on the release update Channel"
    One of those messages must be wrong. Either way Firefox seems to work fine otherwise. Thanks and regards, Peter Spielman

    Is your homepage set to www.google.com/firefox? If so, that page is wrong. You should change your home page to about:home or some other site instead. The google.com/firefox page is no longer supported.

  • I have three user accounts on one computer. On only one account when I when I check Help - About fire fox only one user account says apply update and won't apply. The other two work fine.

    One of three user accounts on the same computer appears to not be updating to 8.0.1 correctly. One admin and one none admin user account says it is up-to-date. The other non-admin user account, under Help About Firefox says apply update, but won't.

    As long as you installed MS Office into its default location (the top level /Applications folder) it will be available to all user accounts on the Mac.
    As far as licensing is concerned you only have to enter the license code once, which you should do right after installing MS Office, in the same admin account you installed it from, by opening any one of the MS Office applications.  There is no additional licensing required for additional user accounts on the same Mac.
    Each user account is able to run the Office apps.  The only thing you will have to do is go through an initial setup screen in each user account (but this setup does NOT involve entering any additional license codes).
    You may have problems if you installed MS Office in a particular user account (i.e. NOT in the top level /Applications folder).

  • Not able to view Forms Server version in Help: About Oracle Applications after the forms upgrade 10.1.2.3.0

    Hi all,
    DB:11.2.0.3.0
    EBS:12.1.3
    O/S: Sun Solaris SPARC 64 bits
    I am not able to view Forms Server version in Help: About Oracle Applications after the forms upgrade 10.1.2.3.0 after the forms upgrade 10.1.2.3.0 as per note:Upgrading OracleAS 10g Forms and Reports to 10.1.2.3 (437878.1)
    Java/jre upgraded to 1.7.0.45 and JAR files regenerated(without force option). Able to opne forms without any issues.
    A)
    $ORACLE_HOME/bin/frmcmp help=y
    FRM-91500: Unable to start/complete the build.
    B)
    $ORACLE_HOME/bin/rwrun ?|grep Release
    Report Builder: Release 10.1.2.3.0 - Production on Thu Nov
    28 14:20:45 2013
    Is this an issue? Could anyone please share the fix if faced the similar issue earlier.
    Thank You for your time
    Regards,

    Hi Hussein,
    You mean reboot the solaris server and then start database and applications services. We have two databases running on this solaris server.
    DBWR Trace file shows:
    Read of datafile '+ASMDG002/test1/datafile/system.823.828585081' (fno 1) header failed with ORA-01206
    Rereading datafile 1 header failed with ORA-01206
    V10 STYLE FILE HEADER:
            Compatibility Vsn = 186646528=0xb200000
            Db ID=0=0x0, Db Name='TEST1'
            Activation ID=0=0x0
            Control Seq=31739=0x7bfb, File size=230400=0x38400
            File Number=1, Blksiz=8192, File Type=3 DATA
    Tablespace #0 - SYSTEM  rel_fn:1
    Creation   at   scn: 0x0000.00000004 04/27/2000 23:14:44
    Backup taken at scn: 0x0001.db8e5a1a 04/17/2010 04:16:14 thread:1
    reset logs count:0x316351ab scn: 0x0938.0b32c3b1
    prev reset logs count:0x31279a4c scn: 0x0938.08469022
    recovered at 11/28/2013 19:43:22
    status:0x2004 root dba:0x00c38235 chkpt cnt: 364108 ctl cnt:364107
    begin-hot-backup file size: 230400
    Checkpointed at scn:  0x0938.0cb9fe5a 11/28/2013 15:04:52
    thread:1 rba:(0x132.49a43.10)
    enabled  threads:  01000000 00000000 00000000 00000000 00000000 00000000
    Hot Backup end marker scn: 0x0000.00000000
    aux_file is NOT DEFINED
    Plugged readony: NO
    Plugin scnscn: 0x0000.00000000
    Plugin resetlogs scn/timescn: 0x0000.00000000 01/01/1988
    00:00:00
    Foreign creation scn/timescn: 0x0000.00000000 01/01/1988
    00:00:00
    Foreign checkpoint scn/timescn: 0x0000.00000000 01/01/1988
    00:00:00
    Online move state: 0
    DDE rules only execution for: ORA 1110
    ----- START Event Driven Actions Dump ----
    ---- END Event Driven Actions Dump ----
    ----- START DDE Actions Dump -----
    Executing SYNC actions
    ----- START DDE Action: 'DB_STRUCTURE_INTEGRITY_CHECK' (Async) -----
    Successfully dispatched
    ----- END DDE Action: 'DB_STRUCTURE_INTEGRITY_CHECK'
    (SUCCESS, 0 csec) -----
    Executing ASYNC actions
    ----- END DDE Actions Dump (total 0 csec) -----
    ORA-01186: file 1 failed verification tests
    ORA-01122: database file 1 failed verification check
    ORA-01110: data file 1:
    '+ASMDG002/test1/datafile/system.823.828585081'
    ORA-01206: file is not part of this database - wrong
    database id
    Thanks,

  • How to Disable Check for updates button in Help/About in firefox 5.0

    Hi the user should not manually check for updates so we want to disable the Check for updates button also in Help/About.
    Thanks in advanced

    You can hide that button with code in userChrome.css below the @namespace line.
    * http://kb.mozillazine.org/userChrome.css
    * http://kb.mozillazine.org/Editing_configuration
    You can use the ChromEdit Plus or Stylish extension to have easier access to the customization files.
    * ChromEdit Plus: http://webdesigns.ms11.net/chromeditp.html
    <pre><nowiki>@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */
    #aboutDialog #updateBox { display:none!important; }</nowiki></pre>
    You can also choose to lock the related update pref(s) to false if you want to make sure.
    See:
    * http://kb.mozillazine.org/Locking_preferences
    * http://kb.mozillazine.org/about:config

  • Help about W2K Apache plug-in for WLS

    Hi,everybody.
    I want to use the W2K apache http server for redirect the dynamic request to
    WLS. But i don't have the corresponding plug-in. Who can help me? or Who can
    give me some hint about this?
    Thanks in advance.
    BR
    Steven Zhao

    Hi Steven,
    as far as I know there is no Apache Plugin for Windows Platform. Your
    choice is either Unix->Apache or Windows->IIS. I think there is a
    Netscape Plugin as well, but I don't know for which platforms.
    Daniel
    -----Original Message-----
    From: Steven Zhao [mailto:[email protected]]
    Posted At: Friday, October 20, 2000 6:02 AM
    Posted To: management
    Conversation: Help about W2K Apache plug-in for WLS
    Subject: Help about W2K Apache plug-in for WLS
    Hi,everybody.
    I want to use the W2K apache http server for redirect the dynamic
    request to
    WLS. But i don't have the corresponding plug-in. Who can help me? or Who
    can
    give me some hint about this?
    Thanks in advance.
    BR
    Steven Zhao

  • Need help about Hidden Markov Model model

    I want to make classification for EEG signal using Hidden Markov Model
    algorithm based on neural network.
    plz need help about how to implement this algorithm using LABVIEW.
    if not I want another thing to make classification.
    any one know information about this topic, send me a reply
    thanks

    Have you derrived the HMM that you want to implement?
    If so, post the algorithm and we can provide comments on how to implement it using LabVIEW.
    Message Edited by Ray.R on 04-12-2010 12:54 PM

  • Help about location based classes

    Helo. i need some help about location classes(i use J2ME). i want to develop a gps compass application. when i connected to gps, orientation is shown on a compass.(for example if i go to northeast direction, compass indicator shows the direction between nort and east).
    I made connecting GPS. Now i must draw a compass and show the direction informations on it. For doing this, which location classes i can use?
    (i do search about this,but i didn't decide which class i should use. I thought that i can use Orientation class for this. I found a source code and tried it. According to this snippet source code about orientation class, my phone doesn't support Orientation class.But i found an application about gps compass, it works on phone. )

    i write this question CLDC{MIDP part.
    Thanks...                                                                                                                                                                                                               

  • How do i see what beta ver i'm at - deeper than Help | About Firefox - registry .. ?

    i am enrolled in the beta channel but because the notification popups are so quick i someties do not see that a new beta ver is available. i consult filehippo regularly to see what updates are out there but i want to have a way i can find what beta i'm at - Help|About Firefox doesn't get it - how can i find that? looked in registry but haven't found what i want
    any idees?
    ciao
    saw

    I'm not trying to discredit your work. But I did actually read the workaround and it is valid. That is true. But still that's not an answer to my question nor an explanation for that design choice. It's a workaround for a software not displaying the exact version.
    So why not jump in this thread if it exists? Why create a new thread with the same question? Also to apply your logic, why didn't anybody tell the user to use the stable version if he's incapable of figuring out the obvious?

  • Which file in Omni.ja contains the version number in HELP | ABOUT

    We are using Firefox in a corporate locked down environment.
    we have made a number of changes to files in the OMNI.JA file to configure Firefox accordingly.
    We now have a newer version of firefox to install/package however, when we replace the default omni.ja file in FF 10.0.10 and go into HELP | ABOUT it shows the version number of FF that the omni.ja file came from, ie 10.0.4.
    Which file(s) need to be replaced in omni.ja so that when we select HELP | ABOUT it shows the correct version of 10.0.10 ?
    regards
    Bill

    hello biffal, which changes to the omnia.ja file have you done originally? maybe there's a better way to do it, because this file will be overwritten by each & every firefox update...

  • 9.5.3 Help / About reports version as 9.0.0

    After downloading AcrobatUpd953_all_incr.msp, installing it to patch Acrobat from 9.5.2 to 9.5.3, and rebooting, when I select Help / About in Acrobat, the dialog shows the version of Acrobat as 9.0.0. When I open Control Panel / Programs and Features, it shows the version of Acrobat as 9.5.3, when I look at the properties of acrobat.exe the file version is 9.5.3.305, and in Acrobat if I open Help / About Adobe Plugins, all the plugin versions are shown as 9.5.3.305. So it looks as though it's just the About dialog that is screwed.
    I checked with a friend who also has Acrobat 9, and he sees exactly the same bug. OS on both machines is Windows 7 x64.

    I tried this on my Win7 64 bit machine and its working fine.Please try repairing your Acrobat from control panel and see if it works.

  • Change info displayed on splash screen Help-- About

    When I open NI Multisim and click on Help-->About, the splash screen displays the following information in the upper left hand corner of the splash screen:
    test
    Benjamin Franklin Institute
    Serial#
    How/where do I change the word "test" so that it doesn't appear on all the classroom PCs?  Where is the source of the identifying information that appers on the splash screen?
    Thanks.

    Hello,
    In this case “test” is making reference to the Register Owner. This information is requested during the installation process. You will be able to modify this information by modifying a key in the Windows Registry.  Please refer to the link below for more information.
    http://digital.ni.com/public.nsf/allkb/0385A6FBAADE844286256DDB0066FCE8?OpenDocument
    Regards,
    MCOTO

  • Why no indication of 5.0.1 on Help About Firefox?

    I had 5.0 installed a check of Help About Firefox showed it as up to date. Checking FileHippo.com showed 5.0.1, How come no indication of this in Help About Firefox?
    Thanks

    It is because Firefox 5.0 is still the current update for Windows and Linux users as the 5.0.1 was really only for to have a couple work around's for Mac OSX users as in a font issue for OSX 10.7 that may crash Firefox and a Java plugin loading issue on OSX 10.5. ([https://support.mozilla.com/en-US/forums/contributors/707078 They say OSX 10.6 but really meant OSX 10.5])
    FileHippo was not aware it was only really for MAC OSX.
    http://christian.legnitto.com/blog/2011/07/12/why-are-there-no-firefox-5-0-1-and-3-6-19-automatic-updates-for-windows-and-linux/

Maybe you are looking for

  • Print problem with Acrobat XI

    Hi, After implementation of Acrobat XI my company is experiencing problems with pdf files failing to print on some printers. The problem occurs for these specific printer types (reported so far): OCE 6522C, OCE CS 250, Canon iR-ADV C5045/5051. The co

  • Got my ipad2 stolen/lost...

    I had recently got my ipad2 stolen/lost, and people have been telling me to find it on icloud, but my ipad was not updated, so i don't have a clue on what i should do.

  • Can't empty trash on a few files. Permissions?

    Good Day. I am logged in as Admin (Only acct on this machine) and there are several files in the trash that will not allow me to empty. None of which are in use. Tells me I don't have the permission to empty/delete which I do. Can someone please advi

  • What is a lock in a synchronized method ??

    Greetings, I have a synchronized reset method whose job is to reset every variable i am using in that class.. its a synchronized method so when i am doing the reset stuff, no other method in that class can update that variable. But someone told me i

  • OS command from PL/SQL code

    Is there any way of running on OS (Operating System) command from SQL or PL/SQL. i.e. calling an executable from a trigger.