Is possible to flush data from RAM to disk automatically ?

hello all,
My question is regarding to flushing of Data from RAM to DISK .
question is whether any flag set is available at Berekeley DB to flush the Data from RAM to DISK automatically( on any criteria whenever the pages in cache become full or some thing else).
Context is based on CDS with memory pool not Transactional.
thanks
Rath.

hello Debsubhra Roy,
Thanks Debsubhra, thanks for your valuble comments.
Actually My objective is to periodically flush the in memory Data to physical database at Filesystem to minimize the write cycle of Flash.
based on your opinion, i have created a in memory Database in cache,and It is working fine with in cache memory, but problem is ,it is not flushing (exactly not creating) to a Physical file of "Database name" at the filesystem.
1.i checked with with below api 's for flushing,but not worked.
myEnvironment->memp_trickle(100,0);
                    myEnvironment->memp_sync(lsn);
                    mydbpDbHandle->sync(0);
2.Secondly my assumption is that ,whenever the Cache memory will fill,then it will flush the Data in to physical Database "TestDb" named at the Db->open () api.
it is also not working, it is showing exception of "cannot allocate space from Buffer cache " exception.
For better understanding i am pasting my sample code, please see that and give me a solution to reach my objective.
#include <iostream>
#include <db_cxx.h>
using namespace std;
typedef unsigned char byte;
struct DBKey
     int iSerNum;
struct DBValue
     int RolNo;
     int Marks;
DbLsn *lsn;
int icount=0;
class DBEnvironment{
protected:
     DbEnv* myEnvironment;
     int percent;
     int *nwrotep;
public:
     DBEnvironment(){}
     ~DBEnvironment(){}
     int ienvCreation()
          myEnvironment = new DbEnv(0);
          myEnvironment->set_flags(DB_DIRECT_DB,0);               
          myEnvironment->set_cachesize(0, 100*100, 1);     
          myEnvironment->set_shm_key(100);
          myEnvironment->open("/root/Desktop/TestD", DB_CREATE|DB_INIT_MPOOL|DB_THREAD|DB_INIT_CDB| DB_SYSTEM_MEM,0644);
int ienvClose()
          myEnvironment->close(0);
          delete myEnvironment;
          myEnvironment = NULL;
class Database :public DBEnvironment
private:
     Db* mydbpDbHandle;
     DbMpoolFile* myDbMpooFile;
public:
     Database(){}
     ~Database(){}
     int openDB()
          byte breturn=false;
          if(mydbpDbHandle == NULL )
               mydbpDbHandle = new Db(myEnvironment, 0);
               if(mydbpDbHandle->open(NULL,NULL,"TestDb", DB_BTREE, DB_CREATE|DB_THREAD,0644) ==0)
                    breturn = true;
     int closeDB()
          byte breturn = false;
          if(mydbpDbHandle != NULL)
               mydbpDbHandle->close(DB_NOSYNC);//     0     
               delete mydbpDbHandle;
               mydbpDbHandle = NULL;
               breturn = true;
int insertDB(const byte* cpkey, void* vpvalue)
          Dbt dbtkey;
          Dbt dbtvalue;
          Dbc* dbcp = NULL;
          DBKey mytkey;
          DBValue mytdata;
          byte breturn = false;
          icount++;
          int k;
          try
               if (mydbpDbHandle == NULL)
                    return(breturn);
               memset(&dbtkey, 0, sizeof(dbtkey));
               memset(&dbtvalue, 0, sizeof(dbtvalue));
               dbtkey.set_data((void*)cpkey);
               dbtkey.set_size(sizeof(mytkey));
               dbtvalue.set_data(vpvalue);
               dbtvalue.set_size(sizeof(mytdata));
               mydbpDbHandle->cursor(NULL, &dbcp, DB_WRITECURSOR);
               dbcp->put(&dbtkey, &dbtvalue,DB_KEYLAST);
               cerr<<"\n "<<icount<<"inserted";
     //flushing the Data ,whenever the icount reaches multiples of 10     
               k=(icount%10);
               if(k==0)
                    //myEnvironment->memp_trickle(100,0);
                    myEnvironment->memp_sync(lsn);
                    mydbpDbHandle->sync(0);
                    cerr<<"\n sync called to flush.";
               breturn = true;
          catch(DbException ex)
               cerr<<ex.what();
          if(dbcp!=NULL)
               dbcp->close();
               dbcp = NULL;
     return(breturn);
     int iserachRecord(const byte* cpkey, void* vpvalue)
          Dbt dbtkey;
          Dbt dbtvalue;
          Dbc* dbcp = NULL;
          DBKey mytkey;
          byte breturn = false;
          try
               if (mydbpDbHandle == NULL)
                    return(breturn);
               memset(&dbtkey, 0, sizeof(dbtkey));
               memset(&dbtvalue, 0, sizeof(dbtvalue));
               dbtkey.set_data((void*)cpkey);
               dbtkey.set_size(sizeof(mytkey));
               mydbpDbHandle->cursor(NULL, &dbcp, DB_READ_COMMITTED);
               if(dbcp->get(&dbtkey, &dbtvalue, DB_SET)!=DB_NOTFOUND)
                    cerr<<"\nRecord Found...";
                    memcpy(vpvalue,(byte *)dbtvalue.get_data(), dbtvalue.get_size());
                    breturn = true;
          catch(DbException ex)
               cerr<<ex.what();
          if(dbcp!=NULL)
               dbcp->close();
               dbcp = NULL;
          return(breturn);
int main()
     Database* Dbp=new Database();
     Dbp->ienvCreation();
     Dbp->openDB();
     DBKey Key,Key1,SearchKey;
     DBValue Value,Value1,RetrieveValue;
     for(int i=1;i<100;i++)
          Key.iSerNum=i;
          Value.RolNo=i+1;
          Value.Marks=i+2;
          Dbp->insertDB((byte*)&Key,(void*)&Value);
     cerr<<"\n------------Search Results-----------";
     SearchKey.iSerNum=10;
     Dbp->iserachRecord((byte*)&SearchKey,&RetrieveValue);
     cerr<<"\nkey is:- "<<SearchKey.iSerNum<<"\nvalue -RolNo:- "<<RetrieveValue.RolNo<<"\nMark:- "<<RetrieveValue.Marks;
//     Dbp->closeDB();
//     Dbp->ienvClose();
}

Similar Messages

  • Is that possible to transfer data from old apple id to new apple id becoz my old apple id is not working

    Is that possible to transfer data from old apple id to new apple id becoz my old apple id is not working.

    Merging of Apple ID accounts is not possible.

  • Possible to read data from a web browser into java?

    Is it possible to read data from a web browser such as IE or Mozilla into a java applet for use and manipulation? If it is, could someone please post some documentation I could look at or a snip-it of code I could use? Thanks.

    This will read the content from a site:
    import java.net.*;
    import java.io.*;
    class Test {
         public static void main(String[] argv) throws Exception {
              URL u = new URL("http://www.google.com");
              URLConnection uc = u.openConnection();
              BufferedReader br = new BufferedReader(new InputStreamReader(uc.getInputStream()));
              String text;
              while( (text = br.readLine()) != null ) {
                   System.out.println(text);
    }

  • IS possible to extract data from email body using ssis?

    IS possible to extract data from email body using ssis?
    the email come with a display table
    CRISTINA&amp MICROSOFT Forum

    Hi perezco,
    As Piotr said, this can be done through .NET programming in a Script Task or a Script Component. For the code snippet, please refer to the following thread:
    http://forums.asp.net/t/1629654.aspx 
    In addition, there are also third party SSIS components that provide such a functionality such as:
    http://www.cozyroc.com/ssis/receive-mail-task 
    Regards,
    Mike Yin
    If you have any feedback on our support, please click
    here
    Mike Yin
    TechNet Community Support

  • Is it possible to get data from a smashed/broken iPod touch 4th gen?

    Is it possible to get data from a smashed/broken iPod touch 4th gen?

    - If when you connect the iPod to your computer it appears in iTunes then you can make a backup and then restore another iPod or other iOS device from that backup.
    - Otherwise you will have to go to a data recovery company.
    - When I go to the YouTube link I can't get the video to play.

  • Is it possible to show data from two different sql tables?

    Is it possible to show data from two different sql tables? Either to show combined data by using a join on a foreign key or showing a typical master detail view?
    I have one table With data about a house, and another table With URL's to images in the blob. Could these two be combined in the same Gallery?
    Best regards Terje F - Norway

    Hi Terje,
    If you have a unique key, you could use one of the following functions for your scenarios:
    If you only have one image per house, you can use LookUp:
    http://siena.blob.core.windows.net/beta/ProjectSienaBetaFunctionReference.html#_Toc373745501
    If you have multiple images per house, you can use Filter:
    http://siena.blob.core.windows.net/beta/ProjectSienaBetaFunctionReference.html#_Toc373745487
    Thanks
    Robin

  • Possible to extract data from DB

    Hello All,
    Can any one let me know is it possible to extract data from DB ? for the initial we need to extract all the records and we need to extract from 5 tables and perform match and merge and create a unique records..Is it possible?
    Once done then for delta we need to make sure all the 5 tables are updated then only BODS need to extract and update the deltas...
    Thanks
    Rajeev

    Hi Terry,
    Yes ,u can use DB connect to retrive the data from SQL data base...
    Also, If you want DB -connect with MS-SQL, In the source MS-SQL all the tables which provide data for SAP have to be owned by SAP-User (which you created to connect data base).
    Follow the same procedure u have done for Oracle DB connect..
    Cehck this look for more info..
    http://help.sap.com/saphelp_nw04/helpdata/en/58/54f9c1562d104c9465dabd816f3f24/frameset.htm
    Hope this helps u..
    Best Regards,
    VVenkat..
    Edited by: Venkata Narayana Jakkampudi on Jan 13, 2009 6:07 PM
    Edited by: Venkata Narayana Jakkampudi on Jan 13, 2009 6:08 PM

  • BPC 7.5 : Is it possible to load data from ECC to BPC

    Hi,
    Is it possible to load data from ECC to BPC in BPC 7.5 Netweaver version.
    Thanks
    Prasad Bobburu

    Option 1 -
    ECC -> BW -> BPC NW (Standard, or recommended for NW)
    Option 2
    ECC -> BW -> Openhub / Flat file -> BPC MS
    This is more common for SAP customers, who are using BW, but running MS version
    Option 3
    ECC -> ABAP Extractor Program (generated flat file) -> BPC
    Again a more common for SAP customers using BPC MS
    -Kiran Malineni

  • Is it possible to load data from attribute of I.O. to text of the same I.O.

    Hi guys,
    is it possible to load data from attribute of InfoObject to text of the same InfoObject.
    I have this requierement: the text (description long) of InfoObject should be filled defends on the content of one attribute of this InfoObject.
    Is it possible via Update Rule? (we are using BW3.5)
    And how?
    Thanks in adance!
    Regards

    HI,
    1st) activate your object as data target and do the assignment in the transfer or update rules.
    --- How can I active my InfoObject (Text if the InofoObject)as data target?
    Right Click your info area and choose " Insert characteristics as a Datatarget" and give your info object Id.
    2) create a generic datasource on the p-table of your object and assign that datasource as text datasource to your object.
    --- How can I create a generic datasource on the p-table of your object ?
    For Eg: your info object name is like this
    ZIO_CID
    For this P table will be like this
    /BIC/PZIO_CID
    In RSO2 tcode Generic datasources create datasource based on this table .
    Hope it helps
    Regards,
    Arun.M.D

  • Is it possible to retrieve data from an Oracle db with an LDAP query?

    Our application uses an LDAP query to retrieve data from Microsoft Active Directory. Is it also possible to retrieve data from an Oracle database with an LDAP query?

    if you have Oracle Internet Directory, you will retrieve with ldapsearch data, which are physically stored in the database. But to select * from emp where ename='SCOTT', it is probably not possible.
    At least I have never heard of such a product which translate ldap query in sql query. But feel free to write your own one in perl :-)

  • Will be possible to extract data from work flow?

    hi
    i need to add approver in FIAP report. the filed is available not any table like, its getting from abap work flow? please let me know  normally will be possible to extract data from work flow?

    Hi,
    There is no direct method i am aware of, but you can definitely create custom extractors on base tables.
    -Vikram

  • Is that possible to get data from the red trace in this BMP file

    I have an instrument, which only export image file. I want use labview to replot it and do some analysis. The image file is like attachment. Is that possible to get data from the red  trace in this BMP file via labview vis?
    Attachments:
    coax312.bmp ‏4741 KB

    I looks to me that 515 pixels represents 200 meters, so multiply the
    x-values by 0.3885 meters/pixel to get the true x-values.  I don't
    have enough information to scale the y-axis.
    Randall Pursley
    Attachments:
    Compute from BMP.vi ‏66 KB

  • Transferred backed-up data from external hard disk to new hard drive on my MacBook Pro which seemed to be successful. I now find that some (or maybe all) old emails have been resent. Can anyone tell me what has happened?

    Transferred backed-up data from external hard disk to new hard drive on my MacBook Pro which seemed to be successful. I now find that some (or maybe all) old emails have been resent. Can anyone tell me what has happened?

    Greetings,
    I've never seen this issue, and I handle many iPads, of all versions. WiFi issues are generally local to the WiFi router - they are not all of the same quality, range, immunity to interference, etc. You have distance, building construction, and the biggie - interference.
    At home, I use Apple routers, and have no issues with any of my WiFi enabled devices, computers, mobile devices, etc - even the lowly PeeCees. I have locations where I have Juniper Networks, as well as Aruba, and a few Netgears - all of them work as they should.
    The cheaper routers, Linksys, D-Link, Seimens home units, and many other no name devices have caused issues of various kinds, and even connectivity.
    I have no idea what Starbucks uses, but I always have a good connection, and I go there nearly every morning and get some work done, as well as play.
    You could try changing channels, 2.4 to 5 Gigs, changing locations of the router. I have had to do all of these at one time or another over the many years that I have been a Network Engineer.
    Good Luck - Cheers,
    M.

  • Is it possible to transfer data from a dead macbook pro to a new user account on another macbook pro?

    I have killed my 2 months old mbp (water). I have an older mbp (2 years old) that I wish to transfer all data from my dead mbp to. I was hoping that I simply could create a new user on my old mbp and transfer all data to this account using the migration assistant and thereby re-create my dead mbp. Especially I wish to acces my contacts, mail settings and calendar, but would of course prefer to acces all files. I have a thing (do not know the right term) that can read the HD on the dead computer. It is now connected to my mbp, and I can acces data, but the migration assistant do not recognize it. Can someone please help me?
    Thanks...

    It's possible that the water caused your hard drive directory to be corrupted when the logic board shorted out. You may want to try repairing the now-external drive with Disk Utility's Repair Disk routine. If it reports making any repairs, run it repeatedly until it reports that the disk "appears OK". Then try Migration Assistant again.
    If that fails, then perhaps the disk itself was damaged by the spill. You could go one step farther and try using data recovery software on the drive:
    http://www.prosofteng.com/products/data_rescue.php
    http://subrosasoft.com/OSXSoftware/index.php?main_page=product_info&products_id= 1
    http://download.cnet.com/VirtualLab-Data-Recovery/3000-2094_4-10298807.html
    All three recovery utilities come in demo versions that will show you what the full version could recover before you have to pay for anything.
    Good luck.

  • Is it possible to migrate data from a 4.6C system to an ECC 6.0 system?

    Hello all,
    We have an ECC6.0/Oracle 11g system which runs Finance, Purchasing and Payroll/HR for our own organisation.
    We also have another 4.6C/Oracle9 system where we run only Payroll for another organisation.
    This is a separate landscape (Dev / Test / Prod / DR) which runs on its own hardware.
    Clearly, this 4.6C system has to be upgraded in the next 12 months or so before it is out of maintenance.
    However, we are exploring whether it would be possible to migrate the data from the 4.6C system to our existing ECC6.0 system instead of upgrading the 4.6C system.
    In this way, we can decommission the 4.6C hardware and simplify our landscape.
    Has anyone undertaken a similar exercise who would be willing to share their experiences?
    Or does anyone have any opinions as to whether this would even be possible?
    Our initial thinking is that we would probably have to write our own conversion programs and/or possibly use LSMW but it's early days so any feedback is welcome.
    Regards...John

    Hi,
    However, we are exploring whether it would be possible to migrate the data from the 4.6C system to our existing ECC6.0 system instead of upgrading the 4.6C system.
    You can make of ALE/IDOCs technology to transfer the required data from 4.6C system to ECC 6.0 system. Here you will need to perform necessary mapping of the fields and perform required technical configuration. Later write ABAP codes to fetch and transfer data .
    Hope this answers your query.
    Regards,
    Deepak Kori

Maybe you are looking for