Query on synchronization

Hi,
I have a query on synchronization. When an object is accessed by two or more threads simultaneously, we use the synchronize keyword to prevent two threads simultaneos access. So on which this lock is obtained either it is on the object or the synchronized methods.
chetana

The lock is obtained for the object as a whole. Actually each object has it's associated Monitor, and every time a thread accesses a synchronized method on an object, it gains that objects' monitors' lock. While a thread owns a lock on an objects' monitor, no other thread can access that objects' synchronized methods.

Similar Messages

  • Synchronization issues -Help

    Hi,
    I have 20 tables in universe, there are some isolated tables, Now I created  4 alias tables of table X (existing one)(new alias tables are A,B,C,D) then  joined new table E and Joined Many to One to (E-A,E-B,E-C and E-D).Now If I drag One Objects from class E and Class A or B or C or D u2026its getting synchronized.
    These two objects in my universe and they are from the same data provider (meaning they are objects under same universe but under different classes). When I bring the objects from these two different classes in the query panel, I get two queries in my view sql. Please let me know how I can avoid this synchronization? Both are dimensions objects and each have same datatypes in db and in universe respectively, but I am not sure why they r getting synchronized and there is proper join also. Please, can anyone help me? Can data issue in one of the tables cause a query to synchronize ?
    PS: I have not defined any aggregate awareness function in any of the class.
    Thanks!
    Sanjeev Gubyad

    Hi Sanjeev,
    Have you defined context which includes all the joins?
    If not please deine a context and then export the universe.
    Regards,
    Rohit

  • Creating progress bar in oracle forms 6i

    Hii
    I have a push-button (pb_submit)
    when when_button_pressed trigger fired...I have a database main procedure to be called.
    inside that procedure i am calling 25 procedures.
    and all 25 Procedures will be executed sequencially.
    I want to use a Progress bar...
    so that user will get to know hw much % completed
    if main procedure(total 25 procedures inside) is completed successfully then progress bar should show 100%
    like wise if 1 procedure completed then 4 %
                 if 2 procedure completed then 8 %
    total 25 procedure completed then 100%
    how to implement this logic.
    and if in between 1 procedure failed then progress bar should stop at that incident.
    and it should start from dat instant only if again that failed procedure run successfully.
    should i post my codes here.ok...here is the codes written in the button(when_button_pressed trigger)
    DECLARE
      l_Last_Record      NUMBER  := 0  ;
      l_Prg_Process_Id    NUMBER     ;
      l_Prg_Process_Id_1  NUMBER     ;
      l_Prg_Id       VARCHAR2(15)  ;
      l_Alert_Result    VARCHAR2(1)   ;
      l_Validation_Msg   VARCHAR2(500) ;
      l_Path        VARCHAR2(240) ;
      File_Name       VARCHAR2(250) ;
      l_file_exists     BOOLEAN       ;
      l_file_len        NUMBER     ;
      l_blocksize       BINARY_INTEGER;
      o_Status       VARCHAR2(1)  ;
      o_User_Selection_Ca1 VARCHAR2(1)  ;
      o_User_Selection_Ca2 VARCHAR2(1)  ;
      o_User_Selection_Ca3 VARCHAR2(1)  ;
      CURSOR C_Validation IS
      SELECT Cpv_Validation_Type     ,
             Cpv_Validation_Input    ,
             Cpv_Validation_Action  ,
             Cpv_Validation_Active_Flag
      FROM   Config_Process_Validation
      WHERE  Cpv_Program_Id = l_Prg_Id
      AND   Nvl(Cpv_Validation_Active_Flag, 'N') = 'Y'
      ORDER BY Cpv_Validation_Sequence;
    BEGIN
    SELECT RV_HIGH_VALUE
    INTO   l_Path
    FROM   CG_REF_CODES
    WHERE  Rv_Domain    = 'DERV_DATA_FILES'
    AND   Rv_Low_Value = 'DRV_FILES';
    Go_Block('Process');
      Last_Record;
      l_Last_Record := :System.Cursor_Record; 
      First_Record;
      FOR i IN 1 .. l_Last_Record
      LOOP
      Go_Record(i);
      l_Prg_Id := :Prog_Id;
      IF NVL(:Process.Cb_Select,'N') = 'Y' THEN
       :Query.Current_Status := 'Current Process: ' || :Process.Prog_Desc;
       Synchronize;
       --Validate if program is already in running mode or already completed
       SELECT NVL(MAX(DECODE(Prg_Status, 'R', 999999999, 'C', Prg_Process_Id)), 0)
       INTO   l_Prg_Process_Id
       FROM   Program_Status,
           Parameter_Master
       WHERE  Prg_Dt      = Pam_Curr_Dt
       AND    Prg_Cmp_Id  = l_Prg_Id
       AND    Prg_Exm_Id  IN ('ALL', :Query.Exchange)
       AND    Prg_Status  IN ('R', 'C');
       IF l_Prg_Process_Id = 999999999 THEN
         P_Show_Alert(l_Prg_Id||' Process is already running.','A',l_Alert_Result);
        --RAISE Form_Trigger_Failure;
       ELSIF l_Prg_Process_Id > 0 AND :Execution_Flag <> 'M' THEN
        P_Show_Alert(l_Prg_Id||' Process already run. It can not run twice. ','A',l_Alert_Result);
        RAISE Form_Trigger_Failure;
       END IF;
       --Validate mandataory process, process specific validation and message
       FOR i IN C_Validation
       LOOP
        IF i.Cpv_Validation_Type = 'MANDATORY' AND i.Cpv_Validation_Active_Flag = 'Y' THEN
           SELECT Count(1)
           INTO   l_Prg_Process_Id_1
           FROM   Program_Status,
               Parameter_Master
         WHERE  Prg_Dt      = Pam_Curr_Dt
         AND    Prg_Cmp_Id  = i.Cpv_Validation_Input
         AND    Prg_Exm_Id  IN ('ALL', :Query.Exchange)
         AND    Prg_Status  = 'C'
         AND    Prg_Process_Id IN (SELECT MAX(Prg_Process_Id)
                      FROM   Program_Status,
                          Parameter_Master
                      WHERE  Prg_Dt      = Pam_Curr_Dt
                      AND    Prg_Cmp_Id  = i.Cpv_Validation_Input
                      AND    Prg_Exm_Id  IN ('ALL',:Query.Exchange)
                      AND    Prg_Status  = 'C');
         IF l_Prg_Process_Id_1 = 0 THEN
          P_Show_Alert(i.Cpv_Validation_Input||' Mandatory Process NOT completed successfully.','A',l_Alert_Result);
          RAISE Form_Trigger_Failure;
         END IF;
        ELSIF i.Cpv_Validation_Type = 'MESSAGE' THEN
         P_Show_Alert(i.Cpv_Validation_Input, i.Cpv_Validation_Action, l_Alert_Result);
         IF l_Alert_Result = 'N' THEN
          RAISE Form_Trigger_Failure;
         END IF;
        ELSE   
         --- OTHER PROCESS SPECIFIC VALIDATION
         l_Validation_Msg := Null;
         Pkg_Process_Automation.P_Pre_Process_Validation(l_Prg_Id,
                                 :Query.Exchange,
                                 :Query.Segment,
                                 i.Cpv_Validation_Type,
                                 l_Validation_Msg);
         IF l_Validation_Msg IS NOT NULL THEN
          P_Show_Alert(l_Validation_Msg,i.Cpv_Validation_Action,l_Alert_Result);
          IF l_Alert_Result = 'N' THEN
           RAISE Form_Trigger_Failure;
          END IF;
         END IF;  
        END IF; 
       END LOOP;
       --Validating whether file exists or not
       IF :Process.File_Input_Format IS NOT NULL THEN
        Pkg_Process_Automation.P_Gen_File_Name(:Process.File_Input_Format,
                            :Query.Exchange,
                            :Query.Segment,
                            File_Name);
        Utl_File.FGetAttr(
         location    => l_Path,
         filename    => File_Name,
         fexists     => l_file_exists,
         file_length => l_file_len,
         block_size  => l_blocksize);
        IF NOT l_File_Exists THEN
         --MESSAGE('The file does not exist.');
         P_Show_Alert('The file does not exist.','A',l_Alert_Result);
         RAISE Form_Trigger_Failure;
        END IF;
       END IF;
       Set_Application_Property(Cursor_Style, 'BUSY');
       SET_ITEM_INSTANCE_PROPERTY('Process.Status', CURRENT_RECORD, VISUAL_ATTRIBUTE, 'VA_YELLOW');
       :Process.Status := 'R';
       Synchronize;
       IF l_Prg_Id = 'DTMBCORP' THEN
        P_Show_Alert('Do you want to do Final Settlement Corporate Action ?(Y/N)','I',l_Alert_Result);
        o_User_Selection_Ca1 := l_Alert_Result;
        P_Show_Alert('Enable Round-To-Tick ? (Y/N)','I',l_Alert_Result);
        o_User_Selection_Ca2 := l_Alert_Result;
        --P_Show_Alert('Do you want to Rollback ? (Y/N)','I',l_Alert_Result);
        --o_User_Selection_Ca3 := l_Alert_Result;
       END IF;
       ----   Calling of Main Procedure
       Pkg_Process_Automation.P_Run_Process(l_Prg_Id,
                          :Query.Exchange,
                          :Query.Segment,
                          :Query.Entity_Id,
                          File_Name,
                          o_User_Selection_Ca1,
                          o_User_Selection_Ca2,
                          o_User_Selection_Ca3,
                          o_Status);
       IF l_Prg_Id = 'DTMBCORP' THEN
        P_Show_Alert('Do you want to Rollback (Y/N)','I',l_Alert_Result);
        o_User_Selection_Ca3 := l_Alert_Result;
        Pkg_Process_Automation.P_Run_Process(l_Prg_Id,
                            :Query.Exchange,
                            :Query.Segment,
                            :Query.Entity_Id,
                            File_Name,
                            o_User_Selection_Ca1,
                            o_User_Selection_Ca2,
                            o_User_Selection_Ca3,
                            o_Status);
       END IF;                 
       Set_Application_Property(Cursor_Style, 'DEFAULT');                  
       Message(o_Status);
       Message(o_Status);
       IF o_Status = 'Y' THEN
        :Process.Status := 'C';
        SET_ITEM_INSTANCE_PROPERTY('Process.Status', CURRENT_RECORD, VISUAL_ATTRIBUTE, 'VA_GREEN');
       ELSE
        :Process.Status := 'E';
        SET_ITEM_INSTANCE_PROPERTY('Process.Status', CURRENT_RECORD, VISUAL_ATTRIBUTE, 'VA_RED');
       END IF;
       SELECT Prg_Log_File
       INTO   :Process.Log_File
       FROM   Program_Status ,
              Parameter_Master
         WHERE  Prg_cmp_id = l_Prg_Id
         AND    Prg_dt     = Pam_Curr_Dt
          AND   (Prg_Cmp_Id,Prg_Strt_Time)  IN (SELECT   Prg_Cmp_Id,max(Prg_Strt_Time) 
                                   FROM   Program_Status b,
                                                        Parameter_Master
                                                 WHERE  Prg_Cmp_Id =  l_Prg_Id
                                   AND    Prg_Dt     =  Pam_Curr_Dt
                                                  GROUP BY Prg_Cmp_Id);
       Synchronize;
       Set_Application_Property(Cursor_Style, 'DEFAULT');   
      END IF;
    END LOOP;
    :Query.Current_Status := '';
    Synchronize;
    EXCEPTION
      WHEN OTHERS THEN
      :Query.Current_Status := 'Error found';
      Set_Application_Property(Cursor_Style, 'DEFAULT');
      MESSAGE(sqlerrm );
      --MESSAGE(sqlerrm );
      Synchronize;
    END;
    inside p_run_process there are other 25 database procedures.
    help me !!!

    Create a procedure as like,
    PROCEDURE show_progress(x number) IS
    y number;
    BEGIN
      set_item_property('PART_DISP',VISIBLE,PROPERTY_TRUE);
      set_item_property('PART_DISP',WIDTH,x);
      set_item_property('PART_DISP',VISIBLE,PROPERTY_TRUE);
    END;
    PART_DISP is a display_item.
    After completion of each procedures call the above procedure like,
    cntr:=cntr+1;
    show_progress(round(cntr/25*287,0));
    synchronize;
    where cntr is a counter it will be incremented 1 to 25, the constant value 287 is the maximum width of PART_DISP (you can change for your need).
    The local variable cntr's initial value is 0 and maximum value is 25.    
    cntr                   part_disp          % of progress
    1
    11.48
    4
    2
    22.96
    8
    3
    34.44
    12
    4
    45.92
    16
    5
    57.4
    20
    6
    68.88
    24
    7
    80.36
    28
    8
    91.84
    32
    9
    103.32
    36
    11
    126.28
    44
    12
    137.76
    48
    13
    149.24
    52
    14
    160.72
    56
    15
    172.2
    60
    16
    183.68
    64
    17
    195.16
    68
    18
    206.64
    72
    19
    218.12
    76
    20
    229.6
    80
    21
    241.08
    84
    22
    252.56
    88
    23
    264.04
    92
    24
    275.52
    96
    25
    287
    100
    Hope this will help.

  • Data Synchronize from HFM FMDmeException Query Failed or invalid

    I'm trying to create a Data Synchronization where HFM is the data source source.
    I keep getting the following dme exception and don't know how to further diagnose the issue.
    4/19/12 1:29 PM : Error submitting request to source connector - exception: com.hyperion.datasync.fmdme.exception.FMDmeException: Acknowledgement failure - status: 1, reason: Query Failure: The query failed or is invalid! (0)
    4/19/12 1:29 PM : Translation failed - Source query failed to open - exception:; nested exception is:
         com.hyperion.datasync.fmdme.exception.FMDmeException: Acknowledgement failure - status: 1, reason: Query Failure: The query failed or is invalid! (0)
    The DME Listener service is running.
    I've tried the simplest data sync -- just one member in each dimension, copying to same application (in a different scenario).
    I have data synchronizations that do work where the source is a Planning application.
    I was able -- a month ago -- to create a sync where HFM is the source on this development application so don't know if something has changed in the application itself.
    Any suggestions appreciated.
    Thanks,
    Barb
    Edited by: bg on Apr 19, 2012 1:31 PM

    You're right. I should have put it in Financial Consolidation. I don't see that I can post a question directly to EPMA level.

  • PreparedStatement Synchronization Query

    Hi All,
    I hope this is the right place to post this query (heh)! In a Java Webapp I have around 30 PreparedStatement(s) stored as global variables. As it is possible that some of the PreparedStatement(s) will be executed by multiple users concurrently from different pages (i.e. sections of the code), in addition to the usual synchronization tags I have volatile boolean values to check whether a PreparedStatement is currently in use to prevent concurrent execution. For example:
    //  PreparedStatement is global, ResultSet is local.
    synchronized(this) {
      while (flagRaised) {
         try {
           wait();
         } catch (InterruptedException e) {
           // do nothing.
       flagRaised = true;
       try {
         preparedStatement.setString(1, "Pears");
         localResultSet = preparedStatement.executeQuery();
       } catch (SQLException e) {
         // log the problem
       flagRaised = false;
       notifyAll();
    }I believe that this is necessary for any "mutator" statements where I'm using "setXXXX", but if I had a statement that returned an entire table would I need to implement any additional synchronization code? For example could I simply have:
    localResultSet = preparedStatement.executeQuery(); // where the PreparedStatement returns a table.with no synchronization/volatile variables?
    Thanks in anticipation,
    Simon

    I fail to see why the above is necessary. Think of what you are doing: caching a PreparedStatement. Why?
    PreparedStatement, out of the box with a decent JDBC driver, will cache the parsed SQL query. Further, most RDBMS will also perform their own native cachine of query plans. (I will leave out the considerations of RDBMS cached execution plans, though they are also valid to the discussion). You are adding a level of pooling above and beyond what the vendor offers. This might be necessary if your own system, but have you benchmarked this? Do you 'know' the middleware parse of a PreparedStatement is your actual scaling bottleheck. IMO, this is a rare situation.
    Rather, understand what both your RDBMS and your JDBC driver's use of PreparedStatement already offer you. Premature optimization is the root of most software evil, at least according to Knuth. Sure you are not contributing to the same?
    - Saish

  • Synchronization between input and variable query

    I create a table that received data by an input form and by another graph.
    I need synchronize these: when I launch the model the table was launched with only variable input and only after a second was re-launched with variable and input.
    Is possible synchronization all?
    I try using the "timer connect", but the problem doesn't solve.
    I think the correct way is using the "guard condition", but I don't understand how!
    Any idea?
    Thank you and best regards
    Elena

    HI Elena,
    You have got it right that this can be achieved using Guard Condition .But before i suggest you something can you make your scenario more clear.
    “I need synchronize these: when I launch the model the table was launched with only <b>variable input</b> and only after a second was re-launched <b>with variable and input</b>."
    Thanx
    Pankaj

  • Blank entry in adhoc query

    Hi All,
    Im have created a data source with table joins T001W and T134M.
    Filed MANDT has been maintained when the join condition has been established at Data source level.
    Adhoc query in business rule identifies the deficiency. But some filed in the result has blank entry.
    Attached the screen shot for your reference.
    Can you please let me know, how to fix the blank entry issue.
    Thanks
    Ashok S

    Hello Ashok,
    In this case, you have foundation and plug-in in both systems. I assume you have set data source and business rules in GRC system, am I right?
    If this is the case, you might have several problems as before SP 10 for GRC 10.0, backwards compatibility was not implemented yet. It means that you must follow SAP note 1352498 in order to synchronize your systems.
    If this is not the case, have you checked these values in SCU3 in ECC system?
    Best Regards,
    Fernando

  • In R12 DQM synchronization method can be done through UI...

    We have one issue going on where DQM synchronization menthod is changed to BATCH from automatic.
    Its happening frequently.
    Can some one please give the query behind the page so that we can identify who has changed the query.
    Regards,
    Prakash Ranjan

    Duplicate post.
    In R12 DQM synchronization method can be done through UI...
    In R12 DQM synchronization method can be done through UI...

  • How do I synchronize a table of employees with and employee update form?

    WHAT i AM TRYING TO DO:
    Create a page with two areas. The top will contain a sortable, filterable list of employees. The bottom of the page will contain all of the details on a selected employee.
    WHAT I HAVE DONE:
    1. Created a DEPT_EMPLOYEES view with just some basic department and employee information.
    2. Created Entities and View Objects based on the DEPT_EMPLOYEES view and the EMPLOYEES table.
    3. Created a View Link between the DeptEmpROView (source) and EmployeesUView (destination)
    3. Created a page with a panel splitter an dropped the DeptEmpROView in the top as and ADF Table.
    4. Dropped the EmployeeUView on the bottom part of the pages as and ADF Form.
    WHAT HAPPENS.
    1. When I open the page the list of employees is displayed on top, and the first employee is displayed below.
    2. When I click on another row in the table the form below does not change. I had expected it to.
    3. If I right-click on a row in the table and select "reload" from the options the page is re-drawn and the bottom form is populated with the data that matches the row I clicked on.
    WHAT I WANTED
    When you click on an entry, to have the bottom part of the page refreshed to match the selected entry.
    QUESTIONS:
    1. I thought I had followed all of the steps to prepare a master-detail setup. Do this not work with a table as the master? Or did I miss a step? Or am I using components in a way they were not intended?
    2. When I look at the ViewLink I see in the Destination that the where clause :Bind_EmployeeId = EMPLOYEE_ID will be appended to the query. I would then guess that :Bind_EmployeeId is not set when I click on a row. Is there a way to make that happen?
    3. I notice in the af:table documentation there is an org.apache.myfaces.trinidad.event.SelectionEvent defined. Can I somehow intercept this and set the bind variable then? If so, how to I tell the form to refresh?
    5. Another clue. When I run the page I get some warnings. One is "Reference selectedRow not found" . Double clicking on that gets me to a line selectedRowKeys="#{bindings.DeptEmployeesROView2.collectionModel.selectedRow}"
    6. Another warning message "Reference makeCurrent not found" gets me to selectionListener="#{bindings.DeptEmployeesROView2.collectionModel.makeCurrent}"
    It sure seems like these last two must have something to do with it.
    Any clues would be appreciated.
    Edited by: rrp on Jan 3, 2011 12:47 PM

    Shay,
    Thanks for pointing me to that tutorial. The synchronization is now working.
    For anyone else that might find this discussion:
    To make it work I selected the af:paneFormLayout that held the EmployeeUView.
    In the properties there is a PartialTriggers property in the Behavior section.
    I highlighted this property and selected the Edit option.
    This allowed me to navigate the component tree and pick the table holding the DeptEmpROView.
    That was it. Now clicking on the table changes the details displayed in the form.
    There are questions, but they are more followon:
    1. The tutorial surrounded the "list table" with a panelCollection. I did not do that. I don't know why or why not to use the panelCollection.
    2. The tutorial made a point of setting the ColumnSelection attribute to single for the List table. I did not find this changed the behavior in any way and was wondering why.
    3. The tutorial also made a point of changing the ContextMenuSelect for the list table to "clickToEdit".
    3a. I did not see how this changed the behavior
    3b. Why "clickToEdit" on a read-only table?

  • How to tame iCal synchronization.

    Hi, friends.
    I'm very confused and irritated with iCal behavior regarding synchronization. First of all, I moved from MobileMe to iCloud; so I'd expect my data to MOVE, not to DUPLICATE in my desktop copy of iCal and I'd also expect iCal to get ride of MobileMe calendars, appointments and dates and to show me just iCloud calendars, appointments and dates. That's not the case: I end up with duplicated or triplicated dates: one for Desktop, one for MobileMe and one for iCloud, well, I'm supposing it is so, because none of the three says where is who. Once in a while, when I create an appointment, I don't know where it was created: on iCloud, on MobileMe, on my Desk. When I delete one of the three dates, the three dates disappear. Every other date I create, it evaporates into limbo without warnig, where did it went? I end up with three sets of calendars and I want JUST ONE and the ability to query THAT ONE in my desktop, my iPhone and my iCloud and the three environmets be synchronized, not duplicated. I've lost many memorable dates because this horrendous behavior in iCal.
    Please, help.
    Thank you.

    onClick,
    Use iCloud: Resolving duplicate calendars after setting up your calendar application for iCloud Calendar to help troubleshoot your problems.

  • A query regarding synchronised functions, using shared object

    Hi all.
    I have this little query, regarding the functions that are synchronised, based on accessing the lock to the object, which is being used for synchronizing.
    Ok, I will clear myself with the following example :
    class First
    int a;
    static int b;
    public void func_one()
    synchronized((Integer) a)
    { // function logic
    } // End of func_one
    public void func_two()
    synchronized((Integer) b)
    { / function logic
    } // End of func_two
    public static void func_three()
    synchronized((Integer) a)
    { // function logic
    } // End of func_three, WHICH IS ACTUALLY NOT ALLOWED,
    // just written here for completeness.
    public static void func_four()
    synchronized((Integer) b)
    { / function logic
    } // End of func_four
    First obj1 = new First();
    First obj2 = new First();
    Note that the four functions are different on the following criteria :
    a) Whether the function is static or non-static.
    b) Whether the object on which synchronization is based is a static, or a non-static member of the class.
    Now, first my-thoughts; kindly correct me if I am wrong :
    a) In case 1, we have a non-static function, synchronized on a non-static object. Thus, effectively, there is no-synchronisation, since in case obj1 and obj2 happen to call the func_one at the same time, obj1 will obtain lock for obj1.a; and obj2 will obtain lock to obj2.a; and both can go inside the supposed-to-be-synchronized-function-but-actually-is-not merrily.
    Kindly correct me I am wrong anywhere in the above.
    b) In case 2, we have a non-static function, synchronized on a static object. Here, again if obj1, and obj2 happen to call the function at the same time, obj1 will try to obtain lock for obj1.a; while obj2 will try to obtain lock for obj2.a. However, since obj1.a and obj2.a are the same, thus we will indeed obtain sychronisation.
    Kindly correct me I am wrong anywhere in the above.
    c) In case 3, we have a static function , synchronized on a non-static object. However, Java does not allow functions of this type, so we may safely move forward.
    d) In case 4, we have a static function, synchronized on a static object.
    Here, again if obj1, and obj2 happen to call the function at the same time, obj1 will try to obtain lock for obj1.a; while obj2 will try to obtain lock for obj2.a. However, since obj1.a and obj2.a are the same, thus we will indeed obtain sychronisation. But we are only partly done for this case.
    First, Kindly correct me I am wrong anywhere in the above.
    Now, I have a query : what happens if the call is made in a classically static manner, i.e. using the statement "First.func_four;".
    Another query : so far we have been assuming that the only objects contending for the synchronized function are obj1, and obj2, in a single thread. Now, consider this, suppose we have the same reference obj1, in two threads, and the call "obj1.func_four;" happens to occur at the same time from each of these threads. Thus, we have obj1 rying to obtain lock for obj1.a; and again obj1 trying to obtain lock for obj1.a, which are the same locks. So, if obj1.a of the first thread obtains the lock, then it will enter the function no-doubt, but the call from the second thread will also succeed. Thus, effectively, our synchronisation is broken.
    Or am I being dumb ?
    Looking forward to replies..
    Ashutosh

    a) In case 1, we have a non-static function, synchronized on a non-static object. Thus, effectively, there is no-synchronisationThere is no synchronization between distinct First objects, but that's what you specified. Apart from the coding bug noted below, there would be synchronization between different threads using the same instance of First.
    b) In case 2, we have a non-static function, synchronized on a static object. Here, again if obj1, and obj2 happen to call the function at the same time, obj1 will try to obtain lock for obj1.a; while obj2 will try to obtain lock for obj2.a.obj1/2 don't call methods or try to obtain locks. The two different threads do that. And you mean First.b, not obj1.b and obj2.b, but see also below.
    d) In case 4, we have a static function, synchronized on a static object. Here, again if obj1, and obj2 happen to call the function at the same time, obj1 will try to obtain lock for obj1.a; while obj2 will try to obtain lock for obj2.a.Again, obj1/2 don't call methods or try to obtain locks. The two different threads do that. And again, you mean First.b. obj1.b and obj2.b are the same as First.b. Does that make it clearer?
    Now, I have a query : what happens if the call is made in a classically static manner, i.e. using the statement "First.func_four;".That's what happens in any case whether you write obj1.func_four(), obj2.func)four(), or First.func_four(). All these are identical when func_four(0 is static.
    Now, consider this, suppose we have the same reference obj1, in two threads, and the call "obj1.func_four;" happens to occur at the same time from each of these threads. Thus, we have obj1 rying to obtain lock for obj1.aNo we don't, we have a thread trying to obtain the lock on First.b.
    and again obj1 trying to obtain lock for obj1.aYou mean obj2 and First.b, but obj2 doesn't obtain the lock, the thread does.
    which are the same locks. So, if obj1.a of the first thread obtains the lock, then it will enter the function no-doubt, but the call from the second thread will also succeed.Of course it won't. Your reasoning here makes zero sense..Once First.b is locked it is locked. End of story.
    Thus, effectively, our synchronisation is broken.No it isn't. The second thread will wait on the same First.b object that the first thread has locked.
    However in any case you have a much bigger problem here. You're autoboxing your local 'int' variable to a possibly brand-new Integer object every call, so there may be no synchronization at all.
    You need:
    Object a = new Object();
    static Object b = new Object();

  • Error while running Profile synchronization (Event ID: 6398)

    Hi,
    We had our User Profile Synchronization service in stopped state for quite some time due to our SQL server having "Named Instance". Since RTM version had this compatibility issue, I patched my farm with SP2 + FEB 2014 CU.
    Now the "User Profile Synchronization Service" is running (I started it and now it was a success). However when I start the Profile sync job (either INC or FULL), it fails. This is the error I get:
    The Execute method of job definition Microsoft.Office.Server.UserProfiles.UserProfileImportJob (ID c10650ed-0935-47a5-b3ce-a307c576ad9a) threw an exception. More information is included below.
    Operation is not valid due to the current state of the object.
    Log Name: Application
    Source: Microsoft-SharePoint Products-SharePoint Foundation
    Date: 6/25/2014 3:47:16 AM
    Event ID: 6398
    Task Category: Timer
    Level: Critical
    Keywords:
    User: ST\sps02-svc
    Computer: EMEA-MOSS1.st.stroot.local
    Description:
    The Execute method of job definition Microsoft.Office.Server.UserProfiles.UserProfileImportJob (ID c10650ed-0935-47a5-b3ce-a307c576ad9a) threw an exception. More information is included below.
    Operation is not valid due to the current state of the object.
    Event Xml:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
    <System>
    <Provider Name="Microsoft-SharePoint Products-SharePoint Foundation" Guid="{6FB7E0CD-52E7-47DD-997A-241563931FC2}" />
    <EventID>6398</EventID>
    <Version>14</Version>
    <Level>1</Level>
    <Task>12</Task>
    <Opcode>0</Opcode>
    <Keywords>0x4000000000000000</Keywords>
    <TimeCreated SystemTime="2014-06-25T03:47:16.577398600Z" />
    <EventRecordID>484089</EventRecordID>
    <Correlation ActivityID="{A6F9E131-4925-4889-A759-5F873C4B2E74}" />
    <Execution ProcessID="9140" ThreadID="7372" />
    <Channel>Application</Channel>
    <Computer>EMEA-MOSS1.st.stroot.local</Computer>
    <Security UserID="S-1-5-21-1058282146-1732951074-3797079023-18290" />
    </System>
    <EventData>
    <Data Name="string0">Microsoft.Office.Server.UserProfiles.UserProfileImportJob</Data>
    <Data Name="string1">c10650ed-0935-47a5-b3ce-a307c576ad9a</Data>
    <Data Name="string2">Operation is not valid due to the current state of the object.</Data>
    </EventData>
    </Event>
    Here are the observations:
    - User Profile Synchronization Service - Running
    - User Profile Service - Running
    - Both FIMS - Running
    - On User Profile Service Application page, I see "User Profile Sync is not currently provisioned."
    - If I go in for "Configure Sync Connections" I see --- The query returns nothing. 
    - On clicking "Create new connection" I get this error:
    What could be wrong now?

    Clear the file system cache on all servers in the server farm on which the Windows SharePoint Services Timer service is running. Please refer to the following link:
    http://ahmedmadany.wordpress.com/2011/05/08/user-profile-service-an-update-conflict-has-occurred-and-you-must-re-try-this-action/
    Make sure that the SharePoint Farm account, which is created during the SharePoint Farm setup, is a member of the local Administrators group where the User Profile Synchronization service is deployed.
    Make sure that the SharePoint Farm account is able to log on locally on the server where User Profile Synchronization is deployed.
    More information are provided in the link below:
    http://www.sysadminsblog.com/microsoft/user-profile-service-an-update-conflict-has-occurred-and-you-must-re-try-this-action/
    http://www.sysadminsblog.com/microsoft/event-6398-microsoft-sharepoint-administration-spsqmtimerjobdefinition-exception/
    If this helped you resolve your issue, please mark it Answered

  • Active Directory synchronization working, authentication not on CUBM BE5000 8.6(1a)

    I successfully set up Active Directory synchronization between my CUCM BE5000 appliance running 8.6(1a) and our Windows 2008 Server Active Directory.  Users are replicating successfully, but authentication is not working even though I am using the same LDAP manager distinguished name and password for both.  I have a suspicion to the cause of this problem but for the record, the following is my relevant configuration:
    System/LDAP/LDAP System:
    LDAP Server Type Microsoft Active Directory iPlanet or Sun ONE LDAP Server OpenLDAP Microsoft Active Directory Application Mode
    LDAP Attribute for User ID userPrincipalName sAMAccountName mail employeeNumber telephoneNumber
    LDAP Server Type: Microsoft Active Directory
    LDAP Attribute for User ID: userPrincipalName
    System/LDAP/LDAP Directory:
    LDAP Configuration Name: bgctnv.local
    LDAP Manager Distinguished Name: CN=cm.sync,OU=BGCTNV Users,DC=bgctnv,DC=local
    LDAP User Search Base: DC=bgctnv,DC=local
    LDAP Server Information: bgctnv.local, port 389 (to query any domain controller in DNS; I have also tried specific IP addresses)
    System/LDAP/LDAP Authentication:
    LDAP Manager Distinguished Name: CN=cm.sync,OU=BGCTNV Users,DC=bgctnv,DC=local
    LDAP User Search Base: LDAP user search base is formed using the User ID information (pre-populated, I cannot change this)
    LDAP Server Information: bgctnv.local, port 3268
    All of my Active Directory users are now populated and active under End Users.  However, I am not able to log into /ccmuser among other things using my valid domain credentials.  I am a super user as well as a standard end user.
    Curiously, invalid usernames (userPrincipalName in my case) return the error "Log on failed - Invalid User ID or Password" while a valid username, with or without the correct password, returns only "Log on failed."  That seems to imply that some part of the authentication or LDAP bind is taking place.
    Here's the catch.  The base domain here is bgctnv.local while we use bgctnv.org as a valid and acceptable alternative UPN suffix in Active Directory.  Every Microsoft and every third-party program I have used will accept [email protected], but I'm beginning to think that CM will not, or is having some sort of translation issue.  I read that alternative suffixes can cause problems in Active Directory forests with multiple trees, but this is a vanilla, single domain environment.
    I don't even know where to look to debug this issue.  Has anyone seen this before or can anyone tell me where to look for logs?
    Thanks,
    John

    I found the following:
    http://www.cisco.com/en/US/docs/voice_ip_comm/cucm/srnd/8x/directry.html
    As mentioned in the section on LDAP Synchronization, in order to support synchronization with an AD forest that has multiple trees, the UserPrincipalName (UPN) attribute must be used as the user ID within Unified CM. When the user ID is the UPN, the LDAP authentication configuration page within Unified CM Administration does not allow you to enter the LDAP Search Base field, but instead it displays the note, "LDAP user search base is formed using userid information."
    This may help in some situations where there are multiple trees in an AD forest, but it is definitely not the solution.  Even with multiple trees, it is common to use alternative UPN suffixes.  Nothing in AD requires or even recommends that you exclusively use your AD domain root as the UPN suffix.
    For example, company.local may use company.com as an alternative but primary UPN suffix to provide simplicity for users.  Users can then achieve more broad SSO capabilities by using their familiar email credentials when authenticating for company.local services.
    When using UserPrincipalName as the LDAP synchronization attribute for the CM User ID, the configuration requires that the search base for authentication be derived from the UPN suffix, regardless of whether it is a single domain or multiple trees within a forest.  This makes it impossible to authenticate by UPN unless your UPN is explicitly your root domain name.  From the example above, CM would try to bind [email protected] against DC=company,DC=com instead of the correct DC=company,DC=local.
    The logical solution would be to allow the administrator the option.  Why not have a choice of whether to generate the user search base from the userid (UPN) information, or be able to specify the search base as well like it allows with any other synchronization attribute?
    Would this be a feature request, bug report, or neither?  I'd really appreciate it if Cisco considered this but I don't know the proper channel.

  • SQL query in XSL-schema

    Iu2019m working on an intercompany scenario,
    where I have to synchronize goods receipt lines to a purchase order in another company.
    When I am reading the item lines of the good receipt, I should be able to read the item card and based on an udf-field,
    I should decide whether the line may be synchronized or not.
    Is it possible to add in the xsl-shema a sql query ?
    <FinalAtomResult xmlns="">
       <BOM>
          <BO>
              <AdmInfo>
              <Documents>
                   <Document_Lines>
         <xsl:for-each select="$msg/BOM/BO/Document_Lines/*">
    > The SQL query should be defined here ...
           <row>
             <LineNum>
                <xsl:value-of select="LineNum"></xsl:value-of>
             </LineNum>
             <ItemCode>
                   <xsl:value-of select="ItemCode"></xsl:value-of>
             </ItemCode>

    Hi Mario,
    As you have created another post for the same problem I consider this one as solved.
    Capturing the result of an SQL Call in B1i
    Regards,
    Trinidad.

  • Query in item problem

    Hellou everybody.
    I need your help. I am using forms 6i and i have a block with some non DB items. But items are synchronize with DB items for viewing results. I use this items for diplaying results from DB tables. In enter query mode i write condition in this text items and execute query.
    My problem is that i have text item which is VARCHAR2 type and I need to enter the condition for example > 1000. But i don't know how to convert this field to number. When i execute query under char type it not work properly (other result). I tried to change data type to number but i can't because it's not alowed to mixed types.
    select * from table_name where pag_cis > 100 - i need this
    select * from table_name where pag_cis > '100' - i have this
    Can you help me???

    You may use the set_block_property procedure built-in and the 'default_where' property so as to execute the query using the contents of your item (with the name of column , of course).
    Afterwards , you navigate to the db items block (with go_block('blockname')) and execute the query (built-in 'execute_query').
    Hope it helps
    Sim

Maybe you are looking for