Berkeley DB  about hash Access Methods

When I use Berkeley DB with hash Access Methods, and the recored is very large, I want to know:
for examle when i insert two recored
(key1, data1) and (key2, data2) into DB, the hash of key1 and hash of key2 is same, but key1 and key2 is different, how the Berkeley DB to do this?
is the Berkeley DB cover the key1,data1 with key2,date2 ?, if so, i think it is a terrible things.
thanks for any reply, waiting......

You are very welcome, thanks again,
but now i find the Berkeley DB working are very slowly when the Database size grow up to more than 2GB, below is the list of my computer information:
OS: windows server 2003
API: C language
memory: 1GB
CPU: intel 820
database Access Methods: hash
key and dada: key is always char[32], data is always int32
when I open the database in the env, I didn't set the catch and page size because I don't know how to set it, and i also find there is anthor method to improve the performance by set the "Page fill factor", and "DB->set_h_ffactor", but can you give me some advice how can set it to make DB more fast,
by the way I find when the Berkeley DB's database size is larger than memory, it works very slowly, why?

Similar Messages

  • Related to insertion into HASH access method

    Hi,
    I have four multi-threaded processes (2 writer and 2 reader processes), which make use of Berkeley DB transactional data store. I have multiple environments and the associated database and log files are located in separate directories.
    Database access method used is DB_HASH.
    When I looked into stack trace of the Writer process, following is observed:
    A] Indicates insertion into HASH database
    ffffffff7b9a84f4 _pwrite (65, fffffffea28bc6e0, 2000, 3e18000, 7358, 7357) + c
    ffffffff7c667bec __os_io (104c58c80, 3e18000, 104c9f140, 1f0c, 2000, 0) + 29c
    ffffffff7c650fb0 __memp_pgwrite (104c58c80, 104c9c250, fffffffea00e4d98, fffffffea28bc698, 0, 2000) + 200
    ffffffff7c650aa4 __memp_bhwrite (104c58c80, 104c9c250, fffffffea03829e8, fffffffea28bc698, 0, 100c559c0) + 454
    ffffffff7c64fa84 __memp_alloc (fffffffea00e4dc4, fffffffea00e4d98, 1852e6, 0, 104c58c80, fffffffea0000138) + 72c
    ffffffff7c65360c __memp_fget (104ca1a50, 104ca4b54, 0, fffffffea0384c18, 0, fffffffea0000138) + 1bdc
    ffffffff7c5909ac __ham_get_cpage (104ca4920, 0, 104ca4b60, 104ca1a50, 104ca4b40, 104ca14d0) + 1c4
    ffffffff7c57d334 __ham_lookup (104ca4920, fffffffe3e3fb140, 1bb5, 2, fffffffe3e3fa4dc, 104ca4b40) + 74
    ffffffff7c57badc __hamc_put (104ca4920, fffffffe3e3fb140, fffffffe3e3fb118, 34, fffffffe3e3fa4dc, 104ca4b40) + ec
    ffffffff7c603230 __dbc_put (104ca4920, 28, e, 104ca4920, 104ca4920, ffffffff7c794508) + db0
    ffffffff7c5f538c __db_put (104ca14d0, 19f388, 104ca15d8, fffffffe3e3fb140, fffffffe3e3fb118, 0) + 21c
    ffffffff7c60e00c __db_put_pp (104c58c80, 0, fffffffe3e3fb140, fffffffe3e3fb118, 0, 104ca14d0) + 244
    00000001001079f0 __1cLBDBDatabaseGinsert6MrknDstdEpair4CpCC2__IkIIII_v_ (104c9c3a0, 0, 4, 7, 74, 4) + 178
    00000001001b83cc __1cIIndexSetKwriteIndex6MrkirnDstdDmap4n0BEpair4CpCC4__CIn0BEless4n0C___n0BJallocator4n0BEpair4Ckn0C_CI___
    ____i_ (1009ecf80, 104ca7398, 1069fbee0, 74, 45f29f466a48b, 10084bcd0) + b8
    00000001000af1e8 __1cLIndexWriterOpProcessObject6MpnDstdDmap4n0BEpair4CpCC2__CIn0BEless4n0C___n0BJallocator4n0BEpair4Ckn0C_C
    I_______v_ (104ca7240, 1069fbee0, fffffff71e49eb29, 92b0e8920, 100572990, 49587449) + 214
    00000001000b156c __1cbJManagerProducerThreadConsumersModel4nDstdDmap4n0AEpair4CpCC1__CIn0AEless4n0B___n0AJallocator4n0AEpair
    4Ckn0B_CI_______OpDoProcessHook6M_v_ (104ca7240, 1069fbee0, 1003d1, 0, 1005729e0, 1003d120c) + 250
    00000001002bc224 __1cKThreadBaseKmDoProcess6M_v_ (104ca7240, 10043d000, 1000b131c, 104ca72a0, 10043dc6d, 10020e90c) + 1ac
    00000001002bbf44 __1cKThreadBaseQmThreadMainChild6Fpv_1_ (104ca7240, 100572000, 10043d, 0, 10043dbcb, 1005729e0) + ec
    ffffffff7eb17c9c lwpstart (0, 0, 0, 0, 0, 0)
    B] Does the below stack trace indicate the insertion into HASH database? I am getting this doubt because the above and below mentioned stack traces
    differ. Can this happen when the access method used is DB_HASH or is it something to do with application flag / config settings? Please suggest.
    ffffffff7b9a71f4 _pread (65, fffffffeae356140, 2000, 129c8000, 81e6, 81e5) + c
    ffffffff7c667acc __os_io (104c58c80, 129c8000, 104c9f140, 94e4, 2000, 0) + 17c
    ffffffff7c650bfc __memp_pgread (104c9c250, fffffffea0079c58, fffffffeae3560f8, 0, 0, 104c58c80) + 90
    ffffffff7c653928 __memp_fget (104c9c250, 0, fffffffeae3560f8, fffffffea03829e8, 1, fffffffea0000138) + 1ef8
    ffffffff7c5619e8 __bam_get_root (104d1cde0, 2, 20002, 1000, fffffffe3e7fa1e4, 0) + d8
    * ffffffff7c5606ec __bam_rsearch (104d1cde0, 104d1d32c, 3242, 1, 104c9c250, 3242) + 44*
    * ffffffff7c560438 __ram_add (104d1cde0, 104d1d32c, fffffffe3e7fb118, 2, 0, 104d1d200) + 44*
    * ffffffff7c55ecb4 __ramc_put (104d1cde0, fffffffe3e7fb140, fffffffe3e7fb118, e, 0, 0) + 64*
    ffffffff7c6032c0 __dbc_put (104c9f200, 28, e, 104c9f200, ffffffff7c55ec50, e) + e40
    ffffffff7c5f538c __db_put (104c9bc60, 19f388, 104c9bd68, fffffffe3e7fb140, fffffffe3e7fb118, 0) + 21c
    ffffffff7c60e00c __db_put_pp (104c58c80, 0, fffffffe3e7fb140, fffffffe3e7fb118, 0, 104c9bc60) + 244
    00000001001079f0 __1cLBDBDatabaseGinsert6MrknDstdEpair4CpCC2__IkIIII_v_ (104c95790, 0, 4, 7, 74, 4) + 178
    00000001001b83cc __1cIIndexSetKwriteIndex6MrkirnDstdDmap4n0BEpair4CpCC4__CIn0BEless4n0C___n0BJallocator4n0BEpair4Ckn0C_CI___
    ____i_ (1009ecf80, 104ca6ee8, 105f8a580, 74, 45f29f466b002, 10084bcd0) + b8
    00000001000af1e8 __1cLIndexWriterOpProcessObject6MpnDstdDmap4n0BEpair4CpCC2__CIn0BEless4n0C___n0BJallocator4n0BEpair4Ckn0C_C
    I_______v_ (104ca6d90, 105f8a580, fffffff71e49eb29, 92b0e8920, 100572990, 49587449) + 214
    00000001000b156c __1cbJManagerProducerThreadConsumersModel4nDstdDmap4n0AEpair4CpCC1__CIn0AEless4n0B___n0AJallocator4n0AEpair
    4Ckn0B_CI_______OpDoProcessHook6M_v_ (104ca6d90, 105f8a580, 1003d1, 0, 1005729e0, 1003d120c) + 250
    00000001002bc224 __1cKThreadBaseKmDoProcess6M_v_ (104ca6d90, 10043d000, 1000b131c, 104ca6df0, 10043dc6d, 10020e90c) + 1ac
    00000001002bbf44 __1cKThreadBaseQmThreadMainChild6Fpv_1_ (104ca6d90, 100572000, 10043d, 0, 10043dbcb, 1005729e0) + ec
    ffffffff7eb17c9c lwpstart (0, 0, 0, 0, 0, 0)
    Details about the application are as follows:
    For Writer / Reader:
    Environment flags : DB_CREATE | DB_INIT_MPOOL | DB_THREAD | DB_INIT_LOCK | DB_INIT_TXN
    Following are the parameters to db->open function call:
    WRITER*
    DB->open(DB *db,
    DB_TXN *txnid, => NULL
    const char *file, => file name
    const char *database, => NULL
    DBTYPE type, => DB_HASH
    u_int32_t flags, => DB_READ_UNCOMMITTED | DB_AUTO_COMMIT | DB_CREATE | DB_THREAD
    int mode => 0);
    Also, DB_DUP flag is set.
    READER_
    DB->open(DB *db,
    DB_TXN *txnid, => NULL
    const char *file, => file name
    const char *database, => NULL
    DBTYPE type, => DB_UNKNOWN
    u_int32_t flags, => DB_READ_UNCOMMITTED | DB_RDONLY | DB_AUTO_COMMIT | DB_THREAD
    int mode => 0);
    DB_CONFIG file contents are as follows:
    set_cachesize 0 536870912 1
    set_lg_bsize 10485760
    set_data_dir DATADIR
    set_lg_dir LOGDIR
    set_lk_max_locks 100000
    set_lk_max_lockers 100000
    set_lk_max_objects 100000
    set_flags DB_REGION_INIT
    set_tx_max 150
    mutex_set_increment 7500
    Thanks,
    Magesh

    Hi Nandish,
    DB statistics were collected using the following command:
    db_stat -d <database name>
    When db_stat and db_verify utilities were run during the application runtime, both of them failed for most of the databases.
    Please find below sample output for db_stat and db_verify utilities for 'SUBID_P1_S1_FF3' DB:
    Sun Jan 4 07:55:28 2009 Local time
    db_stat: page 44972: illegal page type or format
    db_stat: PANIC: Invalid argument
    db_stat: PANIC: fatal region error detected; run recovery
    db_stat: close: DB_RUNRECOVERY: Fatal error, run database recovery
    db_stat: File handles still open at environment close
    db_stat: Open file handle: /opt/vol1/data/SUBID_P1_S1_FF3
    db_stat: PANIC: fatal region error detected; run recovery
    db_stat: dbenv->close: DB_RUNRECOVERY: Fatal error, run database recovery
    db_verify: Page 44972: duplicate page of inappropriate type 13
    db_verify: Page 20769: record count incorrect: actual 285, in record 286
    db_verify: Page 9337: bad record count: has 867 records, claims 868
    db_verify: Page 44497: record count incorrect: actual 88, in record 81
    db_verify: Page 21317: bad record count: has 670 records, claims 663
    db_verify: Page 4524: record count incorrect: actual 273, in record 275
    db_verify: Page 1141: bad record count: has 2601 records, claims 2603
    db_verify: Page 40872: record count incorrect: actual 380, in record 382
    db_verify: Page 20150: bad record count: has 962 records, claims 964
    db_verify: Page 44984: duplicate page of inappropriate type 0
    db_verify: Page 43953: record count incorrect: actual 9, in record 8
    db_verify: Page 9877: bad record count: has 591 records, claims 590
    db_verify: Page 44994: duplicate page of inappropriate type 0
    db_verify: Page 41115: record count incorrect: actual 100, in record 101
    db_verify: Page 9279: bad record count: has 682 records, claims 683
    db_verify: Page 44975: duplicate page of inappropriate type 13
    db_verify: Page 44997: duplicate page of inappropriate type 0
    db_verify: Page 8113: item 0 hashes incorrectly
    db_verify: Page 8113: item 4 hashes incorrectly
    db_verify: Page 8113: item 8 hashes incorrectly
    db_verify: Page 8143: item 40 hashes incorrectly
    db_verify: Page 8143: item 42 hashes incorrectly
    db_verify: Page 8143: item 46 hashes incorrectly
    db_verify: Page 8143: item 60 hashes incorrectly
    db_verify: Page 8143: item 62 hashes incorrectly
    db_verify: Page 39405: hash page has bad prev_pgno
    db_verify: Page 8145: item 4 hashes incorrectly
    db_verify: Page 8145: item 10 hashes incorrectly
    db_verify: Page 8145: item 20 hashes incorrectly
    db_verify: Page 8145: item 22 hashes incorrectly
    db_verify: Page 8145: item 28 hashes incorrectly
    db_verify: Page 8145: item 32 hashes incorrectly
    db_verify: Page 8145: item 38 hashes incorrectly
    db_verify: Page 8145: item 40 hashes incorrectly
    db_verify: Page 8145: item 48 hashes incorrectly
    db_verify: Page 44993: duplicate page of inappropriate type 0
    db_verify: Page 42178: record count incorrect: actual 581, in record 582
    db_verify: Page 40166: btree or recno page is of inappropriate type 13
    db_verify: Page 40166: record count incorrect: actual 0, in record 62
    db_verify: Page 9206: bad record count: has 2909 records, claims 2972
    db_verify: Page 44985: hash page has bad prev_pgno
    db_verify: Page 21250: record count incorrect: actual 494, in record 491
    db_verify: Page 9834: bad record count: has 1076 records, claims 1073
    db_verify: Page 39247: duplicate page of inappropriate type 13
    db_verify: Page 44973: duplicate page of inappropriate type 13
    db_verify: Page 20460: btree or recno page is of inappropriate type 13
    db_verify: Page 20460: record count incorrect: actual 0, in record 9
    db_verify: Page 20390: bad record count: has 4656 records, claims 4665
    db_verify: Page 44696: unterminated leaf chain
    db_verify: Page 43989: record count incorrect: actual 22, in record 21
    db_verify: Page 8917: bad record count: has 604 records, claims 603
    db_verify: Page 44982: hash page has bad prev_pgno
    db_verify: Page 45000: hash page has bad prev_pgno
    db_verify: Page 44981: duplicate page of inappropriate type 13
    db_verify: Page 44990: hash page has bad prev_pgno
    db_verify: Page 38676: record count incorrect: actual 107, in record 106
    db_verify: Page 4486: bad record count: has 689 records, claims 688
    db_verify: Page 39602: record count incorrect: actual 127, in record 129
    db_verify: Page 9202: bad record count: has 709 records, claims 711
    db_verify: Page 21291: record count incorrect: actual 175, in record 176
    db_verify: Page 4585: bad record count: has 757 records, claims 758
    db_verify: Page 44897: record count incorrect: actual 219, in record 95
    db_verify: Page 2259: bad record count: has 3129 records, claims 3005
    db_verify: Page 44987: duplicate page of inappropriate type 0
    db_verify: Page 44979: duplicate page of inappropriate type 13
    db_verify: Page 9055: duplicate page of inappropriate type 13
    db_verify: Page 44980: hash page has bad prev_pgno
    db_verify: Page 44971: duplicate page of inappropriate type 13
    db_verify: Page 39405: hash page referenced twice
    db_verify: Page 44995: duplicate page of inappropriate type 0
    db_verify: Page 38457: hash page has bad prev_pgno
    db_verify: Page 44986: duplicate page of inappropriate type 0
    db_verify: Page 44179: btree or recno page is of inappropriate type 13
    db_verify: Page 44179: record count incorrect: actual 0, in record 582
    db_verify: Page 44999: btree or recno page is of inappropriate type 0
    db_verify: Page 44999: record count incorrect: actual 0, in record 2
    db_verify: Page 4709: bad record count: has 0 records, claims 584
    db_verify: Page 41333: record count incorrect: actual 55, in record 54
    db_verify: Page 9531: bad record count: has 637 records, claims 636
    db_verify: Page 44970: hash page has bad prev_pgno
    db_verify: Page 38400: record count incorrect: actual 132, in record 131
    db_verify: Page 9811: bad record count: has 714 records, claims 713
    db_verify: Page 40735: duplicate page of inappropriate type 13
    db_verify: Page 44996: duplicate page of inappropriate type 0
    db_verify: Page 44998: hash page has bad prev_pgno
    db_verify: Page 44991: hash page has bad prev_pgno
    db_verify: Page 44988: duplicate page of inappropriate type 0
    db_verify: Page 44516: hash page has bad prev_pgno
    db_verify: Page 44976: duplicate page of inappropriate type 13
    db_verify: Page 43273: record count incorrect: actual 289, in record 280
    db_verify: Page 1082: bad record count: has 2035 records, claims 2026
    db_verify: Page 42154: record count incorrect: actual 78, in record 79
    db_verify: Page 18214: bad record count: has 660 records, claims 661
    db_verify: Page 44992: duplicate page of inappropriate type 0
    db_verify: Page 42067: record count incorrect: actual 496, in record 487
    db_verify: Page 2266: bad record count: has 2824 records, claims 2815
    db_verify: Page 43694: record count incorrect: actual 23, in record 26
    db_verify: Page 9294: bad record count: has 605 records, claims 608
    db_verify: SUBID_P1_S1_FF3: DB_VERIFY_BAD: Database verification failed
    After restarting the application, db_stat and db_verify utilities worked fine. Without running db_recover, if these commands are working fine means it is not a genuine case of database corruption.
    Is it something to do with the way in which db_stat and db_verify utilities work?
    We will also try using -h option for db_stat and db_verify utilities.
    Thanks,
    Magesh

  • Hash function for the DB_HASH access method

    Hello!
    I use BDB 4.5.20 and tried to use a DB_HASH access method providing my own hash function, since I have very specific keys. Keys are UUID, and they all have the same length (16 bytes) and specific binary representation which can be used to generate hash code. After I set own hash function using Db::set_h_hash() I get the call of this function during database open with a very strange data I was not expected.
    Backtrace is:
    storaged.dll!tbricks::storage::StorageBDBBackend::bdb_hash_func(Db * db=0x01dba398, const void * key=0x1318326c, unsigned int size=12) Line 35     C++
    libdb45d.dll!_db_h_hash_intercept_c(__db * cthis=0x01dba418, const void * data=0x1318326c, unsigned int len=12) Line 483 + 0x97 bytes     C++
    libdb45d.dll!__ham_init_meta(__db * dbp=0x01dba418, hashmeta33 * meta=0x01dbb120, unsigned int pgno=0, _db_lsn * lsnp=0x0013f10c) Line 291 + 0x13 bytes     C
    libdb45d.dll!__ham_new_file(__db * dbp=0x01dba418, __db_txn * txn=0x01dbacc8, __fh_t * fhp=0x01dbafb8, const char * name=0x01dbac60) Line 402 + 0x13 bytes     C
    libdb45d.dll!__db_new_file(__db * dbp=0x01dba418, __db_txn * txn=0x01dbacc8, __fh_t * fhp=0x01dbafb8, const char * name=0x01dbac60) Line 284 + 0x15 bytes     C
    libdb45d.dll!__fop_file_setup(__db * dbp=0x01dba418, __db_txn * txn=0x01dba9e0, const char * name=0x01585624, int mode=384, unsigned int flags=129, unsigned int * retidp=0x0013f458) Line 586 + 0x42 bytes     C
    libdb45d.dll!__db_open(__db * dbp=0x01dba418, __db_txn * txn=0x01dba9e0, const char * fname=0x01585624, const char * dname=0x00000000, DBTYPE type=DB_HASH, unsigned int flags=129, int mode=0, unsigned int meta_pgno=0) Line 154 + 0x1d bytes     C
    libdb45d.dll!__db_open_pp(__db * dbp=0x01dba418, __db_txn * txn=0x01dba9e0, const char * fname=0x01585624, const char * dname=0x00000000, DBTYPE type=DB_HASH, unsigned int flags=129, int mode=0) Line 1079 + 0x23 bytes     C
    libdb45d.dll!Db::open(DbTxn * txnid=0x00000000, const char * file=0x01585624, const char * database=0x00000000, DBTYPE type=DB_HASH, unsigned int flags=33554561, int mode=0) Line 313 + 0x30 bytes     C++
    storaged.dll!tbricks::storage::BDBBackend::open_db(Db & db={...}, const char * fileName=0x01585624, DBTYPE dbType=DB_HASH) Line 372 + 0x21 bytes     C++
    Db::set_h_hash() documentation says nothing about behaviour like this.
    Why BDB calls my hash function during database open while I do not put()/get() any data?
    Firstly I was implemented hash function aborting the application if key length is not equal 16, because it looks like application internal error, and for sure application was aborted because of that.
    How should I treat this data and do I have to return any hash code at all in this case?

    A quick look at the code indicates that this call is to run the hash function against a known value ("%$sniglet^&") to store the result in the DB file (or to compare the result against a result stored in the file, if the file already exists). Since a failure of this comparison prints "hash: incompatible hash function", I think we can assume that this is done to ensure the hash function being used is compatible with the hash function used when the DB file was created.
    So you need to be able to provide some form of hash output for this.

  • Queue access method for In-memory databases

    Hi,
    I am trying to use the Queue access method for an in-memory database
    with no backing file. Here is the how I've created the environment and
    the database.
    int env_flags_create = DB_CREATE | DB_INIT_LOG | DB_INIT_LOCK |
    DB_INIT_MPOOL |DB_INIT_TXN |
    DB_SYSTEM_MEM | DB_RECOVER | DB_THREAD ;
    ret = env->set_shm_key(env, 17);
    ret = env->open(env, R_"in-mem-env", env_flags, 0644);
    int db_flags = DB_CREATE | DB_THREAD | DB_AUTO_COMMIT;
    DB_MPOOLFILE *mpf = subs_db->get_mpf(subs_db);
    mpf->set_flags(mpf, DB_MPOOL_NOFILE, 1);
    ret = queue_db->set_re_len(queue_db, 512);
    ret = queue_db->open(queue_db, NULL, NULL, "queue", DB_QUEUE,
    db_flags, 0644);
    My application has one reader threads and one writer thread. The
    writer write to the queue with the "DB_APPEND" flag and the reader
    consumes the queue using the "DB_CONSUME_WAIT" flag.
    After inserting a few thousand messages the database fails to insert
    any new records and starts returning the following error.
    "unable to allocate space from the buffer cache"
    From the db_stat -e output (attached below) I can see that none of
    the buffer cache pages are ever being freed up.
    149907 Requested pages found in the cache (99%)
    3 Requested pages not found in the cache
    2004 Pages created in the cache
    0 Pages read into the cache
    0 Pages written from the cache to the backing file
    0 Clean pages forced from the cache
    0 Dirty pages forced from the cache
    0 Dirty pages written by trickle-sync thread
    2004 Current total page count
    0 Current clean page count
    2004 Current dirty page count
    4099 Number of hash buckets used for page location
    153851 Total number of times hash chains searched for a page
    BDB reference manual (http://www.oracle.com/technology/documentation/
    berkeley-db/db/api_c/frame.html) says that the pages associated with a
    queue can only be reclaimed by setting a queue extent by using the
    "set_q_extentsize" method. When I try to use this method on my in-
    memory database I get the following error.
    " Extent size may not be specified for in-memory queue database"
    Does this mean that I can never use the queue access method for in-
    memory database? Because no matter how big of a shared memory pool I
    allocate to the in-memory database it will eventually get used up by
    the queue (if I'm inserting and consuming records) and there is no way
    to free up the pages associated with the deleted records.
    thx
    nina

    As far as I know you can choose any method as long as print setting are set to "send to spool"
    Regards
    Juan

  • I am trying to update my itunes and iphone. Everytime I trie comes out a message about 'key access'. I've done all the steps from the support and nothing worked out. I cannot unistall and now I can't open it anymore also. What should i do, please?

    I am trying to update my itunes and iphone. Everytime I trie comes out a message about 'key access'. I've done all the steps from the support and nothing worked out. I cannot unistall and now I can't open it anymore also. What should i do, please?

    Isn't that only used when a PC will not boot?
    What options does booting with this give me?
    Thanks
    JK MCP
    Hi,
    USB recovery disk was used to recover your system when it encounter problem. You can try to use it to fix your problem instead reinstall system. However, there is no method to keep your program whenreinstall system.
    Roger Lu
    TechNet Community Support

  • DB_HEAP access method with db_hotbackup utility

    I open a Db handle with DB_HEAP access method and do nothing about it . When first created , the db file is 8kb , but after excuting db_hotbackup utility the db file is 4kb. if I do db_hotbackup under the failover environment , BDB give me an error message :
         db_hotbackup: Backup Failed: BDB0075 DB_PAGE_NOTFOUND: Requested page not found
         db_hotbackup: BDB5043 HOT BACKUP FAILED!
    Other access method is ok . I try to set the Db pagesize 8kb but still wrong .
    I think a db file is bigger than a page size. So it's hard to understand.
    Thanks

    Sorry about mix the two problems. Let me make it clearly :
    1 .Create an Environment contains an empty DB_HEAP database file with the code below.
         1.1 compile the code and mkdir "fileHome" for Environment direcotory,
         1.2 execute the program
    2. execute { db_hotbackup -h ./fileHome -b ./failover } . and in failover directory the database file will  become smaller than it in Environment direcotry.
    3. chang code { const char* fileHome = "fileHome"; } to { const char* fileHome = "failover"; }
    4. compile the changed code and execute again.( for creating region files in the failover directory)
    5. execute { db_hotbackup -h ./failover -b ./failover_back } after this we can see the wrong message :
               db_hotbackup: Backup Failed: BDB0075 DB_PAGE_NOTFOUND: Requested page not found
               db_hotbackup: BDB5043 HOT BACKUP FAILED!
    The problem I said on the previous time is I try to insert some record to the database but failed. I just wonder if this BDB version is not supportint DB_HEAP access method.
    The code is :
    #include<iostream>
    #include<cstring>
    #include<cstdlib>
    #include"db_cxx.h"
    int main()
      u_int32_t env_flags = DB_CREATE |
           DB_INIT_LOCK |
           DB_INIT_LOG |
           DB_INIT_TXN |
           DB_INIT_MPOOL;
      u_int32_t db_flags = DB_CREATE | DB_AUTO_COMMIT;
      const char* fileHome = "fileHome";
      const char* filename = "simpletxn.db";
      Db *dbp = NULL;
      DbEnv myEnv(0);
      try{
      myEnv.open(fileHome,env_flags,0);
      dbp = new Db(&myEnv,0);
      dbp->set_pagesize(8 * 1024);
      dbp->open(0,
       filename,
       NULL,
       DB_HEAP,
       db_flags,
       0);
      }catch(DbException& e){
      std::cerr<<"error when opening environment and database: "<<filename<<","<<fileHome<<std::endl;
      std::cerr<<e.what()<<std::endl;
      try{
      if(dbp != NULL)
      dbp->close(0);
      myEnv.close(0);
      }catch(DbException& e){
      std::cerr<<"error when closing environment and database: "<<filename<<","<<fileHome<<std::endl;
      std::cerr<<e.what()<<std::endl;
      return 0;
    Thanks !!!

  • Best Access Method and Estimated Performance

    Dear folks,
    I'm new to BDB. Although I have read all the documentation and the DS Presentation from Margo, I would like to ask your help to tunne my db layout.
    I have to index 1 million key/data pairs in wich key is a logical number and data is 256 lenght (64 int array).
    The size of the database is around 200MB. After the initial seed of data, the data will be READ ONLY. No need for concurrent access. One C program will acess the DB (single threaded).
    I'm running on a Dual Xeon 3.2 GHz with 4 gb RAM.
    I've choosen to use the QUEUE ACCESS METHOD (since I'm using logical numbers as key and a fixed data size).
    I need to randomly access 140.000 keys in the DB.
    As I've read from the documentation this would be accomplished in less than a second.
    I would like to ask you what would be the expected retrieval time (number of keys/second) for my case (millions of 256 bytes data, with default configuration options) and if QUEUE is the best choice.
    From my implementation test the c program takes a considerable amount of time the first time it queries (dpb->get) the database for 140.000 keys (is this the so called COLD START?). The successive times I run the program querying the DB with different 140.000 random keys it becames faster for each new run (is this because I'm warming up the cache?).
    I'm using default configuration values for all tunning params: cache, mmapsize, etc...
    Would it be possible to load the whole DB in memory before querying it with dpb->get? Would it make the 140.000 querying process faster?
    I've tryied to iterate trough every record with a cursor and it takes around 5 seconds the first time and then gets faster on the successive runs. I've also tryied to iterate through every page to "warm up" the process before querying the 140.000 keys but did not have a great improvement.
    My goal is to query 140.000 random keys from the DB as fastest as possible. (Be it changing by choosing a more appropriate access method, be it for tunning the config parameters).
    I appreciate your help.
    Maurice S.

    Thank you Michael for your reply!!!
    I've seen the thread regarding the strategy of openning the mpool file and iterating through the pages.
    I've implemented that sucessfully (that reduced the total time required to perform the "get's" and also make this time a CONSTANT of around 0.5 seconds).
    My implementation works the following way:
    1) First I create the DB_ENV pointer
    1.A) All my dbs are in a folder called "dbs". Therefore I call dbenv->set_data_dir appropriatelly
    1.B) dbenv->set_mp_mmapsize(dbenv,300*1024*1024); (each DB has 183 MB)
    1.C) I set the cache size to the smallest possible value dbenv->set_cachesize(dbenv, 0, 20 *1024, 0); [as I've read through the forum about similar cases]
    1.D) Finally dbenv->open(dbenv, "db",DB_CREATE | DB_RDONLY| DB_INIT_MPOOL, 0))
    2) Then I call the db (wich has 700.000 records; with for 4 bytes for each key, and 260 bytes for each data)
    2.A) db_create(&dbs[c], dbenv, 0))
    2.B) dbs[c]->set_re_len(dbs[c],260)
    2.C) dbs[c]->set_pagesize(dbs[c], 64*1024))
    2.D) dbs[c]->open(dbs[c],NULL, database, NULL, DB_QUEUE, DB_RDONLY, 0664))
    Then I do the "mpool file iteration":
    .....all the code from that thread.....
    DB_MPOOLFILE* mfp =NULL;
    mfp = dbs[c]->get_mpf(dbs[c]);
    db_pgno_t lastPageNum;
    void* pageAddr;
    mfp->get(mfp, &lastPageNum, NULL, DB_MPOOL_LAST, &pageAddr);
    mfp->put(mfp, pageAddr, DB_PRIORITY_UNCHANGED, 0);
    db_pgno_t pageNum=0;
    for(pageNum=0; pageNum<=lastPageNum; pageNum++)
    mfp->get(mfp,&pageNum, NULL, 0, &pageAddr);
    mfp->put(mfp,pageAddr, DB_PRIORITY_UNCHANGED,0);
    And then I get 140.000 random records:
    DBT key, data;
    for(k=0;k<140000;k++)
    db_recno_t recno=rand()%700000;
    memset(&key, 0, sizeof(DBT));
    memset(&data, 0, sizeof(DBT));
    key.data = &recno;
    key.size = sizeof(recno);
    int dc[65];
    data.data = dc;
    data.ulen = sizeof(dc);
    data.flags = DB_DBT_USERMEM;
    dbp->get(dbp, NULL, &key, &data, 0);
    It takes around 0.5 seconds to perform all 140.000 random GET's.
    I have 20 DB's like the one described above.
    Changing the code above in order to use another one of the 20 DB's results in the same EXECUTION TIME (around 0.5 seconds).
    Is this the performance that you would expect from BDB? 280.000 random accessess per second in a 700.000 records QUEUE DB with 260 bytes data field?
    Is there any other parameters I could tunne to improve performace?
    Would BTREE acess method perform better ? (I could index the record numbers as strings: "00000001", "00000002", ..... )
    I do appreciate your attention.
    Hope my post can be a source for help to other BDB users, as the forum has been to me.
    Best rgs,
    Maurice S.

  • Spring java.lang.IllegalAccessError: tried to access method org.springframe

    Hi
    I am looking to use OEPE to allow me to adapt a RAD approach to the web part of our applications while keeping our CI builds consistant.
    We use WebLogic 10.3 with struts 1.2.9, Spring 2.5, Hibernate 3.X and maven 2.
    I am using Eclipse 3.5 SR1 with OEPE version Oracle Enterprise Pack for Eclipse 11.1.1.3.0
    I created a test Dynamic Web Application using maven 2 and this works OK with a test WebLogic Server 10.3. I then deleted this from the WebLogic Server so I could try using it with OEPE.
    I deploy this Dynamic Web Application using OEPE (via autogenerated_ear_) to WebLogic Server
    My initial problems were classpath errors where it seems that my Maven dependent jars were NOT picked up by my web application. To overcome this I copied the maven dependencies to <my web app>\src\main\webapp\WEB-INF\lib
    I could then use my initial struts action but failed with:
    Root cause of ServletException.
    java.lang.IllegalAccessError: tried to access method org.springframework.web.struts.ActionSupport.getWebApplicationContext()Lorg/springframework/web/context/WebApplicationContext; from class com.myco.springtxn.web.struts.SaveNewCakeAction_beaVersion0_7
         at com.myco.springtxn.web.struts.SaveNewCakeAction_beaVersion0_7.execute(SaveNewCakeAction.java:31)
         at com.myco.springtxn.web.struts.SaveNewCakeAction.execute(SaveNewCakeAction.java)
         CakeService cakeService = (CakeService) getWebApplicationContext().getBean("cakeService");
    Some more data:
    TRACE:
    Saving Cake with name oepe cake and description copied in jars
    <24-Oct-2009 21:13:16 o'clock BST> <Error> <HTTP> <BEA-101017> <[weblogic.servlet.internal.WebAppServletContext@d9f6cb - appName: '_auto_generated_ear_', name: 'sdw', context-path: '/sdw', spec-version: '2.5', request: weblogic.servlet.internal.ServletRequestImpl@148bedb[
    POST /sdw/saveNewCake.do HTTP/1.1
    Accept: */*
    Referer: http://localhost:7001/sdw/enterCake.do
    Accept-Language: en-gb
    Content-Type: application/x-www-form-urlencoded
    UA-CPU: x86
    Accept-Encoding: gzip, deflate
    User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; NGD_build; .NET CLR 1.1.4322; .NET CLR 2.0.50727; MS-RTC LM 8; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
    Content-Length: 41
    Connection: Keep-Alive
    Cache-Control: no-cache
    Cookie: refresh=; JSESSIONID=dG4BKjLBdL3LWMPkJG3r1Tw64hjpBMWwvplvypkGZlTYhb6cJD9M!-36198065; ADMINCONSOLESESSION=7gyTKjLQgQfNlPlQ1cBydQXgHcgljjQn8tnHL4Qn5GWr8pLWZG0W!1523650153
    ]] Root cause of ServletException.
    java.lang.IllegalAccessError: tried to access method org.springframework.web.struts.ActionSupport.getWebApplicationContext()Lorg/springframework/web/context/WebApplicationContext; from class com.myco.springtxn.web.struts.SaveNewCakeAction_beaVersion0_7
         at com.myco.springtxn.web.struts.SaveNewCakeAction_beaVersion0_7.execute(SaveNewCakeAction.java:31)
         at com.myco.springtxn.web.struts.SaveNewCakeAction.execute(SaveNewCakeAction.java)
         at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at weblogic.servlet.utils.FastSwapFilter.doFilter(FastSwapFilter.java:66)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3496)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(Unknown Source)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    >
    I AM USING;
    1. Operating System - Windows XP Professional
    2. Eclipse Version - 3.5.1
    3. WLS Version - 10.3
    4. Brief app shape description. Dynamic Web App
    5. The .classpath a
    <?xml version="1.0" encoding="UTF-8"?>
    <classpath>
         <classpathentry kind="src" output="target/classes" path="src/main/java"/>
         <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
         <classpathentry kind="con" path="oracle.eclipse.tools.weblogic.lib.system">
              <attributes>
                   <attribute name="owner.project.facets" value="jst.web"/>
              </attributes>
         </classpathentry>
         <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
         <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
         <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Spring2.5">
              <attributes>
                   <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
                   <attribute name="owner.project.facets" value="oracle.struts;spring.core"/>
              </attributes>
         </classpathentry>
         <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Struts">
              <attributes>
                   <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
                   <attribute name="owner.project.facets" value="oracle.struts"/>
              </attributes>
         </classpathentry>
         <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
         <classpathentry kind="output" path="target/classes"/>
    </classpath>
    web app cache
    <webapp-structure>
    <registeredFiles>
    <entry>
    <string>currentBuild</string>
    <path-set>
    <pathsSet class="linked-hash-set">
    <string>index.jsp</string>
    <string>META-INF/MANIFEST.MF</string>
    <string>pages/cakeSavedInfo.jsp</string>
    <string>pages/enterCake.jsp</string>
    <string>pages/welcome.jsp</string>
    <string>WEB-INF/applicationContext.xml</string>
    <string>WEB-INF/config/struts-config.xml</string>
    <string>WEB-INF/tld/c.tld</string>
    <string>WEB-INF/tld/fmt.tld</string>
    <string>WEB-INF/tld/struts-bean.tld</string>
    <string>WEB-INF/tld/struts-html-el.tld</string>
    <string>WEB-INF/tld/struts-html.tld</string>
    <string>WEB-INF/tld/struts-logic.tld</string>
    <string>WEB-INF/tld/struts-tiles.tld</string>
    <string>WEB-INF/web.xml</string>
    <string>WEB-INF/weblogic.xml</string>
    <string>WEB-INF/classes/com/myco/springtxn/web/controller/CakeController.class</string>
    <string>WEB-INF/classes/com/myco/springtxn/web/controller/spring/AnnotatedSpringCakeController.class</string>
    <string>WEB-INF/classes/com/myco/springtxn/web/struts/CakeForm.class</string>
    <string>WEB-INF/classes/com/myco/springtxn/web/struts/EnterNewCakeAction.class</string>
    <string>WEB-INF/classes/com/myco/springtxn/web/struts/SaveNewCakeAction.class</string>
    <string>WEB-INF/classes/com/myco/springtxn/web/util/Logging.class</string>
    <string>WEB-INF/lib/SpringTxnServices-0.0.1-SNAPSHOT.jar</string>
    <string>WEB-INF/lib/spring-2.5.6.jar</string>
    <string>WEB-INF/lib/commons-logging-1.0.4.jar</string>
    <string>WEB-INF/lib/commons-lang-2.4.jar</string>
    <string>WEB-INF/lib/hibernate-core-3.3.1.GA.jar</string>
    <string>WEB-INF/lib/antlr-2.7.2.jar</string>
    <string>WEB-INF/lib/commons-collections-3.1.jar</string>
    <string>WEB-INF/lib/dom4j-1.6.1.jar</string>
    <string>WEB-INF/lib/xml-apis-1.0.b2.jar</string>
    <string>WEB-INF/lib/jta-1.1.jar</string>
    <string>WEB-INF/lib/slf4j-api-1.5.2.jar</string>
    <string>WEB-INF/lib/hibernate-annotations-3.4.0.GA.jar</string>
    <string>WEB-INF/lib/ejb3-persistence-1.0.2.GA.jar</string>
    <string>WEB-INF/lib/hibernate-commons-annotations-3.1.0.GA.jar</string>
    <string>WEB-INF/lib/hibernate-entitymanager-3.4.0.GA.jar</string>
    <string>WEB-INF/lib/javassist-3.4.GA.jar</string>
    <string>WEB-INF/lib/hibernate-validator-3.1.0.GA.jar</string>
    <string>WEB-INF/lib/slf4j-log4j12-1.5.2.jar</string>
    <string>WEB-INF/lib/log4j-1.2.14.jar</string>
    <string>WEB-INF/lib/SpringLegacyModule-0.0.1-SNAPSHOT.jar</string>
    <string>WEB-INF/lib/struts-1.2.9.jar</string>
    <string>WEB-INF/lib/commons-beanutils-1.7.0.jar</string>
    <string>WEB-INF/lib/commons-digester-1.6.jar</string>
    <string>WEB-INF/lib/commons-fileupload-1.0.jar</string>
    <string>WEB-INF/lib/commons-validator-1.1.4.jar</string>
    <string>WEB-INF/lib/oro-2.0.7.jar</string>
    <string>WEB-INF/lib/xalan-2.5.1.jar</string>
    <string>WEB-INF/lib/struts-el-1.2.9.jar</string>
    <string>WEB-INF/lib/standard-1.0.6.jar</string>
    <string>WEB-INF/lib/jstl-1.1.2.jar</string>
    <string>WEB-INF/lib/spring-webmvc-struts-2.5.6.jar</string>
    <string>WEB-INF/lib/spring-beans-2.5.6.jar</string>
    <string>WEB-INF/lib/spring-core-2.5.6.jar</string>
    <string>WEB-INF/lib/spring-context-2.5.6.jar</string>
    <string>WEB-INF/lib/aopalliance-1.0.jar</string>
    <string>WEB-INF/lib/spring-web-2.5.6.jar</string>
    <string>WEB-INF/lib/spring-webmvc-2.5.6.jar</string>
    <string>WEB-INF/lib/spring-context-support-2.5.6.jar</string>
    </pathsSet>
    </path-set>
    </entry>
    </registeredFiles>
    </webapp-structure>

    Got back to testing this (been busy in my day job). I realised that I had not tested hot deployment. So I switched on FastSwop by adding the following the the weblogic.xml (of the web applicatiion):
    Gives
    Accept-Encoding: gzip, deflate
    User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; NGD_build; .NET CLR 1.1.4322; .NET CLR 2.0.50727; MS-RTC LM 8; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
    Content-Length: 22
    Connection: Keep-Alive
    Cache-Control: no-cache
    Cookie: JSESSIONID=T6PTK7yS3jdJzzLsP5nNB6TNCyLFMcYxZf8j1rRRGBXZ8hSbBQT2!580994594
    ]] Root cause of ServletException.
    java.lang.IllegalAccessError: tried to access method org.springframework.web.struts.ActionSupport.getWebApplicationContext()Lorg/springframework/web/context/WebApplicationContext; from class com.myco.springtxn.web.struts.SaveNewCakeAction_beaVersion0_8
         at com.myco.springtxn.web.struts.SaveNewCakeAction_beaVersion0_8.execute(SaveNewCakeAction.java:31)
         at com.myco.springtxn.web.struts.SaveNewCakeAction.execute(SaveNewCakeAction.java)
         at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
         Truncated. see log file for complete stacktrace
    >
    I find this sad since using tomcat I can hot deploy without any problem

  • Access method and wait event

    hi,
    i am confused about access method and wait event.
    is there any relation between access method and wait event?

    sb92075 wrote:
    is there any relation between access method and wait event?No relationI disagree. If access method is full table scan or fast full index scan, that's likely to cause db file scattered read waits, whereas an index driven access method such as index range scan will likely cause db file sequential read waits.
    -Mark

  • CVS: access method is not installed

    Hello,
    i don't get the CVS connection working.
    I have installed WinCVS, in the "About Box" of JDeveloper i can read "(CVSNT) 2.0.41a (client/server). CVS from the command line works fine, also WinCVS is happy.
    Then i create a CVS connection JDeveloper, and regardless which access method i choose (pserver,ntserver, ...) i get:
    Testing connection...
    the :ntserver: access method is not installed on this system
    Connection test failed: unable to connect.
    when i press "test connection".
    What to do ?
    Regards
    René

    WinCVS probably comes bundled with an older version of cvsnt that still supports the ntserver protocol. I think the CVS executable used by WinCVS is in the WinCVS installation directory. If you're getting errors in JDev that you're not getting from that specific cvs.exe, yor PATH probably doesn't have the correct directory first, and hence JDev is picking up a different version of CVS. Try putting the WinCVS directory first thing in your PATH.
    Brian

  • Determine cffunction access method?

    I have a .cfc which can be called either locally or remotely. When I call it locally, there's no need to determine whether the function should be allowed to run since all local calls can be trusted. However, when called as a web service, I would like to require two paramaters (username and password) so I can determine whether the function can be permitted to execute, or if I should return an "Access denied" message. (The verifyClient attribute of the cffunction tag is not what I'm after. I need to verify the username and password against a collection of account credentials.)
    What I really need (in pseudo-code) is something like:
    IF (requested_as_a_web_service = "true")
    {check username and password against account credentials}
    ELSE {stop processing and return an "Access denied" message}
    So, is there a way to determine the access method?
    David

    But returning the CFC path doesn't help me determine whether the calling page is local or remote. Now if the CFC could reliably conclude the path of the calling page, that'd help, but I don't see any way that's possible.
    Yeah, but think about it... if the path is the CFC, then it's a remote call.  If it's anything else: it's not a remote call.
    Adam

  • Setting access method(DB_BTREE / DB_RECNO )

    Hi
    How to setup/change access method (I want to use recno instead of BTree) in C++? Please let me know how to set access method.
    Thanks
    Santhosh

    Hi Santhosh,
    The access method is only relevant when using Berkeley DB directly, not when using Berkeley DB XML. You'll probably be better off asking this question on the Berkeley DB forum:
    Berkeley DB
    John

  • Error accessing method in 3rd party dll

    already asked for help a few weeks ago but no one answered and i still wasn't able to figure out what the problem...
    i have a 3rd party dll and im trying to access some methods (USING JNI)- i have no problem accessing methods with no parameters and they work fine but a method with parameters just wwont work.
    i guess that its something with my syntax - probably incorrect data type when converting from java type to native type...
    i dont have any previous expirience with c so help would be appriciated...
    heres my java code:
    package pavel2.javay;
    class Test {
        native String VersionGet();
        native String loadDll();
        native String LogInMT4(int account,String  pass,String server,String a,String v,String c,String d);
        static {
            System.loadLibrary("pavel2");
        public static void main(String args[]) {
            Test t = new Test();
            System.out.println(t.loadDll());
            System.out.println(t.LogInMT4(230622,"qd1bvvs","Orion-DEMO","","","",""));
    }and the dll wrapper:
    #include <windows.h>
    #include <C:\\Program Files\\Java\\jdk1.6.0_10\\include\\jni.h>
    #include <C:\\Program Files\\Java\\jdk1.6.0_10\\include\\win32\\jni_md.h>
    typedef char*   (*LogIn_MT4)( const int login, const char *password, const char *server, const char *proxyserver,
                   const char *proxytype, const char *proxylogin, const char *proxypassword);
    HINSTANCE hOle2Dll;
    JNIEXPORT jstring JNICALL Java_pavel2_javay_Test_loadDll(JNIEnv * env, jobject jobj){
         hOle2Dll = LoadLibrary(TEXT("D:\\pavel2\\tzmt4api.dll"));
         return  (*env)->NewStringUTF(env, "tzmt4api.dll loaded!!");
         /*if (OleInitialize(NULL) == S_OK)
              if ( hOle2Dll >= 32 )
                   //FreeLibrary ( hOle2Dll ) ;
    JNIEXPORT jstring JNICALL Java_pavel2_javay_Test_LogInMT4(JNIEnv * env, jobject jobj,jint login, jstring password, jstring server,jstring proxyserver,jstring proxytype,jstring proxylogin,jstring proxypassword){
                   LogIn_MT4 fnc ;
                   fnc = (LogIn_MT4)GetProcAddress ( hOle2Dll , "LogIn_MT4" ) ;
                   if ( fnc == NULL )
                        MessageBox(NULL, TEXT("Error loading Method"), TEXT("Error"), MB_OK);
                   else
                   const char *pass = (*env)->GetStringUTFChars(env, password, NULL);
                   const char *ser = (*env)->GetStringUTFChars(env, server, NULL);
                   const char *proxyserv = (*env)->GetStringUTFChars(env, proxyserver, NULL);
                   const char *proxyt = (*env)->GetStringUTFChars(env, proxytype, NULL);
                   const char *proxylog = (*env)->GetStringUTFChars(env, proxylogin, NULL);
                   const char *proxypass = (*env)->GetStringUTFChars(env, proxypassword, NULL);
                   int a=fnc(login, pass, ser, proxyserv,proxyt,proxylog,proxypass);
                   (*env)->ReleaseStringUTFChars(env, password, pass);
                   (*env)->ReleaseStringUTFChars(env, server, ser);
                   (*env)->ReleaseStringUTFChars(env, proxyserver, proxyserv);
                   (*env)->ReleaseStringUTFChars(env, proxytype, proxyt);
                   (*env)->ReleaseStringUTFChars(env, proxylogin, proxylog);
                   (*env)->ReleaseStringUTFChars(env, proxypassword, proxypass);
                   //return  (*env)->NewStringUTF(env, empty);
                   return  (*env)->NewStringUTF(env, "logged");
                             //int c = fnc(login, *password, *server, "", "", "", "");
    BOOL APIENTRY DllMain( HMODULE hModule,
                           DWORD  ul_reason_for_call,
                           LPVOID lpReserved
         switch (ul_reason_for_call)
         case DLL_PROCESS_ATTACH:
         case DLL_THREAD_ATTACH:
         case DLL_THREAD_DETACH:
         case DLL_PROCESS_DETACH:
              //todo: unregister class here
              break;
         return TRUE;
    }this is the output:
    tzmt4api.dll loaded!!
    # An unexpected error has been detected by Java Runtime Environment:
    # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0xcccccccc, pid=3792, tid=3824
    # Java VM: Java HotSpot(TM) Client VM (11.0-b15 mixed mode, sharing windows-x86)
    # Problematic frame:
    # C 0xcccccccc
    # An error report file with more information is saved as:
    # C:\Program Files\TradeZone\TZMT4APInew\Work\hs_err_pid3792.log
    # If you would like to submit a bug report, please visit:
    # http://java.sun.com/webapps/bugreport/crash.jsp
    # The crash happened outside the Java Virtual Machine in native code.
    # See problematic frame for where to report the bug.
    Process finished with exit code 1
    p.s - it looks like the login method works but when returning to java the VM crashes
    can anyone help me?

    jschell - tried this already and got the same ..
    ejp - i cant do this bucause i dont have a .lib and this proccess can run only on windows unfortunately...
    my problem is that i dont know the how to create the correct type for the method:
    this is the signature:
    typedef int  (*LogIn_MT4)( const int login, const char *password, const char *server, const char *proxyserver,
                   const char *proxytype, const char *proxylogin, const char *proxypassword);how do i create in c this var types?
    int a=fnc(1531, "asas", "asd", "","","","");how do i create
    const char *xxx type? and its okay for the int just to write a number or i also need to declare it?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Can't printing in front-end when implement LOCL access method 'G'

    We are implementing ECC5.0 and print Purchase Order in normal status.But in recent,user print PO by long printer name with some trouble.So we check the notes,and it recommand us to implement access method 'G'.It seems every thing is OK on front-end printing.Still not work for printing PO on front-end output immediate.If we choose short printer name and access method 'F',it work fine.But SAP will no longer develop method 'F'.Please advise it.

    SAP PO is using background printing. SAP frontend print doesn't support background printing.
    As per SAP Frontend document, You cannot perform front-end printing in the background, as there is not connection to the front end.
    For this, you need to configure network printer.
    Thanks,
    Miral.

  • Front - end print with new access method G - having issues for some users

    Hi Gurus,
    Recently we have implemented the new access method G for front-end printing. it is working fine for 90% users in our company. but some users having problems in printing to WINDEFAULT using this new method.
    Here is the SAP GUI trace file for the error that they are getting.
    (Error)(25.09.09 15:42:36.444):    CALL METHOD "CreateControl"[DispID=5] OF [#1/0x0AE31790/1/{83658045-6571-3232-7082-797884697868}]
                        #0: LONG "101"
                        #1: STRING "SAPFPRINT.sapfprintCtrl.1"
                        #2: LONG "0"
                        #3: LONG "10"
    IDispatch::Invoke raised exceptionException occurred
    (Error)                       :   
    (Error)                       :    ****************************ERROR OCCURED IN MODULE: [{83658045-6571-3232-7082-797884697868}]******************************************************************************************************
    (Error)                       :    PROGRAM_ID                                 |MODULE_NAME              |METHOD_NAME       |ERROR DESCRIPTION         |VERSION                    |GUI VERSION               |MODULE_PATH              |
    (Error)                       :    *****************************************************************************************************************************************************************************************************
    (Error)                       :    {83658045-6571-3232-7082-797884697868}     |Class name not found     |CreateControl     |Create control failed     |Version info not found     |Gui Version not found     |Module doesnot exist     |
    (Error)                       :    *****************************************************************************************************************************************************************************************************
    (Error)                       :   
    (Error)                       :    Exception fire by :SAP Frontend Server
    (Error)                       :    Exception info:Create control failed
    (Error)                       :    Exception code:65535
    Did any one face this error? what could be the resolution?
    We are already on SAP GUI 710 patch level 11
    DISP+Work  : 229
    Appreciate your answers
    Thanks,
    Srini

    Usually this means, that some necessary controls are not properly registered in the registry and hence can't be found. You may solve that by removing the SAPGUI from the PC completely, booting the machine and reinstall the GUI.
    Markus

Maybe you are looking for