A question about insert?

if the two applications want to insert the same data into database at the same time? but I only expect one application execute successful.
how do I prevent insert the same data into database?

if the two applications want to insert the same data
into database at the same time? but I only expect one
application execute successful.
how do I prevent insert the same data into database?This is not an advanced language topic and the language is
barely English, but allright. Here goes;
To prevent the insertion of equivalent data into the same
database you should find out about your database's transaction
mechanisme (if it has one). If it doesn't you should look
into mutual exclusion points in your client code.
What I mean is, that you want to examine before you insert,
and do this inside a protected timewindow. This can be achieved
inside your database with the use of transactions, or it can
be achieved inside your client code (if you're the only client
to that database and both calls live inside the same JVM)
by synchronization.
in pseudo code:
static Object mutex = new Object();
synchronized (mutex) {
  Object[] result;
  result = sqlselect("select * from table where foo=bar;");
  if (result.length == 0) {
    sqlinsert("insert into table (foo="bar");");
}

Similar Messages

  • Question about inserting Sysdate (SQL)

    Hi all,
    I got a question about records insert when one of the fields is sysdate.
    I have to store several records representing a log, generated by the execution of a database package.
    Inside my package I wrote an internal procedure devoted to insert a record in my log table for each processing step I wanted to trace (I call this proc each time I want to record a certain step of my package).
    My log table structure is: PREC_LOGS(log_date DATE, log_message VARCHAR2(1000)), no constraints at all.
    Database ver. 8.1.7.1.0 - Production for VMS O.S.
    The 'problem' occurs when several records have the same sysdate (DD-MM-YYYY HH24:MI:SS). In this case, if I select log_date,log_message ... order by log_date, the list of records I get respects the sort condition, but when several records have the same sysdate (DD-MM-YYYY HH24:MI:SS), it doesn't respect the order of the steps theoretically inserted by the internal proc.
    Resault
    25-07-2002 11:10:20 ........ (date changed)
    25-07-2002 11:10:22 Loading data for order nr. 82364 (step 3)
    25-07-2002 11:10:22 Verifying order nr. 82364 (step 2)
    25-07-2002 11:10:22 Procedure started for order nr. 82364 (step 1)
    25-07-2002 11:10:22 Updating conditions for order nr. 82364 (step 4)
    25-07-2002 11:10:22 Procedure accomplished for order nr. 82364 (step 6)
    25-07-2002 11:10:22 Commit changes for order nr. 82364 (step 5)
    25-07-2002 11:10:24 ........ (date changed)
    Please ask for more detail if someone is interested in replying...I realize it's not a very clear explanation of my issue.
    Thanks, Marco

    Hi
    Add a field to the table that is that uses a sequence
    PREC_LOGS(log_id NUMBER(30),log_date DATE, log_message VARCHAR2(1000))
    Create a database sequence
    The insert statement now becomes something like
    INSERT INTO PREC_LOCS(log_id, log_date, log_message)
    VALUES (sequence_name.NEXTVAL, SYSDATE, 'Some message');
    Then order by the log_id when you do your select.
    Daniel

  • Question about insert date value from xml file

    I want insert value into table from xml file. Every time I inserted value of date type into the table, I got the unpasable error message as following:
    oracle.xml.sql.OracleXMLSQLException: Exception 'java.text.ParseException:Unpars
    eable date: "2000-04-19 00:00:00.0"' encountered during processing ROW element
    Thanks for anyone that can fix my problem or give me any suggestion.
    email: [email protected]

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by matmnwx:
    I want insert value into table from xml file. Every time I inserted value of date type into the table, I got the unpasable error message as following:
    oracle.xml.sql.OracleXMLSQLException: Exception 'java.text.ParseException:Unpars
    eable date: "2000-04-19 00:00:00.0"' encountered during processing ROW element
    Thanks for anyone that can fix my problem or give me any suggestion.
    email: [email protected]<HR></BLOCKQUOTE>
    Use:
    OracleXMLSave sav = new OracleXMLSave(conn,tabName);
    sav.setDateFormat(<hier the date format in the XML-File>);

  • Ole2 question about inserting document object in Word

    I thought I had it figured out but it doesn't seem to work. From a Oracle Forms 6i application, I want to insert an object(a file) in a word document as an icon.
    The vb code generated when I record the macro of inserting an object as an icon is:
    Selection.InlineShapes.AddOLEObject ClassType:="Word.Document.8", FileName _
    :="string defining the location of the file object", LinkToFile:=False _
    , DisplayAsIcon:=True, IconFileName:= _
    "C:\WINDOWS\Installer\{90110409-6000-11D3-8CFE-0050048383C9}\wordicon.exe" _
    , IconIndex:=1, IconLabel:= _
    "string defining the location of the file object"
    Using this I wrote the following code: ( I am leaving out the declaration of the ole2.obj_type and other variables)
    args := ole2.create_arglist;
    ole2.add_arg (args, 'string defining the location of the file object');
    hinlineshapes :=
    ole2.get_obj_property (hselection, 'InlineShapes');
    ole2.invoke (hinlineshapes
    ,'AddOLEObject'
    ,args
    ole2.destroy_arglist (args);
    holeformat := ole2.get_obj_property (hinlineshapes, 'OLEFormat');
    ole2.set_property (holeformat
    ,'ClassType'
    ,'Word.Document.8'
    ole2.set_property (holeformat
    ,'DisplayAsIcon'
    ,TRUE
    ole2.set_property (holeformat
    ,'IconLabel'
    ,'string defining the location of the file object'
    When I run the code I get the following message from MS Word:
    " This object was created in 'string defining the location of the file object'.
    This application is not available to open this object.
    Make sure the application is properly installed and that it has not deleted, moved or renamed."
    Can someone please help? Thanks in advance.

    Second, when it inserts the date, it makes it an "update automatically" date that updates to the current time every time I open the document
    Sure, that's because you specifically tell it to. Your script inserts a 'new field' which is analogous to Word's dynamic text objects (date, time, page number, etc.)
    Instead, what you want to do is insert an actual string of characters - sure, to you and I that string of characters might look like a date and time, but to Word it's nothing more than a series of characters.
    For that we can fall back on AppleScript's date features, specifically current date, like:
    tell application "Microsoft Word"
      tell selection
        type text text "Left message " & (current date as text)
      end tell
    end tell
    Note that current date as text returns a rather verbose form of the date. If that's too much for you there are alternate options, such as:
    short date string of (current date) & space & time string of (current date)
    which will look more like: "6/10/10 3:26:50 PM"
    But there is also a myriad of other ways (with seconds, without seconds, 12/24 hr, etc.) depending on what you want.
    Third, if possible, I would also like it to be in italics.
    I'll have to look at that one, unless someone else beats me to it.

  • Questions about using Bitlocker without TPM

    We currently use Bitlocker to encrypt our Windows 7 computers with TPM. Now we are looking at encrypting some Windows 7 computers without a TPM. I see how to change the group policy setting to allow Bitlocker without a TPM. I have looked at a lot of other
    threads and I have a few questions about how the Bitlocker without TPM works.
    1) I see a USB drive containing a key is required for Bitlocker configurations without a TPM, say the end user loses this USB drive, what are the recovery options for their computer? 
    This article seems to indicate that without the USB drive connected, you are unable to even access recovery options http://blogs.technet.com/b/hugofe/archive/2010/10/29/bitlocker-without-tpm.aspx
    We have recovery backed up to AD when Bitlocker is enabled, but how could we do this recovery on a computer on computer where it's USB is lost? Would we have to remove the HD itself and attach it to another computer to access?
    2) After enabling Bitlocker on a computer without a TPM and using the USB Drive for the key, is there a way to also add a PIN or password protection at bootup?

    Hi,
    Sorry for my dilatory reply, 
    Configuring a startup key is another method to enable a higher level of security with the TPM. The startup key is a key stored on a USB flash drive, and the USB flash drive must be inserted every time the computer starts. The startup key is used to provide
    another factor of authentication in conjunction with TPM authentication. To use a USB flash drive as a startup key, the USB flash drive must be formatted by using the NTFS, FAT, or FAT32 file system.
    You must have a startup key to use BitLocker on a non-TPM computer.
    From: http://technet.microsoft.com/de-de/library/ee449438(v=ws.10).aspx#BKMK_Key
    For more Q&A about BitLocker, you can refer to the link above.
    hope this is helpful.
    Roger Lu
    TechNet Community Support

  • Two questions about SG300 DHCP server

    Hi,
    I have two questions about the DHCP server on the SG300:
    On the Address Binding page, what does the "Declined" state mean? I have a NAS device that won't pull an address, and I think that the entry with a state of "Declined" corresponds to this device. It was previously pulling an address from a RV180, so the only difference is that it is now connected to the SG300. I worked around this by manually setting the address on the NAS device, but this won't scale if I run into a lot of other devices that can't pull an address.
    I configured a static address binding for a WAP321 and found that instead of pulling the configured address that it pulled a dynamic address. I checked the Address Binding page and see that the dynamic entry that corresponds with the WAP321 has a Client Identifier rather than a MAC address. I changed the static entry for the WAP321 to use the client identifier displayed in the dynamic entry, and now the WAP321 pulls the configured static address. Is this expected behavior?
    Thanks,
    Bob

    With the SX300/500 it is required the client identifier, it doesn't automatically insert it. If static DHCP is made on the switch and you didn't need client identifier, that is more or less fortunate behavior for you
    So to answer this question, the expected behavior is to configure client identifier for static DHCP entry.
    -Tom
    Please mark answered for helpful posts
    http://blogs.cisco.com/smallbusiness/

  • Question about the Documentat​ion Tags for Source Code

    Hello,
    I have a question about CVI's automatic source code documentation. My problem is that is seems like you need to write all documentation for a specific tag on one line. If you don't, a line break will be inserted when the documentation is displayed. Suppose I want to write a large amount of documentation for the function itself, using the HIFN tag. If I don't want linebreaks to be forced in the documentation, I need to write all this documentation on one single line, which kinda messes up my code. If I split the documentation over several HIFN tags, the documentation displayed to the user might look messed up because of all the linebreaks. Is there any escape character I can put at the end of a line, allowing me to split the documentation of several HIFN lines without forcing linebreaks in the documentation?
    Thanks!
    GEMIDIS - Innovating Display Technology
    HQ Ghent, Belgium

    This information is certainly useful. Note, however, that it can also be found in the documentation
    Tag
    Description
    /// HIFN help text
    Specifies the help text for the function. Use multiple /// HIFN tags to display help text for the function on separate lines. To separate help text with an empty line, use /// HIFN on a line by itself. You also can use HTML tags, but you must enclose the tags in <HTML><BODY></BODY></HTML> tags.
    Example
    /// HIFN SampleFunction returns the value of a control.
    int SampleFunction (int controlID, ctrlType controlType, char label[], double *value)
         SomeAction;

  • Few questions about apex + epg and cookie blocked by IE6

    Hi,
    I would like to ask a few questions about apex and epg.
    I have already installed and configured apex 3.2 on oracle 10g (on my localhost - computer name 'chen_rong', ip address -192.168.88.175 ), and enable anonymous access xdb http server.
    now,
    1. I can access 'http://chen_rong' , 'http://localhost' , 'http://192.168.88.175' without input username / password for realm 'XDB' in IE6;
    2. I can access 'http://localhost/apex/apex_admin' , 'http://192.168.88.175/apex/apex_admin' , and I can be redirected into apex administation page after input admin/<my apex admin password> for realm 'APEX' in IE6;
    3. I can access 'http://chen_rong/apex/apex_admin' in IE6, but after input admin/password , I can not be redirected into administation page, because the cookie was blocked by IE6.
    then, the first question is :
    Q1: What is the difference among 'http://chen_rong' , 'http://localhost' , 'http://192.168.88.175' ? I have already include site 'chen_rong' into my trusted stes! why the cookie was blocked by IE6. I have already tried firefox and google browser, both of them were ok for 'chen_rong', no cookie blocked from site 'chen_rong'!
    and,
    1. I have tried to use the script in attachment to test http authentication and also want to catch the cookie by utl_http .
    2. please review the script for me.
    3. I did:
    SQL> exec show_url('http://localhost/apex/apex_admin/','ADMIN','Passw0rd');
    HTTP response status code: 401
    HTTP response reason phrase: Unauthorized
    Please supplied the required Basic authentication username/password for realm XDB for the Web page.
    Web page http://localhost/apex/apex_admin/ is protected.
    MS-Author-Via: DAV
    DAV: 1,2,<http://www.oracle.com/xdb/webdav/props>
    Server: Oracle XML DB/Oracle Database
    WWW-Authenticate: Basic realm="XDB"
    Date: Tue, 04 Aug 2009 02:25:15 GMT
    Content-Type: text/html; charset=GBK
    Content-Length: 147
    ======================================
    PL/SQL procedure successfully completed
    4. I also did :
    SQL> exec show_url('http://localhost/apex/apex_admin/','ANONYMOUS','ANONYMOUS');
    HTTP response status code: 500
    HTTP response reason phrase: Internal Server Error
    Check if the Web site is up.
    PL/SQL procedure successfully completed
    SQL> exec show_url('http://localhost/apex/apex_admin/','SYSTEM','apexsite');
    HTTP response status code: 401
    HTTP response reason phrase: Unauthorized
    Please supplied the required Basic authentication username/password for realm APEX for the Web page.
    Web page http://localhost/apex/apex_admin/ is protected.
    Content-Type: text/html
    Content-Length: 147
    WWW-Authenticate: Basic realm="APEX"
    ======================================
    PL/SQL procedure successfully completed
    my second questions is :
    Q2: After I entered into realm 'XDB', I still need went into realm'APEX'. how could I change the script show_url to accomplish these two tasks and successfully get the cookie from site.
    the show_url script is as following:
    CREATE OR REPLACE PROCEDURE show_url
    (url IN VARCHAR2,
    username IN VARCHAR2 DEFAULT NULL,
    password IN VARCHAR2 DEFAULT NULL)
    AS
    req UTL_HTTP.REQ;
    resp UTL_HTTP.RESP;
    name VARCHAR2(256);
    value VARCHAR2(1024);
    data VARCHAR2(255);
    my_scheme VARCHAR2(256);
    my_realm VARCHAR2(256);
    my_proxy BOOLEAN;
    cookies UTL_HTTP.COOKIE_TABLE;
    secure VARCHAR2(1);
    BEGIN
    -- When going through a firewall, pass requests through this host.
    -- Specify sites inside the firewall that don't need the proxy host.
    -- UTL_HTTP.SET_PROXY('proxy.example.com', 'corp.example.com');
    -- Ask UTL_HTTP not to raise an exception for 4xx and 5xx status codes,
    -- rather than just returning the text of the error page.
    UTL_HTTP.SET_RESPONSE_ERROR_CHECK(FALSE);
    -- Begin retrieving this Web page.
    req := UTL_HTTP.BEGIN_REQUEST(url);
    -- Identify yourself.
    -- Some sites serve special pages for particular browsers.
    UTL_HTTP.SET_HEADER(req, 'User-Agent', 'Mozilla/4.0');
    -- Specify user ID and password for pages that require them.
    IF (username IS NOT NULL) THEN
    UTL_HTTP.SET_AUTHENTICATION(req, username, password, 'Basic', false);
    END IF;
    -- Start receiving the HTML text.
    resp := UTL_HTTP.GET_RESPONSE(req);
    -- Show status codes and reason phrase of response.
    DBMS_OUTPUT.PUT_LINE('HTTP response status code: ' || resp.status_code);
    DBMS_OUTPUT.PUT_LINE
    ('HTTP response reason phrase: ' || resp.reason_phrase);
    -- Look for client-side error and report it.
    IF (resp.status_code >= 400) AND (resp.status_code <= 499) THEN
    -- Detect whether page is password protected
    -- and you didn't supply the right authorization.
    IF (resp.status_code = UTL_HTTP.HTTP_UNAUTHORIZED) THEN
    UTL_HTTP.GET_AUTHENTICATION(resp, my_scheme, my_realm, my_proxy);
    IF (my_proxy) THEN
    DBMS_OUTPUT.PUT_LINE('Web proxy server is protected.');
    DBMS_OUTPUT.PUT('Please supply the required ' || my_scheme ||
    ' authentication username/password for realm ' || my_realm ||
    ' for the proxy server.');
    ELSE
    DBMS_OUTPUT.PUT_LINE('Please supplied the required ' || my_scheme ||
    ' authentication username/password for realm ' || my_realm ||
    ' for the Web page.');
    DBMS_OUTPUT.PUT_LINE('Web page ' || url || ' is protected.');
    END IF;
    ELSE
    DBMS_OUTPUT.PUT_LINE('Check the URL.');
    END IF;
    -- UTL_HTTP.END_RESPONSE(resp);
    -- RETURN;
    -- Look for server-side error and report it.
    ELSIF (resp.status_code >= 500) AND (resp.status_code <= 599) THEN
    DBMS_OUTPUT.PUT_LINE('Check if the Web site is up.');
    UTL_HTTP.END_RESPONSE(resp);
    RETURN;
    END IF;
    -- HTTP header lines contain information about cookies, character sets,
    -- and other data that client and server can use to customize each
    -- session.
    FOR i IN 1..UTL_HTTP.GET_HEADER_COUNT(resp) LOOP
    UTL_HTTP.GET_HEADER(resp, i, name, value);
    DBMS_OUTPUT.PUT_LINE(name || ': ' || value);
    END LOOP;
    -- Read lines until none are left and an exception is raised.
    --LOOP
    -- UTL_HTTP.READ_LINE(resp, value);
    -- DBMS_OUTPUT.PUT_LINE(value);
    --END LOOP;
    UTL_HTTP.GET_COOKIES(cookies);
    dbms_output.put_line('======================================');
    FOR i in 1..cookies.count LOOP
    IF (cookies(i).secure) THEN
    secure := 'Y';
    ELSE
    secure := 'N';
    END IF;
    -- INSERT INTO my_cookies
    -- VALUES (my_session_id, cookies(i).name, cookies(i).value,
    -- cookies(i).domain,
    -- cookies(i).expire, cookies(i).path, secure, cookies(i).version);
    dbms_output.put_line('site:'||url);
    dbms_output.put_line('cookies:');
    dbms_output.put_line('name:'||cookies(i).name);
    dbms_output.put_line('value:'||cookies(i).value);
    dbms_output.put_line('domain:'||cookies(i).domain);
    dbms_output.put_line('expire:'||cookies(i).expire);
    dbms_output.put_line('path:'||cookies(i).path);
    dbms_output.put_line('secure:'||secure);
    dbms_output.put_line('version:'||cookies(i).version);
    END LOOP;
    UTL_HTTP.END_RESPONSE(resp);
    EXCEPTION
    WHEN UTL_HTTP.END_OF_BODY THEN
    UTL_HTTP.END_RESPONSE(resp);
    END;
    /

    I use oracle database enterprise edtion 10.2.0.3. I have already figured out the epg on 10.2.0.3 to support apex 3.2.
    And as I described above, the apex site works fine for ip address , and localhost. but the cookie will be blocked by IE6, if I want to access the site by 'http://computername:port/apex/apex_admin'. This problem does not occured in firefox and google browser. Could someone give me answer?

  • Important conceptual question about Application Module, Maximum Pool Size

    Hello everyone,
    We have a critical question about the Application Module default settings (taking the DB connections from a DataSource)
    I know that on the Web it is generally suggested that each request must end with either a commit or rollback when executing PL/SQL blocks "directly" on the DB without the framework BC/ViewObject/Entity service intervention.
    Now, for some reasons, we started to develop our applications with thinking that each Web Session would reference exactly one DB session (opened by any instance taken from the AM pool) for the whole duration of the session, so that the changes made by each Web session to its DB session would never interfere with the changes made by "other" Web Sessions to "other" DB sessions .
    In other words, because of that convincement we often implemented sort of "transactions" that open and close (with either commit or rollback) each DB session not in/after a single HTTP request, but during many HTTP Requests.
    As a concrete example think of this scenario:
    1. the user presses the "Insert" button. An HTTP request is fired. The action listener is executed and ends up with inserting rows in a table via a PL SQL block (not via the ViewObjects API).
    2. no commit or rollback after the above PL/SQL block is done yet.
    3. finally the user presses a "Commit" or "Rollback" button, firing the call to the appropriate AM methos.
    Those three requests consist of what I called "transaction".
    From the documentation it's clear that there is no guarantee that the couple AM istance + DB session is the same during all the requests.
    This means that, during step 2, it's possible that another user might reference the same "pending" AM/DbSession for his needs and "steal" somehow the work done via PL/SQL after step 1. (This happens because sessions taken by the pool are always rolled back by default.)
    Now my question is:
    Suppose we set the "Maximum Pool Size" parameter to very a great number (always inferior to the maximum number of concurrent users):
    Is there any guarantee that all the requests will be isolated in that case?
    I hope the problem is clear.
    Let me know if you want more details.

    Thanks for the answers.
    If I am right, from all your answers about resource avaiability, this means that even supposing the framework is able to always give us the same AM instance back from the AM pool (by following the session-affinity criterias), there is, however, no "connection affinity" with the connections from the DataSource. This means that the "same AM instance" might take the "a new DB connection", if necessary, from the connection pool of the DataSource. If that happens, that could give us the same problems as taking "a new AM instance" (that is, not following session-affinity) from the beginning, since each time an a new connection is taken (either via a new AM instance or via the same AM instance plus a new DB connection), the corresponding DB session is rolle back by default, clearing all the pending transactions we might have performed before with direct PL/SQL calls bypassing the AM services during the life cycle of our application, so that the new HTTP request will have a clean DB session to start to work with.

  • HT4972 Good afternoon! I addressed in the AT&T company with a question about untying of a sim card of AT&T from my iPhone, all of them made Iphone now is unlocked, I executed all points which were written: To complete the unlock, simply  1 . Open iTunes o

    Good afternoon! I addressed in the AT&T company with a question about untying of a sim card of AT&T from my iPhone, all of them made Iphone now is unlocked, I executed all points which were written:
    To complete the unlock, simply
    1 . Open iTunes on your Mac or PC and verify that you have Internet connectivity.
    2 . Ensure a SIM card is inserted into your iPhone.
    3 . Connect your iPhone using the dock connector to USB cable that came with your iPhone.
    4 . Backup and restore your iPhone using iTunes. For information on backup and restore, please visit http://support.apple.com/kb/HT1414.
    5 . After restoring, your iPhone will be unlocked.
    Additional information on unlocking can be found at http://support.apple.com/kb/TS3198
    I made everything as well as was written, but on completion of the ios 6.1.3 installation the iPhone asks to be activated through wifi or through a wire to the computer.
    I connected Iphone to the computer and the text takes off: (Were sorry, we are unable to continue with your activation at this time. Please TR again later, or contact customer care! )
    how to me to activate my iPhone?
    I hope for your help....

    Hey APPLELovestory,
    We have an article that goes over troubleshooting iPhone activation issues here:
    iPhone: Troubleshooting activation issues
    http://support.apple.com/kb/TS3424
    Perform the following steps:
    Restart the iPhone.
    Try another means of reaching the activation server and attempt to activate.
    Try connecting to Wi-Fi if you're unable to activate using a cellular data connection.
    Try connecting to iTunes if you're unable to activate using Wi-Fi.
    Restore the iPhone.
    If you receive an alert message when you attempt to activate your iPhone, try to place the iPhone in recovery mode and perform a restore. If you're still unable to complete the setup assistant due to an activation error, contact Apple for assistance.
    Hope that helps,
    David

  • Question about LRU in a replicated cache

    Hi Tangosol,
    I have a question about how the LRU eviction policy works in a replicated cache that uses a local cache for its backing map. My cache config looks like this:
    <replicated-scheme>
    <scheme-name>local-repl-scheme</scheme-name>
    <backing-map-scheme>
    <local-scheme>
    <scheme-ref>base-local-scheme</scheme-ref>
    </local-scheme>
    </backing-map-scheme>
    </replicated-scheme>
    <local-scheme>
    <scheme-name>base-local-scheme</scheme-name>
    <eviction-policy>LRU</eviction-policy>
    <high-units>50</high-units>
    <low-units>20</low-units>
    <expiry-delay/>
    <flush-delay/>
    </local-scheme>
    My test code does the following:
    1. Inserts 50 entries into the cache
    2. Checks to see that the cache size is 50
    3. Inserts 1 additional entry (as I understand it, this should cause the eviction logic to kick-in)
    4. Checks the cache size again, expecting it to now be 20
    With HYBRID and LFU eviction policies, the above logic works exactly as expected. When I switch to LRU however, the code at step 2 always returns a value significantly less than 50. All 50 inserts appear to complete successfully, so I can only assume that some of the entries have already been evicted by the time I get to step 2.
    Any thoughts?
    Thanks.
    Pete L.
    Addendum:
    As usual, in attempting to boil this issue down to its essential elements, I left out some details that turned out to be important. The logic that causes the condition to occur looks more like:
    1. Loop 2 times:
    2. Create named cache instance "TestReplCache"
    3. Insert 50 cache entries
    4. Verify that cache size == 50
    5. Insert 1 additional entry
    6. Verify that cache size == 20
    7. call cache.release()
    8. End Loop
    With this logic, the problem occurs on the second pass of the loop. Step 4 reports a cache size of < 50. This happens with LRU, LFU, and HYBRID-- so my initial characterization of this problem is incorrect. The salient details appear to be that I am using the same cache name each pass of the loop and that I am calling release() at the end of the loop. (If I call destroy() instead, all works as expected.)
    So... my revised question(s) would be: is this behavior expected? Is calling destroy() my only recourse?
    Message was edited by: planeski

    Robert,
    Attached are my sample code and cache config files. The code is a bit contrived-- it's extracted from a JUnit test case. Typically, we wouldn't re-use the same cache name in this way. What caught my eye however, was the fact that this same test case does not exhibit this behavior when running against a local cache directly (as opposed to a repl cache backed by a local cache.)
    Why call release? Well, again, when running this same test case against a local cache, you have to call release or it won't work. I figured the same applied to a repl cache backed by a local cache.
    Now that I understand this is more a byproduct of how my unit tests are written and not an issue with LRU eviction (as I originally thought), it's not a big deal-- more of a curiosity than a problem.
    Pete L.<br><br> <b> Attachment: </b><br>coherence-cache-config.xml <br> (*To use this attachment you will need to rename 545.bin to coherence-cache-config.xml after the download is complete.)<br><br> <b> Attachment: </b><br>LruTest.java <br> (*To use this attachment you will need to rename 546.bin to LruTest.java after the download is complete.)

  • Questions about OLE containers

    Hello,
    I try to use an OLE container for save any type of documents, the majority are Microsoft Word (*.doc), Acrobat Reader (*.pdf) and images (*.jpeg, *.jpg, *.bmp, ...)
    I prove to insert a document an save it in the database and all works fine. The document is saved in a BLOB column, and if I try to activate the OLE container I view the document correctly, but I have questions about OLE container:
    1.- Once I saved the document into the database (the icon of the document is shown into the OLE container), if I query the database to retrieve the documents, the OLE container not shown the icon of the document, and if I try to activate the OLE container, making double-click, it doesn't make anything.
    I think that the query to the database don't retrieve correctly the documents into the OLE container.
    2.- Once I saved the document into the database (the icon of the document is shown into the OLE container), if I try to activate the OLE container, depend the document I need to do twice double-click to open the document.
    If I try to open a Word document (*.doc) it need one double-click to activate, but if I try to open an Acrobat document (*.pdf) it need twice double-click to activate.
    Why? How can I open any type of documents with one double-click?
    3.- The form that I develop will work in client-server and in web mode.
    The problem is that if I try to run the form into web mode with OLE container, I have an error:
    "FRM-92100: Se ha interrumpido la conexión con el Servidor. Puede ser el resultado de un error de red o fallo en el Servidor. Debe reestablecer la conexión", and if I click in Details I have "Java Exception: java.lang.ArrayIndexOutOfBoundsException ...".
    If I delete the OLE item, it works fine, and I don't have any errors.
    I know that OLE container doesn't works in web mode, because this I will develop this functionality with JavaBean, but I would like that in client-server mode works with OLE container.
    There are any way to do this, that in web mode doesn't has this error, and in client-server mode works with OLE container?
    Thank you very much
    Jordi

    2. If you use Time Machine you can't browse those pictures on the Movable DIsk. It's not designed to work like that.
    3. Don't use copy and paste, try drag and drop instead.
    You don't tell us how you are managing these photos. I suggest that you use an app that will do incremental back ups. This is a very good way to work. The first time you run the back up the app will make a complete copy of the everything. Thereafter it will update the back up with the changes you have made. That makes subsequent back ups much faster. Many of these apps also have scheduling capabilities: So set it up and it will do the back up automatically.
    Example of such apps: Chronosync - but there are many others. Search on MacUpdate or the App Store

  • Question about sql batch process in java app

    hi all
    i have few questions about using batch process in the java.sql package. the addBatch method can take sql statements like inserts or updates. can we use a mixture of insert and update then? can we use prepared statement for this? it's just for performance consideration. thanks in advance.

    hi all
    i have few questions about using batch process in the
    java.sql package. the addBatch method can take sql
    statements like inserts or updates. addBatch() is a method that has no parameters. It doesn't 'add' sql statements.
    can we use a
    mixture of insert and update then? can we use
    prepared statement for this? it's just for
    performance consideration. thanks in advance.The point of batching is that you take something that is invariant and then 'add' a variant part.
    Thus a single insert has an invariant part (the table and specific columns) and a variant part (the data for each row by column.)
    You can use anything that is valid SQL (for jdbc, driver, database) and use it presuming your database allows that particular usage in batching. But that does require some regular pattern - it won't work if your usage is random. Nor will it work if some statements need to be executed only some of the time. Finally also note that transaction processing will often require smaller chunks - you can't insert a million rows in one batch.

  • Question about function with in parameters

    Hello,
    I have a question about functions with in-parameters. In the HR schema, I need to get the minimum salary of the job_id that is mentioned as an in-parameter.
    this is what I am thinking but I dont know if it's correct or not or what should I do next!
    create or replace function get_minimum_salary (i_job_id in varchar2)
    return number
    as
    begin
    SELECT min_salary INTO min_sal
    FROM jobs
    where job_id = get_minimum_salary(xy);
    RETURN i_job_id;
    end get_minimum_salary;
    thanks in advance
    EDIT
    Thanks for your help all.
    Is it possible to add that if the i_job_id which is the in type parameter does not have a minimum salary then use the following function to register an error:
    create or replace procedure insert_error (i_error_code in number,
                                                      i_error_message in varchar2)
    as
    begin
    insert into error_table (error_user, error_date, error_code, error_message)
    values (user,sysdate,i_error_code,i_error_message);
    end insert_error;
    This function is basically to say that an error has occured and to register that error, at the same time I need to print out the error using the dbms_out.put_line.
    Any ideas of how to do that?
    Thanks again
    Edited by: Latvian83 on Jun 1, 2011 5:14 AM

    HI
    I have made little bit changes in ur code. try this
    create or replace function get_minimum_salary (i_job_id in varchar2)
    return number
    as
    v_Min_sal jobs.salary%type=0;---- Variable declaration
    begin
    SELECT min_salary INTO v_ min_sal
    FROM jobs
    where job_id = i_job_id;
    RETURN v_Min_sal;
    end get_minimum_salary;
    Regards
    Srikkanth.M

  • Question about table compression

    I administer several 10g databases, and have been asked to compress tables in several tablespaces. I am unfamiliar with using compression. I have read some Oracle documentation on the ALTER TABLE... MOVE COMPRESSION command, but still have several questions. Can anyone recommend a good white paper, or other documentation on how best to compress tables with existing data? Thank you in advance for your guidance!

    Basically, I have questions about how to select which tables will benefit from compression. I also read somewhere that, once a table has been compressed, new updates to the compressed data will not be compressed and so I will need to re-compress the tables periodically.
    I also needed to know if the ALTER TABLE statement will compress the existing data or just future inserted data. Through further research I found that by using the MOVE clause, it will compress the existing data. I will also need to rebuild the indexes once the ALTER TABLE statement is complete.
    Thank you for your help and encouragement!

Maybe you are looking for

  • Select List problem

    I have 3 select lists: the first two are with submit and the last one is just select list. Each list depends on the previous one. I have set null and default values for each list. The problem occurs when I first start the application, but after selec

  • Play Streaming Audio

    I'm busy designing an app to play audio from a link. The audio is being streamed by a Shoutcast server. The link I have been given is 'http://live.rmr.ru.ac.za'. I've got the following code so far:     // Read sampled audio data from the specified UR

  • DupeDrivertool.ps1 - How to output to file?

    I have tried Out-File and  Export-CSV. All I get is a zero byte file.

  • Display tweets in AIR for Android app. How ?

    Hello, Can i display my tweets in flash using AS3 and How ?! Regards,

  • Param for `db_recover`

    Hello, Maybe Oracle could add a command-line parameter to `db_recover`. The parameter should specify the logging region size. Because it is quite nasty, that db_recover tells you to run db_recover. I always have to patch "db_reocver.c". The error mes