Synchronized {blocks} are not synchronized ?

Hi
I have a stored procedure containing a method with a synchronized block :
public class MyClass {
private static Connection conn;
public static void insert(String stringData) {
synchronized (conn) {
//LOGGING
Date startTime = new java.util.Date();
... some code ...
//LOGGING
Date stopTime = new java.util.Date();
}I suppose that when a lot of concurrent users wil use the stored procedure, the synchronized block of code will not be executed at the same time. But when I do that my log dates are overcrossing, that means concurrent execution.
How can I make this code really synchronized ??
thanks,
Xavier
null

radiatejava wrote:
You mentioned there could be some thread caching - can you pls explain why/how ? Since the threads are not accessing the variable directly and instead they are querying the object using a method, why would the method return some old value ? I understand in case of direct access to the variable, a thread can cache the variable. Do you mean to say that threads will also cache the methods ? Otherwise, how is it possible to return the stale value. I am not expecting a blind answer like XClass is not thread safe (I too agree to this) but some explanation on how caching is being done with method calls too.You are thinking of it in a wrong way. It doesn't matter if methods are cached or not, methods are just static code blocks. The important thing to understand is that all data can be cached unless it is volatile or synchronized. The integer "inside" XClass is data, and that data might get cached, so e.g. getVar can return the cached value. It doesn't need to read the value from main memory. The same applies to setVar, it doesn't need to update the value in main memory.

Similar Messages

  • Performance Point: Code blocks are not allowed in this file.

    Hi All,
    I'm trying to use Performance Point 2010 in Sharepoint 2010...
    I have start the application in centrel admin
    I have created a site collection based on the Bisuness Intelligence Center template
    I can surf the new Site Collection but when I try to open the "Start using PerformancePoint Services" link I get the following error:
    "An error occurred during the processing of /PerformancePoint/Pages/ppssample.aspx. Code blocks are not allowed in this file."
    is there any way to fix it???
    is there any good source to understand and deploy Performance Point 2010??
    thanks All
    Vit

    I have tried the above PageParserPath settings, however none seem to fix this problem for me.  Does anyone have another solution to this issue?
    I've tried...
    <PageParserPath VirtualPath="/Pages/ppssample.aspx"
    CompilationMode="Always" AllowServerSideScript="true" />
    <PageParserPath VirtualPath="/PerformancePoint/ppssample.aspx"
    CompilationMode="Always" AllowServerSideScript="true" />
    <PageParserPath VirtualPath="/mysitecollection/ppssample.aspx"
    CompilationMode="Always" AllowServerSideScript="true" />
    Help Please!!!

  • The values for list items of other data blocks are not getting displayed when executed.

    Hi,
        I have a new problem again.
        I am doing a new form in which there are around 8 blocks. All the blocks have their tables in the oracle database.
        Each block has 18 columns with the same column & column names. But the values in those columns are different & the values do not match.
        The problem lies while i execute the form, it populates only the first block data. Other blocks do not display or populate the values.
        I cannot create a master relationship because all the column values are different.
        How do i display or populate the values of all the tables?
       Please help me. Thank You.

    hi
    if your form has truly disassociated tables, then you could simply use a key-exeqry trigger at forms level to travel to each block in turn and perform an execute-query built-in, eventually returning to the starting block.
    ie
    go_block('..');
    execute_query;
    go_block('..');
    execute_query;
    etc
    go_item(......);
    In this case you would use the block where clause to constrain each table to the appropriate set.
    If however, the database has no relationships between the tables but the data content has some corelation, then you could craft a forms relation manually.
    cheers
    Rod

  • Configured assignment blocks are not coming on to WebUi

    Hi All,
               Recently we have upgraded from CRM 5.0 to CRM 7.0. In PRDIOOV component i have configured the assignment blocks which needs to be displayed in the WebUi. In the displayed list of assignment blocks around 10 assignment blocks are there.But if you look into the WebUi its displaying only 7 assignment block. I have checked in the personalization there also its having 7 ABs only. I have tried with choosing other cofiguration, for this also the problem is persisting. Please provide me the solution what exactly can be done to get all the 10 ABs into the WebUi.
    Regards,
    Lakshman.P

    Hi All,
    This issue is resolved. I have done the following steps to make the Z assignment block to be available in the Web Ui....
    1.I have created a Z Component and i have created a view with Z filelds in this Z component.
    2.I have added this in the overview view of the component PRDIOOV.
    3.I have adde this to the Overview in the view set in Runtime repository of the PRDIOOVcomponent
    4.Now the vew is avialble in the configuration and i have added this to the displayed list.
    5.Once this is done it should be displayed in the WEBUi but its not displaying in the WebUi. To resolve this I have made an entry in the table CRMC_PRIL_UIU by giving the
    Object Type -
    >S
    Object ID -
    >Obj Name
    BSP Application -
    > Zcomponent (Which i have created)
    View -
    >Zview (Which i have created)
    6.Once i have made an entry in the above mentioned table, My Z assignment block is displayed in the Web UI. With this my problem is solved........
    Regards,
    Lakshman.P

  • Items in the block are not refreshing

    Hi,
    I am having a master screen ,in which for a particular job_name there can be "N" version_no's .
    for 1 version_no it is having around 15 items.
    i am having a second screen, which will display all the version_no's for the job_name.
    if you select a particular version_no and press view details button,it will go back to the main screen and display the details of the version.
    my problem is it's not refreshing it's holding the version details that we entered while creating.
    for ex:
    if i select only 5 items in the query in version details button also it is displaying all the version details.
    in the view_details button i am having the following code.
    declare
         v_job_name chng_cntrl_job_dtls.job_name%type;
         v_job_version_no   chng_cntrl_job_dtls.job_version_no%type;
    begin
    -- message('inside when-button-pressed');     
      v_job_name := :CHNG_CNTRL_JOB_VERSIONS_VIEW.JOB_NAME;
      v_job_version_no := :CHNG_CNTRL_JOB_VERSIONS_VIEW.job_version_no;
      clear_block (no_validate);
      set_block_property( 'chng_cntrl_job_dtls', default_where, 'job_name=v_job_name and job_version_no=v_job_version_no' );
      go_block('chng_cntrl_job_dtls');
    SELECT  JOB_NAME              
                     ,LPAD(JOB_VERSION_NO,5,'0')        
                        ,TEXT                  
                        ,LAST_UPDATED_DATE     
                        ,USER_ID               
                        ,ACTIVATE_DATE        
                        ,SENT_DATE             
                        ,HR_FLAG     
    INTO
             :CHNG_CNTRL_JOB_DTLS.JOB_NAME              
                        ,:CHNG_CNTRL_JOB_DTLS.JOB_VERSION_NO        
                   ,:CHNG_CNTRL_JOB_DTLS.TEXT                  
                        ,:CHNG_CNTRL_JOB_DTLS.LAST_UPDATED_DATE     
                        ,:CHNG_CNTRL_JOB_DTLS.USER_ID               
                        ,:CHNG_CNTRL_JOB_DTLS.ACTIVATE_DATE         
                        ,:CHNG_CNTRL_JOB_DTLS.SENT_DATE             
                        ,:CHNG_CNTRL_JOB_DTLS.HR_FLAG 
    FROM CHNG_CNTRL_JOB_DTLS
    WHERE JOB_NAME = v_job_name
    AND JOB_VERSION_NO = v_job_version_no;
    exception
         when others then
         message('exception in when-button-pressed '||sqlerrm);
    end;Please advice.

    I'm a little confused by your code sample. Why are you setting the DEFAULT_WHE RE clause of the CHNG_CNTRL_JOB_DETLS block but you never execute a query; instead, you manually query one (1) record into the block after this?
    se t_block_property( 'chng_cntrl_job_dtls', default_wher e, 'job_name=v_job_name and job_version_no=v_job_version_no' );go_block('chng_cntrl_job_dtls');
    S ELECT JOB_NAME
    >
    Let Oracle Forms do the work for you! You've s et the DEFAULT_W HERE clause of the block - now use it and simply execute a query. Try the following:
    DECLARE
       v_job_name          chng_cntrl_job_dtls.job_name%type;
       v_job_version_no   chng_cntrl_job_dtls.job_version_no%type;
    BEGIN
       -- message('inside when-button-pressed');     
       v_job_name := :CHNG_CNTRL_JOB_VERSIONS_VIEW.JOB_NAME;
       v_job_version_no := :CHNG_CNTRL_JOB_VERSIONS_VIEW.job_version_no;
       clear_block (no_validate);
       se t_block_property( 'chng_cntrl_job_dtls', default_w here, 'job_name=v_job_name and job_version_no=v_job_version_no' );
       go_block('chng_cntrl_job_dtls');
       Execute_Query;
    EXCEPTION
       WHEN OTHER THEN
          message('exception in when-button-pressed '||sqlerrm);
    END;Hope this helps,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.
    Edited by: CraigB on Dec 2, 2010 8:37 AM

  • Change in master block record not cascading to detail record blocks

    Using Forms [32 Bit] Version 10.1.2.2.0 (Production)
    Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
    I am encountering the following problem in my form:
    I have a master block that has 2 associated detail blocks, one of which acts as a master block for another detail block:
    Master ---- Detail
             \__ Detail(master) ---- DetailThe first two detail blocks are joined to the master block on 3 fields, a date, a 10 digit code and a 5 digit code.
    The third detail block is joined to its master block by 4 fields, 2 dates, the 10 digit code and the 5 digit code.
    The problem I am encountering is when any of the fields that the blocks are joined on are updated in the master block (they don't show up in the form for the other blocks, it auto populates them) the detail blocks are not also updating and the records are being orphaned.
    So if my master block has the following data:
    January 1, 2009
    1234567890
    abcde
    And there are detail records matching this, but the master block changes too:
    January 1, 2009
    1234567890
    edcba
    Rather then the detail records being updated with this new 5 digit code, it shows up blank on the database as it cannot find detail records that match that new set of data. The records still exist in the table, but they are not updated when the master block is updated. Do i need to change the relation properties of the blocks?

    It is not a good practice to update the primary key values especially when those fields act as foreign keys.
    So it will be better to make those fields UPDATE_ALLOWED false.
    If that is an unavoidable condition, in the pre-update trigger of header block, write the update script to update those fields and re-query the detail
    Or
    in key-commit
    loop thru all the records in detail blk and assign values to those feilds and save it

  • Playlists are not synchronized

    Hi everyone
    I have this problem, the standard playlists i made on itunes (but is the same if i create on iphone or aTV) are not synchronized with other device, This don't happening with smart playlist, in this case work well.
    Any solution?
    I'm sorry for bad english, i hope you can understand my problem and help me to solve

    There's one difference between the correctly updated playlists and the ones that aren't: the first ones shows the number of songs in the list after the last song, but the second ones (those that are not fully synchronized) does not shows any number after last song.

  • Bookmarks are not synchronizing.

    I just have to give up and build my own browser.
    Yea bookmarks are not synchronizing. That's basically it. I'm tired of having to wait and hope for updates for things that should be a standard feature. I know there is a lot of magic behind a browser, but all i really need are the bookmarks i can open anywhere.

    Hi ebichuhamster,
    Not a problem. Come to think of it, Xmarks syncs across all browsers, but let's fix sync first. If you open the sync options on each of the devices that are set up on the new sync, please see this to verify each are on the new sync: [[How to update to the new Firefox Sync]], you can make sure "Bookmarks" are checked.
    And if they are select sync now if there was a change. For debugging, it is actually not plural: 'about:sync-log' and these have to be turned on. By default however you should not have to do this and they are turned off as to not take up space, but to enable logs: in 'about:config' change the settings referred to here: [https://wiki.mozilla.org/Services/Sync/Getting_Started#Debugging_Sync]

  • Reg : "Error multiple Receivers are not allowed for Synchronous calls"

    Hi All,
    Can somebody tell me why I am getting this error "Error multiple Receivers are not allowed for Synchronous calls" when I am using Synchronous Soap Request to WebService and the response from webservice is being sent to multiple receivers which are Business services based on Receiver determination condition(Services W/o Party).

    Hi , If you are simply looking up data (and not updating tables ) using RFC you can use RFC Lookup APIs to create a java mapping
    The source message has to be a RFC request message interface and target should be RFC response message interface.
    Also you can use three step mappings in a single interface mapping.
    1. from your request message to RFC request message mapping
    2. java mapping which will do the lookup and give you rfc response back
    3.rfc response to your target response mapping.
    PS: RFC lookup can be used if there are not may hierarchy in the RFC Response structure. (i.e. may be 3 or 4 level nesting permitted)
    To help you further
    The following is a link which gives you access to a ready made source code. you just need to compile it and create a jar and import the mapping in imported archive
    http://knowhowsapxi.synthasite.com/rfc-loolup.php
    Edited by: Progirl Progirl on Oct 31, 2008 1:33 PM

  • Some notes disappeared from iphone, and others are not synchronizing on ipad, mac, and iphone. What to do?

    Some notes disappeared from iphone, and others are not synchronizing on ipad, mac, and iphone. What to do?

    Hi, MPiaM.  
    Thank you for visiting Apple Support Communities.  
    I would need clarification on if you are experiencing an issue with syncing photos via iTunes or iCloud to provide a better answer.  However, here are a couple troubleshooting articles that cover both scenarios.    
    iTunes: Unable to sync photos
    http://support.apple.com/en-us/TS3697
    Get help using My Photo Stream
    http://support.apple.com/en-us/HT203511
    -Jason H.  

  • Birthdays before 1931 are not synchronized

    Hi everybody!
    When synchronizing my calendar and address book with with the iPod touch I noticed that birthdays before 1931 are not synchronized. The only work-around I could find so far is to manually change the birthday in the address book to a more recent year like 1945, to synch afterwards, and change it back to the original year.
    Since it is not unlikely to have persons born before 1931, I guess it is a bug. Does anyone have the same problem?

    All the really old people in my family have died, so I didn't notice this one.
    Glad it's fixed though - at the rate I'm going, I feel like I was born in 1906.

  • Team Collaboration: Change the Task attributes are not synchronized...

    Hello!
    I am sorry for my poor English.
    When you modify in the Team Collaboration the following Task attributes:
    Percentage of completion and Status of implementation,
    the changes are not synchronized with others tools (OBEO, Zimbra, Mozilla Sunbird).
    Change of Status of implementation of synchronized only in Mozilla Sunbird.
    Can anyone give an explanation or solution for this?
    P.S.
    The problem I found recently in 2.0.1.5. (I think that in earlier versions was the same)
    Patch set 2.0.1.6 does not eliminate this defect.

    The answer to my question is,
    I am stupid. I don't pay attention to the details.
    For clarification I did the following...
    class superclass{
      private Integer PIN = new Integer(100);
      // this is the part in my code that I forgot.
      protected Integer getSecretPin(){
        return PIN;
    class sub{
      sub me;
      public sub(){
        me = this;
      // Sneaky stuff
      public Integer getPIN(){
        return
          ((superclass)me).getSecretPin();
    }I was tracking down a bug and was writing some output debugging and THOUGHT that I had stumbled on a security thing. On further inspection into the superclass code I had really accessed a protected method. My compiler ignored the casting.
    Thanks to all for "Looking into it."
    Peace

  • Mail account folders are not synchronized

    Mail account folders are not synchronized. How do I do this?

    Ok Istart understing.
    There is an issue with icloud Drive, the part called "mail".
    I disabled that part and the rules created by experiment were gone.
    So I restored my synced rules and smart folders plist in the V2 Maildata folder and all were like before.
    So I tried to reactivate the iclodudrive mail part and the problem was again there. The smart folders where gone again and the rules were now mixed with the ones created by experiment.
    So I deactivate icloud mail option on my iphone and my ipad, and redone the restore the synched rules and smart folder.
    After that all seems to be fine.
    Now I have even reactivated the mail icloud option on iphone and ipad.
    I suppose is definitely a bug.
    I remember that my mac popped up some strange message saying there was a problem with icloud drive.
    I will notice if this happen again to see into the log what is telling for real as I suppose that is the cause that messes up my email.

  • HT1296 when connecting my Ipad on mac mini and launching Itunes, the "INFO" is not displayed and my calendar and contacts are not synchronized

    when connecting my Ipad on mac mini and launching Itunes, the "INFO" is not displayed and my calendar and contacts are not synchronized

    Thanks for your advice. However my private informations have nothing to do on a wandering cloud that floats on high over US vales and hills ( and credit to William WORDSWORTH for his poetry)

  • Hi, my iPhone 4S and another one within my family are not synchronizing correctly the adressbook.

    Hi out there, could anybody give me a hint please? Since one week our both iPhones 4S are not getting the changings in the adressbook on our iMAC. Even replacing the complete contacts on the phones does not help. A call to apple support just confirmed my steps before. All software of the latest versions (itunes, iPhone and iMac, but based on OSX 10.6.8). Switching the phones completely of, resetting them and so on, didn´t help either.
    Is there any hidden problem? Does Apple only force me to upgrade to Mountain Lion on my iMAC or to iCloud to overcome that problem without telling? I am using 10 Apple products now on the same ID, including Mac Books, 2 iPads and 2 iPods..... might that be a problem? I asked Apple, but they didn´t confirm.
    Thanks for any hints!
    Johannes

    Hi, When you download, a big app udate like Tom Tom The other Tom Tom maps will be still on iphone until new update is complete That i why you need a lot of space until old updates Delete. So you will need to delete Apps & photos to make space. How much Gig has your iphone 4 s got? Cheers Brian

Maybe you are looking for

  • HT1349 I can not run the scanner in my main user, but only the second user and the same thing with updating apps! Why is this happening???

    I can not run the scanner in my main user, but only the second user and the same thing with updating apps! Why is this happening???

  • BPM error after SP 14

    Hi, I have a strange problem. Since we upgrade to SP14 we have porblems with BPMs including a Message Switch like this example: SQLResponse./p1:MT_SQL_QUERY_response/StmName_response/row/VORGANGS_SCHLUESSEL = 300 on XI side everything works fine (tes

  • How to make 'Overall Limit' field as display only in ME22/ME22N

    Hi, I want to make the 'Overall Limit' field as display only in transation ME22/ME22N (only for Service Items). I can make the field display only for ALL Service Items by going to: SPRO u2013 IMG - Material Management - External Services Management -

  • Line-in problems

    I have a soundblaster x-fi extremegamer, and I have oss installed.  It works just fine, except for the line-in.  I'm not hearing external sources directed to my speakers.  I'm wondering if linux even knows I have a line-in, if I try to open the sound

  • UGA memory leak detected 1488

    Hi all, I am getting the following error in the database alert log. ORA-00600: internal error code, arguments: [729], [2216], [space leak], [], [], [], [], [] when checked the trace file in which the details are dumped. The error line says *** 2004-0