Key iteration via cursor

Hi all,
While looking at the documentation, I have been unable to find a way to iterate over the keys of a database without loading the values. Did I miss something or is this not possible? If not possible, are there any plans to change this?
The reason I ask is that BDB JE is used as the default back-end for Voldemort (http://project-voldemort.com/) and for certain admin functions, it's useful to be able to work out which nodes have which keys. It would be nice to be able to do this without loading the values.
Best,
Ismael

Ismael, no it is not possible with JE today. It will be possible in a future release, but only if ReadUncommitted is used.
--mark                                                                                                                                                                                                                                                                           

Similar Messages

  • Update key mapping via web service

    Hi ,
    I have a question about edit key mapping. The problem is that we create vendors in MDM and syndicate them to different ERP systems. To decide which system a new vendor/changes must be send to, I need the Edit Key Mapping, but the users do not want to enter this information manually and I do not see how I can create key mapping automatically.
    We are working on a new solution where vendors are entered in sharepoint and updated in MDM via web services. I would like to know if one of you know if key mapping can be maintained via a web service.
    Kind regards
    Jonna

    Hello,
    You may use the document,
    [MDM PI via Web Service Key Mapping|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/e0812356-e62f-2c10-76aa-9a02d038ba81]
    Hope this helps your scenario
    Regards,
    Abhishek

  • Error trying to prune DB via Cursor

    I'm using JE 3.1.0 and have last-event records in a database and am trying to write a thread to prune the database of old records. The database is not transactional - setTransactional() is set to false in both EnvironmentConfig and DatabaseConfig. Database.put() is being called with a null transaction in the primary writer thread. The background pruning thread opens a cursor with a null transaction as well. The problem is that the pruning thread dies trying to use the cursor, throwing a DatabaseException when cursor.getNext() is called, with the following message:
    Exception in thread "Thread-6" java.lang.RuntimeException: Exception attempting to get next record (current record is #0): (JE 3.1.0) A per-thread transaction was created in Thread[main,5,main] but used in Thread[Thread-6,5,main]
    The cursor is being opened as follows:
         public EntryRemover(Database db, int chunkSize, int sleepSeconds) {
              this.db = db;
              Transaction txn = null;
              try {
                   if (this.db.getEnvironment().getConfig().getTransactional()) {
                        txn = this.db.getEnvironment().beginTransaction(null, null);
                        logger.info("Beginning transaction");
                        cursor = this.db.openCursor(txn, null);
                   } else {
                        logger.info("Using null transaction");
                        cursor = this.db.openCursor(null, null);
              } catch (DatabaseException dbe) {
                   logger.error("Exception thrown attempting to create transaction: "+dbe.getMessage(),dbe);
                   throw new RuntimeException(dbe);
              this.chunkSize = chunkSize;
              this.sleepSeconds = sleepSeconds;
         }And the exception is being thrown from the following method:
         protected int removeEntries(int maxEntriesToRemove) {
              boolean endReached = false;
              int i = 0;
              int entriesRemoved = 0;
              DatabaseEntry key, value;
              while (!endReached && entriesRemoved < maxEntriesToRemove) {
                   key = new DatabaseEntry();
                   value = new DatabaseEntry();
                   OperationStatus status = null;
                   try {
                        status = cursor.getNext(key, value, LockMode.DEFAULT);
                   } catch (DatabaseException de) {
                        throw new RuntimeException("Exception attempting to get next record (current record is #"+i+"): "+de.getMessage(),de);
                   if (status == OperationStatus.SUCCESS) {
                        if (shouldRemove(key.getData(), value.getData())) {
                             try {
                                  if (OperationStatus.SUCCESS == cursor.delete()) {
                                       entriesRemoved++;
                                  } else {
                                       throw new IllegalStateException("Attempt to delete record did not return success");
                             } catch (DatabaseException de) {
                                  throw new RuntimeException("Exception delete record (current record is #"+i+"): "+de.getMessage(),de);
                   } else if (status == OperationStatus.NOTFOUND){
                        logger.info("End of db reached");
                        endReached = true;
                   else {
                        throw new IllegalStateException("Attempt to get next record did not return success, instead: "+status);
                   i++;
              return entriesRemoved;
         }It is using a null transaction in opening the cursor, the database is not transactional, so I'm not sure why it's complaining about a transaction having been created in a different thread?

    Hmm, I had seen that but didn't think I was violating it. The way it's working is the main thread is initializing the database and doing the writing, etc. The pruner thread is opening the cursor. I guess this is considered using the cursor across threads? Since the database was initialized in a different thread? Because the pruner thread is the only block of code in which I use cursors, at least explicitly. I'll try it with the db opened transactionally, thanks.
    For the record, the EnvironmentConfig is
    ERROR 2007-03-27 17:27:09,320 151192 [Thread-6] EntryRemover.java:logEnvConfig  - EnvironmentConfig: allowCreate=true
    {je.env.isTransactional=false, je.maxMemoryPercent=25, je.env.isReadOnly=false}

  • In latest Nightly, arrow keys don't move the cursor but instead exit the text box. How can I fix this so that the arrow keys move the cursor?

    Using Nightly 28.0a1, I'm having a problem with the text box fields when typing. I use Hacker's Keyboard which has onscreen arrow keys and I find it more convenient than fiddling with a tiny cursor thumb when editing text. On the Play Store Firefox it works just fine but on Nightly, any time I try to move the cursor with the arrow keys it jumps out of the text box and highlights other elements on the page. This is annoying beyond belief as it means having to resort to that imprecise thumb cursor that takes forever to get where you want it. Is this a known issue with the latest nightly builds?

    Thanks for the report. I have filed bug https://bugzilla.mozilla.org/show_bug.cgi?id=939959. It would be helpful to know and if you can comment into the bug to indicate which input field you are testing on.

  • C++ key iteration

    Hi,
    I realise you're still finalising the documentation and various areas may be a little sparse at the moment. With this in mind I was wondering if you could help me out the manipulation of some of your classes.
    I want to iterate over all the keys in a given cache. I found these two functions.
    virtual Set::View keySet      (           )      const [pure virtual]
    virtual Set::Handle keySet      (           )      [pure virtual]
    The documentation seems to be the same for both, so I'm unsure which one to use.
    Secondly once I use one of these methods, whats the correct way of iterating over a View/Handle in order to return the keys. Assume all my keys are strings.
    Thanks
    Rich

    Thanks again Mark. Sadly I'm not familiar with the java side of things, I'm coming to this new and from a c++ point of view.
    It's difficult to see how the various classes fit together (but I am learning :)).
    As I want all of the items stored in a cache I'm trying to use the AllFilter (which I assume returns all the results?)
    However when I use it an exception is thrown. I think it causes a problem on the server as an exception is thrown there also.
    Here's the code;
         Filter::View          vAll = AllFilter::create();
    Set::View vSetResult2 = hCache->entrySet(vAll);
    Maybe I'm missing something ...
    Here's the exception on the server;
    2008-10-17 11:26:21.809 Oracle Coherence GE 3.4/397 (Pre-release) <D5> (thread=P
    roxy:ProxyService:TcpAcceptorWorker:0, member=1): An exception occurred while pr
    ocessing a QueryRequest for Service=Proxy:ProxyService:TcpAcceptor: (Wrapped: Fa
    iled request execution for DistributedCache service on Member(Id=1, Timestamp=20
    08-10-17 10:20:56.025, Address=10.1.45.224:8088, MachineId=9952, Location=site:e
    uro.net.intra,machine:LONW00051451,process:76788, Role=CoherenceServer)) java.la
    ng.NullPointerException
    at com.tangosol.util.filter.ArrayFilter.calculateFilters(ArrayFilter.jav
    a:87)
    at com.tangosol.util.filter.AllFilter.applyIndex(AllFilter.java:100)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.g
    rid.DistributedCache$Storage.query(DistributedCache.CDB:28)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.g
    rid.DistributedCache.onQueryRequest(DistributedCache.CDB:23)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.g
    rid.DistributedCache$QueryRequest.run(DistributedCache.CDB:1)
    at com.tangosol.coherence.component.net.message.requestMessage.Distribut
    edCacheRequest.onReceived(DistributedCacheRequest.CDB:12)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.G
    rid.onMessage(Grid.CDB:9)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.G
    rid.onNotify(Grid.CDB:130)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.g
    rid.DistributedCache.onNotify(DistributedCache.CDB:3)
    at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:37)
    at java.lang.Thread.run(Unknown Source)

  • Removing Duplicate Data via cursor

    Hello friends just wondering if anyone might be able to lead me down the right path to get this script written. I have a table with millions of duplicate rows, but with luck I have a column that has UUIDs that are used for another database to look at. So I have a column to which I can base my query off of. Basically I want to run a cursor to grab one instance of the duplicate rows and delete the rest. I was thinking that I could use the max rowid and put that in a varaiable and use that to grab one UUID to not delete. Anyway just wanted to bounce this off a few people who are much better at this kind of thing than myself.
    Thanks in advance for any help insight you might be able to provide.
    Luke

    Hey Justin thank you for the reply, no i'll be honest and just say we got lucky that they had put a function on this table by mistake that populated a UUID column that they "thought" they were going to need. As long as one of the dupes remains that's all that is needed. The table over 70million rows as it sits right now. I want to do some data cleanup before I do any kind of tweaking to it as far as partitioning and what not.
    What happens is there isn't any primary keys or constraints on these tables at all... And there are 3rd party programs that users can insert any data they want. So what they do is run a report they already ran by accident and just insert that info in the table again... well as soon as I can get this cleaned up I'm going to be adding a constraint so this can't happen any more.
    Almost forgot... like I said there are millions of dupes, but it's not just one row that is duplicated. Here is an example of it:
    Table: dups_are_cool
    ID, date, name, UUID
    123, FEB03, Luke, unique UUID
    123, FEB03, Luke, unique UUID
    123, FEB03, Luke, unique UUID
    321, DEC99, John, unique UUID
    321, DEC99, John, unique UUID
    321, DEC99, John, unique UUID
    321, DEC99, John, unique UUID
    321, DEC99, John, unique UUID
    999, MAY81, Don, unique UUID
    999, MAY81, Don, unique UUID
    So what I want to do is take one of the UUIDs and then delete the rest of the rows that are duplicate. Since there are millions of rows with a different number of occurrences doing it one occurrence at a time might take me a bit too long hehe
    Message was edited by:
    Luke22
    Message was edited by:
    Luke22

  • Can't use arrow keys to move cursor around TextArea after upgrading to 1.4

    Hi,
    I saw that there have been similar posts, but none are exactly the same nor have they solved my problem...
    I've got an older Java application that has been around for many years,
    the only updates to it essentially being upgrading the version of the
    JDK. So far, upgrading the JDK hasn't caused any issues. However, after upgrading to JDK 1.4, I can no longer use the arrow keys on the
    keyboard to move the cursor within a TextArea. You can use the mouse to highlight and you can use the rest of the keys (i.e. type in text,
    delete stuff, etc.) but somehow you just can't move the cursor around
    by using the keyboard. Does anybody have any suggestions on what I
    could do to solve this? Thanks in advance!

    Didn't get any replies/comments, but in case anybody is interested, I took the easy way out and upated the TextArea to a JTextArea and the problem went away.

  • Private key import via ImportPrivateKey

    I used the Certificate web app included with WLS 7.0 SP1 to generate my private
    key and my CSR. I then used the CSR to request a certificate from my Dept. of
    Defense Certificate Authority. I received my certificate. I then tried to use
    the WLS ImportPrivateKey utility to import my key with the following steps as
    shown in the ImportPrivateKey reference example.
    1) I used keytool -printcert to verify the contents of my servercert.pem file
    and my CAcert.pem file.
    2) I combined the certificate returned for my server with the CA's root certificate
    cat servercert.pem CAcert.pem > combined.pem
    3) I converted my private key file produced by the Certificate web app to pem
    format using the WLS der2pem utility
    4) I ran the Import utility
    java utils.ImportPrivateKey serverkey.jks store_pwd key_alias key_pwd combined.pem
    server_private_key.pem.
    I received the following error.
    ImportPrivateKey will create serverkey.jks
    ImportPrivateKey failed, java.security.KeyManagementException: ASN.1: Unxpected
    ASN.1 tag
    java.security.KeyManagementException: ASN.1: Unxpected ASN.1 tag
    at com.certicom.security.cert.internal.x509.SSLPlusSupport.getLocalIdentityPartial(Unknown
    Source)
    at com.certicom.net.ssl.CerticomContextWrapper.inputPrivateKey(Unknown
    Source)
    at utils.ImportPrivateKey.importKey(ImportPrivateKey.java:76)
    at utils.ImportPrivateKey.importKey(ImportPrivateKey.java:44)
    at utils.ImportPrivateKey.main(ImportPrivateKey.java:32)
    Does anyone have an idea where I went wrong? Can anyone offer an explanation?
    Thanks

    "Mallik" <[email protected]> wrote in message
    news:3f3274e9$[email protected]..
    >
    I am trying to install weblogic generated ssl certificate and because theprivate
    key needs to be encrypted with a password, i am loading this in a new JDKkeystore
    and trying to configure WL.
    I am running utils.CertGen from weblogic 7.0 sp3 on XP.
    X:\SSLTest>java utils.CertGen testpassword testcert testkey
    Creating Domestic Key Strength - 1024
    ..... Certificate CommonName will contain Hostname KUNDULA_M-DGS
    Encoding
    Try this on 8.1 and see if it works. There was a bug fix with respect to "_"
    in hostnames.

  • I am trying to highlight text on multiple pages, but Adobe will not autoscroll via cursor.

    I am trying to highlight text on multiple pages, but when I select the text and bring the cursor to the bottom of the screen Adobe does not advance the document. How do I make it so I can highlight from page to page without having to release the mouse button?
    Also, how do I get adobe to realize that there is a header and footer on each page, but the actual text in the file is in two columes. Is there a way to make this clear and embade it in the document so other programs recognize this too?

    Regarding your first question, change the view to Single Page Continuous.

  • PL/SQL block to create temporary table + load via cursor for loop

    Assume I have a table that contains a subset of data that I want to load into a temporary table within a cursor for-loop. Is it possible to have a single statement to create the table and load based on the results of the fetch?
    I was thinking something like:
    Declare CURSOR xyz is
    CREATE TABLE temp_table as
    select name, rank, serial number from
    HR table where rank = 'CAPTAIN'
    BEGIN
    OPEN xyz
    for name in xyz
    LOOP
    END LOOP
    What I see wrong with this is that the table would be created multiple times which is why this syntax is not acceptable. I'd prefer not to have to define the temporary table then load in two sepearte SQL statements and am hoping a single statement can be used.
    Thanks!

    What is the goal here?
    If you're just going to iterate over the rows that are returned in a cursor, a temporary table is unnecessary and only adds complexity. If you truly need a temporary table, you would declare it exactly once, at install time when you create all your other tables. You'd INSERT data into the temp table and the data would only be visible to the session that inserted it.
    Justin

  • Grouping Key Figures via Web item?

    Hi,
    in our webtemplates we would like to split the key figures (part of a structure) into two web items.
    Is it possible to split key figures, all part of one key figure structure, over two web items.
    Which webitem can handle this?
    Or does it require custom java(script)?
    Thanks and regards,
    Hans.

    Hi
    If I'm understanding your requirement correctly, what you could do is just use the standard analysis item. That item has a config value where you can specify which columns must be displayed.
    If you know which key figures you want displayed where, you can set those values.
    So, for the 1st analysis item you would display columns 1-5, and the 2nd analysis item would then show columns 6-15.
    I'll play around with this and see if I can get it working, altenately let me know if this answers your question already.
    Cheers,
    Andrew

  • Select schema via cursor

    I am working with a database in which all schemas have the same tables. I am trying to write a PL/SQL routine that will loop through each schema, query a table in that schema, and insert that data into a master table (simplified explanation). I can get a cursor that contains all the schemas, but I can't figure out how to set the schema name from a cursor.
    sample code ... (not working)
    declare
    cursor schemaCrsr is select SCHEMA_NAME from MASTER.SCHEMA_TABLE;
    begin
    for mySchemaCrsr in schemaCrsr loop
    insert into MASTER.TABLE_X
    select * from mySchemaCrsr.TABLE_X;
    end loop;
    end;
    What is the correct syntax for "mySchemaCrsr.TABLE_X" to enable this? Or is there another way to accomplish this?
    Thanks

    Chris,
    I'm using Oracle version 8.1.6 now, so I can't tell if this will work in Oracle version 7.3.4 or not, but I think I remember using something similar in Oracle version 8.0.5. Please try the code below and let us know if it works for you or not.
    Also, posting on this forum causes spaces to be added between concatenation symbols where they don't belong, so anywhere you see a space between | and |, remove the space, before running the code.
    Any time that you are using some sort of variable to represent a schema name or table name or column name at run time, you have to use some sort of dynamic sql. Execute immediate is a new type of dynamic sql. DBMS_SQL is an older method.
    Barbara
    DECLARE
    CURSOR schemacrsr
    IS
    SELECT schema_name
    FROM master.schema_table;
    cursor_name INTEGER;
    rows_inserted INTEGER;
    BEGIN
    FOR myschemacrsr IN schemacrsr
    LOOP
    cursor_name := DBMS_SQL.OPEN_CURSOR;
    DBMS_SQL.PARSE
    (cursor_name,
    'INSERT INTO master.table_x SELECT * FROM '
    &#0124; &#0124; myschemacrsr.schema_name
    &#0124; &#0124; '.table_x',
    DBMS_SQL.NATIVE);
    rows_inserted := DBMS_SQL.EXECUTE (cursor_name);
    DBMS_SQL.CLOSE_CURSOR (cursor_name);
    END LOOP;
    END;
    null

  • Getting Key Size via SSL Certificate

    Good Day,
    I am writing client server with SSL. I want to display certificate information for the client, so I am writing a popup window. I can't figure out how to get the size of the key used (in this case RSA). I want to display. for example.
    "RSA (1024)", much the way IE does.
    I know it must be in there somewhere.
    ... Roger
    p.s. if anyone knows of a canned X509Certificate display component, please point me. I am probably writing what others have written before.

    Here is getFormat() method of Key Interface :
         * Returns the name of the primary encoding format of this key,
         * or null if this key does not support encoding.
         * The primary encoding format is
         * named in terms of the appropriate ASN.1 data format, if an
         * ASN.1 specification for this key exists.
         * For example, the name of the ASN.1 data format for public
         * keys is <I>SubjectPublicKeyInfo</I>, as
         * defined by the X.509 standard; in this case, the returned format is
         * <code>"X.509"</code>. Similarly,
         * the name of the ASN.1 data format for private keys is
         * <I>PrivateKeyInfo</I>,
         * as defined by the PKCS #8 standard; in this case, the returned format is
         * <code>"PKCS#8"</code>.
         * @return the primary encoding format of the key.
         public String getFormat();
    And what is the instance type of this PublicKey ?
    This kind of object may have method undefine in the Interface.

  • Sun:Iterating the cursor ! Is this bad logic. i.e, using crs.next() method

    Hi friends,
    I have been using crs.next() method for comparing the given string in textbox and in database are equal. If they are equal then it must redirect to other page otherwise it must remain in the same page.
    Please tell me wheter it is bad logic or not.If it is bad logic then tell me the alternate one.
    Thanking you in Advance.

    Are you refering your code in:
    http://forum.java.sun.com/thread.jspa?threadID=5121734&tstart=75 ?
    I don't know about bad logic or not in using crs.next().
    But I am just curious why do you have to iterate the rowset when you can set a query criteria in the rowset? Suppose you have 100 records in your table, sure it is faster to use query criteria for that., execute the rowset, and then check whether the rowset contains a record or not.
    Another alternative is to use tableDataProvider.findFirst(), and then check the existence of the record. That if you use tableDataProvider instead of the rowset directly. (You may find it in JumpStartCycle sample project).
    Also instead of writing these lines:
    // set the rowset to use the Employee database
    rs.setDataSourceName("java:comp/env/jdbc/Employee");
    rs.setCommand("SELECT * FROM srni.EMPLOYEE");
    rs.setTableName("EMPLOYEE");in the login_action(), you may visually create the rowset() and put it in sessionbean.
    That is what I've found in JSC sample projects. In JumpStartCycles sample (you may create it via file-new projects-samples), there is a login.jsp which is quite similar to your login form. Not exactly the same, but the logic is the same.
    rgds

  • On HTC Desire with the HTC android 2.2 (froyo) rom, when typing a number or a punctuation sign using a long key press, the cursor stay in place instead of advancing and positioning itself at the end of what you type.

    Tested on login and password field (in sync settings). Other text input doesn't look like they have this problem. But I haven't run extensive tests.
    Well when I was trying to register my self in sync I came across this issue. This can be solved by flipping the phone on landscape mode.

    Thanks for the report! We were not aware of this problem before, but we will investigate it and work on fixing it.

Maybe you are looking for

  • How to create a OutPutText at RunTime?

    Hi everyone, I'm working with JDeveloper10.1.3, ADF Faces, JSP pages. This is my situation: When I navigate from page1 to page2, I need to create at RunTime as many as OutPutTexts as my recordset has. In the traditional way I would execute my query t

  • Downloaded photos from Canon 20D to iPod

    I was not able to get my 20D to downloard to my new iPod. It says unrecognized device. The iPod specs state that Apples Photo Reader Adapter ($35) works with the 20D but I couldn't get it to work. I tried another adapter at the store and got the same

  • JAAS: unclear doc on LoginContext.login()

    I'm having difficulty understanding some of the javadoc text for LoginContext.login(). Consider these three paragraphs: If the commit phase of the authentication process fails, then the overall authentication fails and this method invokes the abort m

  • Apache or IIS webserver better to be installed over JBOSS application  serv

    I want to integrate an application which runs on JBOSS, but there is no plocy agent for JBOSS. Thus which webserver will be apt to be installed overJboss, either IIS or Apache?

  • I'm getting mdmclient error that won't go away

    I restored my computer yesterday and it was working fine.  This morning after booting, I am now recieving an error messag that won't go away even when I click 'Ignore' Below are the details when I click 'Report...' Process:         mdmclient [2736] P