Proble with synchronization

I hvae seen some where the follwing question
Given:
public class NamedCounter {
private final String name;
private int count;
public NamedCounter(String name) { this.name = name; }
public String getName() { return name; }
public void increment() { coount++; }
public int getCount() { return count; }
public void reset() { count = 0; }
Which three changes should be made to adapt this class to be used
safely by multiple threads? (Choose three.)
A. declare reset() using the synchronized keyword
B. declare getName() using the synchronized keyword
C. declare getCount() using the synchronized keyword
D. declare the constructor using the synchronized keyword
E. declare increment() using the synchronized keyword
ANS :-   ACE
Problem :- I have a doubt with the oprion c, it simply returns the value of count then why synchronized the getCount() function, mostly we synchronized the function which changes the value of variable.
Edited by: rahul_p on Jun 4, 2008 10:51 PM

rahul_p wrote:
Problem :- I have a doubt with the oprion c, it simply returns the value of count then why synchronized the getCount() function, mostly we synchronized the function which changes the value of variable.In terms of concurrency and getting a valid value, no syncing is needed on the getter. (This would not be true if it were a long.)
However, even though it's "safe", in that the getter cannot read corrupt data, it can read stale data. Since each thread is allowed to keep a local copy of shared variables, it's entirely possible that after one thread writes a new value to count, no other thread will ever read that value. Entry to and exit from a sync block or method forces a reconciliation between the thread's local copy and the main copy.

Similar Messages

  • HT201263 I am not able to restore neither from iTunes nor from iCloud. The proble with iTunes is it says that the backup is corrupted or incompatible. And I am not able to connect to iCloud for restoring. I have IOS 7.0.4 when I have taken the backup.

    I am not able to restore neither from iTunes nor from iCloud. The proble with iTunes is it says that the backup is corrupted or incompatible. And I am not able to connect to iCloud for restoring. I have IOS 7.0.4 when I have taken the backup.
    iCloud does not connect and it says Request Timed out.
    Not Sure how to restore my iPad.
    Please help!!
    Thanks

    my problem is with I cloud not iTunes what's up with apple haven't they got the brains to sort out this prob, that they have to let the "community " know instead of helping to fix the problem without having to go through all the hassle of signing in writing a small blog & then leaving it until someone bored with time to write their blog to at some point fix the prob or not ! oh nearly forgot my prob like
    HRESULT:0X80070570 no clear explanation as to what this means or why in plain English for the not techno phoebes

  • Java app connected to Lite (w/JDBC) on WinCE with Synchronization?

    Anyone already tried to connect a java application to Oracle 9i
    Lite using JDBC on PocketPC (Windows CE 3.0) with
    synchronization to Oracle database?
    I'm trying do it but I'm having problems starting just in jdbc
    driver...
    I'll appreciate any share of information...
    thx.
    psalazar

    Exactly! Oracle docs say that jdbc and jac aren't supported in
    Lite release 5.0 (the same was in 4.0), but they put a jar and
    dll file in the bag. Why...? probably they're trying to release
    a stable version...?!
    Yes, when we try to use the jdbc driver there is
    an "UnsastifiedLinkError: no oljdbc40 in shared library path",
    but I just don't know if is a problem from Oracle or SUN since
    personaljava 1.1 is beta for Strong ARM (iPaq).
    So, if I can't use Java, I tried another solution: embedded VB
    (yes, it's nightmare!). I have no problem make a connection with
    ADOCE, but I couldn't do a synchronization: I just don't know
    how to do it in VB!!
    There is a final attempt: embedded VC++ (another nightmare...:( )
    There isn't many docs about how to make a OKAPI connection (or
    else)... I'm just trying to see samples (ODBC sample,
    ConsolidatorClient) but I just can't build any sample or test
    application.
    Anyone already made a synchronization on a pocketpc or something
    like that?
    thanks.
    psalazar

  • Problems with synchronizations items and partners

    Hi,
    I have problems with synchronizations from SAP B1 to SAP E-
    commerce 5.9.6
    When I run Synch. manager, there are some error messages in Synchlog
    and some items and business partners are synchronized and some not
    synchronized.
    Error messages:
    1)
    Completed account list synch with unhandled error:object reference not set to an instance of an object.
    2)
    Completed parts list synch with unhandled error:
    object reference not set to an instance of an object.
    at NetPoint.SynchSBO.SBOObjects.SBOItem.SBOToNetPoint()
    at NetPoint.SynchSBO.SBOObjects.SBOItem.SynchItemList()
    at NetPoint.SynchSBO.Synch.SynchPartList()
    Thanks,
    Milos Vich

    Hi Milos,
    If nothing at all has synchronized, I would first double check your connection settings and passwords.
    If the synch appears to to be connecting correctly, you will need to look at the data that it is failing on.
    The synch queue is the prx_transaction_queue table in the Business One database.  The object_type column refers to a Business One object.  2 for business partner and 4 for items.  The list_of_cols_val_tab_del is the key in the associated table.  For business partners that is OCRD.CardCode and items OITM.ItemCode.
    First determine that there is no bad data in the queue.  Bad data is typically defined as null or empty strings in the list_of_cols_val_tab_del column.
    Try running the following for business partners:
    select *
    from prx_transaction_queue
    where object_type = 2 and (list_of_cols_val_tab_del is null or list_of_cols_val_tab_del = '')
    And this for Items.
    select *
    from prx_transaction_queue
    where object_type = 4 and (list_of_cols_val_tab_del is null or list_of_cols_val_tab_del = '')
    If there are nulls or empty strings in the list_of_cols_val_tab_del column, delete them.
    If not, take a look at the first records in the queue.
    select top 1 *
    from prx_transaction_queue
    where object_type = 2
    order by tmstmp
    and for items:
    select top 1 *
    from prx_transaction_queue
    where object_type = 4
    order by tmstmp
    Change the transaction_type to "X" (remember what is was, because you will need to change it back).  Changing this value will remove the item from the synch.
    Rerun the synch. 
    If it runs at this point, there is probably data in the records that the synch was not expecting.  The business partner data will need to be examined.  Tics in key values (CardCode, Address Name, contact name, itemcode) may cause problems.
    If this is the case, you might want to contact support to try to track the problem down.
    Another source of problems may be database collation.  We can talk about that if none of the above works.

  • Any proble with magnet iPad

    any proble with magnet iPad

    If it was thought that there might be a problem then they wouldn't be included in the iPad - is there a particular issue that you are concerned about ?

  • Problem with synchronize in web form

    I'm runing forms server 6i with patchset 11...
    I'have a java bean wich extends VTextField, wich opens a file dialog and returns the path+filename selected...
    I have a navigable text item whose implementation class is this one for file dialog...
    Java class returns ok the filename in text item,value shows up in the screen...but if I try to process the value returned in the text item,I receive null..i've even attached a when-validate-item trigger with the code: :text_item:= :text_item ...I have enough 'synchronize ' inserted all over the pl/sql code...the only situation when I receive the value is when I raise a message,or alert in the screen...after this :text_item holds the corect value...However this is annoying,as my customers want this alert removed...
    does anyone has a idea about how can I notify forms about the wright window to synchronize with???
    Does Forms management team Knows something about this?If it is a bug,I wan't to know so I won't lose any more time....

    Thanks Duncan
    This last solution with using the Handler is working,the internal value is updated...however,the screen value of the PJC is nor updated...
    I'm using
    this.setProperty(ID.VALUE,fileDirectory + fileName);
    try
    mHandler.setProperty(ID.VALUE,fileDirectory + fileName);
    catch (oracle.forms.api.FException fe)
    fe.printStackTrace();
    System.gc();
    return true;
    I thinck I'll use that workaround with the get_custom_property....
    However,if you're here,I thinck I have some other problem:
    I have created a pjc on the forms wich imports or exports one line (identical with text_io package)
    This pjc is managed by a pl/sql package also created by myself...from the pjc I'm sending custom events to the forms:endoffile,invalidinfile,invalidoutfile...all works ok,but if a try to import a whole file(performing a loop in pl/sql),no custom event is received by forms,even if the pjc certainly sends it...
    That happens only while performing the loop...
    Is there any special reason why this is happening?is the listener for custom_events disabled during loops execution?
    I've found a workaround for this...I've created another endoffile property wich I'm reading after each line import...but this takes a lot of extra time,doesn't it?
    Thanks for your time

  • Problem with synchronization users in SSM 7.5 5.0

    First, sorry for my English
    I have installed NWCE 7.1 (SP Stack 09) & SSM 7.5 5.0 on a windows 2003
    I have read previous posts and I modified the Java Properties parameter to CPIC.
    I've also tried to delete the cache from the file manager.
    However synchronization does not work, gives the same error:
    Error message 'error' is undefined
    URL http://server.com:50000/strategy/pipadmin/pa_settings.htm
    Line # 547
    pipadmin and SSEL users are UME administrators
    Do not use any group in the Application Server A
    In defaultTrace_00.0.trc appears:
    Error # # Plain # # # Remote User was not set by AuthenticationFilter! #
    I think the error is on the side of the application server administrator, but I know that look ...
    I would appreciate any help.
    Regards.

    Good to hear from you Colin!
    First off, there has been some reports of using the Synchronize User Tables and not getting a pop-up that says it completed - BUT the users were sync'd. Check the Manage Application Groups section to see if the users show up there. If they did, you have sync'd. There does seem to be something in a later SP that dealt with that issue.
    Secondly, when using JPIP, on the Set System Defaults area you "lose" the Cache Directory, Max # of entries, and Global Cache setting. Gone, don't need them for JPIP. So it can be a little frightening when you don't see them.
    As you found. you now only see those WHEN CPIP is used.
    There are a number of reasons that JPIP is a better way to go - long-term:
    1) Tracing - PIP and PAS Trace - that is what you now see in the Set System Defaults window.  It's very useful for troubleshooting. Default is Disable and you keep them like that until you need to do troubleshooting. You Enable them, go through the steps that created a problem and then go pick up the trace file.
    2)  When using JPIP, you no longer use Extended Listener or Listener (Yes, it took me a while to get used to that).
    3) That means - you Don't need to be on the server to restart Services - you do that from Tools, which can be accessed from the url.
    4) JPIP allows you to restart specific instances, as well as restarting the whole service. That means if you know where the trouble is, you can restart that service without restarting all the services.
    5) There is a more information available using JPIP
    6) Using JPIP, you could run SSM off a single UNIX box.
    Hope this helps,
    Bob

  • Problems with Synchronization

    Hi,
    I am new with MSA and trying to analyze synchronization-problems.
    Opportunities that are created on a client which is connected with the workgroupserver do not reach the client of the "person responsible" (the sales responsible) everytime.
    We cannot find any mistakes (red bdocs, hanging queues or something like this).
    Putting the transaction into the outbound-queue by changing anything in the opportunity does not solve problem.
    Is it possible, that it is a problem in partner-determination?
    What I do not understand is that the problem does not occur for all created opportunities but just for a few.
    I hope someone of you can help me!
    Thanks
    Thomas

    Hi,
    the R&R table name depends from the template which is used for CRM functionality, in your case HT = High tech, that is ok (CG would be consumer goods).
    Did you also find an entry in /1CRMGC/HTOPPRRL for this particular site which seems not to be working?
    - If for other sites there is an entry concerning this OPP but not for this one then sth regarding the subscription must be wrong
    - If the R&R table looks fine then I rather would suggest to desubscribe this subscription, wait till R&R has been finished (check Tx smohqueue) and subscribe again
    Besides this: Did you already check the local IDES table smoobjekt for this missing OPP?
    Regards,
    Wolfhard

  • Problems with synchronize contacts

    Hi all,
    I have a 6288.
    Works fine, no problems at all.
    I synchronize my phone with outlook and after that, add new photos to my contacts in phone with resolution 320X240.
    And after this, I cannot synchronize my phone (anymore) with Outlook.
    My phone starts counting the items, but it stops at the 100th (out of 165), and do restart.
    It seems that there is an item in my phone's contacts that it stops the process.
    Is there any idea around to overcome/solve the issue?
    Thanks
    Yuri

    does the contact manager works well with all the phonebook entries?
    What's the law of the jungle?

  • Trouble configurin​g triggers with synchroniz​ed AWG and Digitizer

    Hi,
    I have been working for a few weeks in my project now, and I have a problem concerning the use of triggering options :
    I am using a 5412 AWG and a 5142 Digitizer, in a PXI chassis. I have synchronized them using the Ni-TClk blocks provided in Labview. Now, let me explain what I am trying to do.
    I need to make sure that the data I will record with the digitizer will be exactly aligned with the start of the sequence I am generating with the AWG. This acquisition is triggered either by the user (let's say a clic on a button) or by an external analog trigger.
    I am trying to do that using 2 different kind of triggers : Arm reference trigger and reference trigger.
    I am exporting a signal (Marker Event) from the 5412, on the RTSI0 line. This event happens each time the AWG starts to generate a sequence I have defined. I would like the digitizer to trigger off of this event, but only when a event occured first (the user trigger or the external analog trigger). My idea was to generate an Arm Reference Trigger with the "niScope send software trigger Edge", and to "plug" the reference (stop) Trigger on the RTSI0 line.
    According to the SMC based digitizers acquisition engine state diagram, the digitizer should start in the idle mode when I initiate the acquisition (with Ni-TCLK Initiate), then it should wait for a start trigger (defined as IMMEDIATE) then it should wait for an ARM reference trigger (the one I want to send by software, or later by an external source). Finally it waits for the reference (stop) trigger which would be the marker event on the RTSI0 line.
    According to what I see in my VI, the digitizer seems not to wait for the ARM reference trigger, I guess it directly sees the reference trigger on the RTSI0 line (which happens quite often) without waiting for me to allow it to look for it.
    Do you see a mistake in my thinking here? Is it possible to do what I propose? I was thinking that the fact that I use the TClk synchronization might be a source of my problem with the triggers...
    If it is not possible to do what I propose, I was also thinking to do what I need another way : Is it possible to somehow combine the 2 events I want to trigger off of? I mean, is it possible to create my own signal which would be high when the external trigger and the marker event are both High, and Low otherwise? And then, route this signal in one of the RTSI lines, which would be the source of a digital triggering...
    I hope you will understand what I'm trying to do, and that you will be able to help me.
    Thank you very much in advance,
    Best regards
    Antoine Benard

    Hi Antoine,
    I have been reading you post for a while and I have concluded
    that it will help me a lot if I can have the code; if you were so kind to attach
    it to the discussion forum, I will be more than glad to try on my test machine.
    “I
    need to make sure that the data I will record with the digitizer will be
    exactly aligned with the start of the sequence I am generating with the AWG.”  In this case, and I will
    like to make sure I’m getting this correctly the 5412 is going to trigger the
    5142 and either a user control or an external trigger is going to trigger the
    5412. In this case the user control or the external trigger is going to start
    or stop de generation on the fgen and the fgen will control the scope.  So what we really need to do is figure a way of  using multiple triggers  with the  5412.
    I
    was also thinking to do what I need another way: Is it possible to somehow
    combine the 2 events I want to trigger off of? You can handle this with
    another card. Using card with change detection, you can the FGEN trigger from
    multiple sources.
    I will wait for you answer to make sure I got everything correctly
    Jaime Hoffiz
    National Instruments
    Product Expert
    Digital Multimeters and LCR Meters

  • MI 7.0 - Problem with synchronization after syncBo creation

    Hi All,
    I'm using MI 7.0 SP9. I have a syncBo Z_TEST type 2-Way.
    I define GET_LIST, GET_DETAIL and CREATE BAPIs.
    I create a Z_TEST syncBo on the client (status NEW).
    After a synchronization, the Z_TEST object is created in the backend,
    but the local syncBo status is INCONSISTENT and I have a second syncBo representing the new object with CONSISTENT status.
    Log extraction :
    02.07.2008 17:25:36 Adding header(mobile ID=0000002213, synchronization key=0000000006) data=TOP0001000
    02.07.2008 17:25:36 Before BAPI wrapper call: Create
    02.07.2008 17:25:36 Z_TEST_CREATE has started for run number 0000179341 and runtime counter 8
    02.07.2008 17:25:37 Z_TEST_CREATE has finished for run number 0000179341 and runtime counter 8
    02.07.2008 17:25:37 Before BAPI wrapper call: GetDetail
    02.07.2008 17:25:37 Z_TEST_GETDETAIL has started for run number 0000179341 and runtime counter 9
    02.07.2008 17:25:37 Z_TEST_GETDETAIL has finished for run number 0000179341 and runtime counter 9
    02.07.2008 17:25:37 Updating replication DB for mobile ID 0000002213 (headers=0, items=0)
    02.07.2008 17:25:37 All updates for one TOP block were successful (seq. no.=129, TOP cntr.=0000000001)
    I should have :
    Updating replication DB for mobile ID 0000002213 (headers=1, items=0)
    Why the system doesn't make the link between the created object in the backend and the local object ?
    Any idea ?

    Hi,
    it is your CREATE handler in the backend that has the issue. It sends the data down to the device - have a look into the standard codings for BOs how they handle this - this is in that case the easiest way, cause everything else is a guess from this side. But at least: it is most likely the BADI coding on the backend - could be the mapping on the Middleware as well, but that is not that oftenthe issue.
    Regards,
    Oliver

  • Help needed with synchronization!!

    Hey guys--so I've run into a bit of a problem.
    My computer (before: with outlook 2002 and DM 4.7, no problems synching) had died on me. Anyway, new hard disk, fresh OS, and I've now installed outlook 2007. I installed DM 4.7, and have encountered some problems:
    Whenever I try to set up the synchronization, i keep getting an error that says "The computer must be connected to the Internet in order to initially configure synchronization settings. Please ensure you are able to connect to the Internet and try again." The problem is, I AM connected to the net (that's how I'm typing this right now). I think it did something like this to me originally on the old comp, but when I restarted everything was fine. I've restarted the comp, and also tried starting DM before plugging in my storm and vice versa as well. I have no problem making a backup of the storm, I just can't synchronize anything, which is troublesome as ALL my contacts, etc, are now only in my storm, whereas I had them in outlook and in my storm before. (I thought maybe it was because it's outlook 2007, but that doesn't really make sense because i haven't had problems synching with outlook, i have problems even getting into the settings to start the synch)
    Any thoughts??
    Also, another (more minor) problem: I have a hidden today theme, and realized that the reason I wasn't seeing certain people's birthdays and events appearing was because those were listed under my other calendar (I have two email accounts on my BB and, therefore, two "calendars"). Anyway, I was trying to figure out (with no luck) if there is a way to "switch" calendars on events (as i have about 73 birthdays/events on the calendar i'd rather NOT use, but i don't want to have to manually type them back in or re-enter them in my contacts).
    Thanks in advance for any advice!

    bermie2000 wrote:
    Hey guys--so I've run into a bit of a problem.
    My computer (before: with outlook 2002 and DM 4.7, no problems synching) had died on me. Anyway, new hard disk, fresh OS, and I've now installed outlook 2007. I installed DM 4.7, and have encountered some problems:
    Whenever I try to set up the synchronization, i keep getting an error that says "The computer must be connected to the Internet in order to initially configure synchronization settings. Please ensure you are able to connect to the Internet and try again." The problem is, I AM connected to the net (that's how I'm typing this right now).
    New computer, new firewall, new antivirus
    http://www.blackberry.com/btsc/KB16471
    The BlackBerry Desktop Manager prompts that an Internet connection is required when configuring organizer data synchronization
    The search box on top-right of this page is your true friend, and the public Knowledge Base too:

  • Problem with synchronize Family Farm Seaside

    Hi, can you help me with one game and sync with GC? When I start Family Farm Seaside all the time Ive the question (so 20-30 times a day)
    "are you sure you want to synchronize the game with game center"
    OF course the answer Yes or not doesnt solve the problem. Logout doesnt solve. Delete game and install again doesnt solve. All day when I play the game Ive the question about aync. Support of the game told me that itw pronlem with GC conf, but what kind of preferences and where should I change? Really frustrated can you help me?

    Hi Ryclark,
    thank you for your post. They do look like they are aligned visually aligned in the multitrack. When i record on top of track 1, it sounds like it is in sync (in headphones) When i play it afterwards it sounds really messy and even chunks of track two would jump and disapear. Is it possible I could send you an example so that you can see for yourself what i mean?. I could record an easy example.
    Cheers

  • Can someone help me with synchronization of powerpoint presentation?

    the powerpoint can be viewed synchronously with at least 3 computers. this will be ideal for virtual classroom use.

    the powerpoint can be viewed synchronously with at
    least 3 computers. this will be ideal for virtual
    classroom use.Maybe there is an API for Powerpoint or Microsoft Office. If there is, you could design the Powerpoint application to communicate with a Java application. ANd then the Java application would manage the synchronization.
    Also check out Centra Learning Management server software for alternatives. Powerpoint is a not so good choice for distributed elearning systems.

  • Issues with Synchronize to and from DB (version 3.3.0.747)

    Having an issue with syncing the model and the data dictionary is a very specific case:
    1. Reverse engineer an existing table (T1)
    2. Copy the table (in data modeler) - T2
    3. Rename the table, make changes (add columns and keys)
    4. Forward engineer the new table (i.e., export and run DD for T2L)
    5. Make additional changes to new table (T2) in data model.
    6. Run sync db with model - the sync routine compares my new table (t2) to the original table (T1) in the database! It cannot "find" my new table (T2) in the database to compare to.
    7. Alternatively try to sync the model with the db - this time it wants to sync the original table (T1) to itself (which has no change) and DROP my new table (T2) from the model.
    It appears that sync is looking at meta data one my new table (T2) that contains the original copied table's name (T1). And in fact if I look at the table Summary properties - the source db object property does list the original table name (T1).
    I also tried to reverse engineer the new table (T2) to the merge with the model, that has the same behavior as the sync.
    Is there a way to fix this short of dropping T1 from the schema?
    Edited by: Kent Graziano on May 20, 2013 2:37 PM

    Hi Kent,
    thanks for reporting the problem. I logged a bug and ER for that.
    Is there a way to fix this short of dropping T1 from the schema?Unnecessary information about source need to be cleared. Here is a script that will help on that:
    //array with 2 elements to illustrate different use cases - the first is used to have exact match on table name
    // the second one ("REGIO") can be used with following check in inList function
    //if(table.getName().startsWith(list)){
    var list = ["Regionsv1","REGIO"];
    function isInList(table){
         for(var i=0;i<list.length;i++){
              // different approaches to match table name can be used
              // be aware of letter case
              //if(table.getName().startsWith(list[i])){
              if(table.getName().equalsIgnoreCase(list[i])){
                   return true;
         return false;
    function clearSourceStampforTable(table){
         clearSourceStamp(table);
         cols = table.getElements();
         for(var i=0;i<cols.length;i++){
              clearSourceStamp(cols[i]);
         keys = table.getKeySet().toArray();
         for(var i=0;i<keys.length;i++){
              clearSourceStamp(keys[i]);
              if(keys[i].isFK()){
                   clearSourceStamp(keys[i].getFKIndexAssociation());
    function clearSourceStamp(object){
         object.setSourceConnName("");
         object.setSourceObjSchema("");
         object.setSourceObjName("");
         object.setSourceDDLFile("");
         object.setDirty(true);
    tables = model.getTableSet().toArray();
    for(var i=0;i<tables.length;i++){
         table = tables[i];
         if(isInList(table)){
              clearSourceStampforTable(table);

Maybe you are looking for