More than one Thread accessing the same records in the database

Hi, I have more than one thread accessing a synchronized method called getMinPrimaryKey() which gets the lowest of the primary key frm the table based on the a flag which is set to true. once it is retrieved the same method also sets the flag as false so it is not retrieved the second time. so next time a different thread calls this method it should retrieve the next available lowest primarmy key.
but even when i have the method as synchronized different threads keep returning the same primary key instead of getting the next sequence. can some one let me know where I might go wrong and what could be the solution. is it because when once i retrieve the record and set the flag as false, i also need to commit it?, which could be the reason the select query still picks up the same primary key. please help me out on this.
thanks,
Harish

Correction. If different threads always return the same key then your table isn't getting up dated. If different threads sometimes return the same key, then either the database is committing lazily, or else the threads are calling getMinPrimaryKey on different objects and so are not executing atomically with respect to each other.

Similar Messages

  • How to multiple/ parellal sets of books to generate more than one financial statement based on different (or the same) accounting principles.

    How to multiple/ parallel sets of books to generate more than one financial statement based on different (or the same) accounting principles.
    My Client needs Parallel Ledger in SAP B1 similar like SAP ECC. Is this functionality available ?

    Dear Mr. Nagrajan,
    Thank you for your response. I have already gone through documents but not able to understand. Is there any setup for this ? or its just work around i.e. using template and special field in JV i.e. Ref. 1 /2
    My doubts :
    I understand that Chart of Account structure is one and common for IFRS and other accounting method. We need to create only those account separately ( 2 times with prefix like IFRS revenue account, GAAP Revenue account).
    Now at time of entry, Assume some entries / adjustment are specifically for IFRS and not for other ledger. In this case, What need to do ?
    You have mentioned about DTW approach but do we need to insert all JV's again with other ledger ?
    Someone suggested that if any entry which are specific to IFRS Ledger, We need to user Ref.1 /2 column or Transcation code column and in which we can put IFRS
    Based on this, Need to create 2 seperate template for IFRS and other ledger for all report.
    This is my understanding of Solution in SAP B1. Please help me to clarify my though process
    Please do needful.If you have done implemenation and if you can share doucment, it would be great help.
    Email :[email protected]

  • Posting topic to more than one thread and in different categories...

    Is there anything in the TOU we can "refer" to when users post the same topic in more than one thread and to add to that, more then one category? Case in point: http://discussions.apple.com/thread.jspa?messageID=8806009#8806009 (This is just one example)
    Limnos had a valid point. If we had a section in the TOU we could copy/paste from, I think it would help if we could refer to authority, ie., TOU.
    Thanks!
    Carolyn

    I wouldn't get into too much of a flury about that with end users. Notify as needed and let the moderators decide if it needs to be deleted. A good rule of thumb is you want the discussions to have:
    Everyone should feel comfortable reading Submissions and participating in discussions.
    That's from Terms of Use.
    And then there is:
    You agree to not interfere with or disrupt the Site.
    I'm seeing that logically one can conclude directing users not to crosspost may be considering interference with the site. I may suggest someone post in another forum if a solution is not transparent in the forum they are using, but that's as far as I'm comfortable bending the rules.
    I'm trying hard to keep my thumbs away from the keyboard when I see duplicate posts.

  • Contacts & iCloud: can you have more than one iCloud account syncing with Contacts on the Mac?

    I want to set up a shared iCloud account for multiple users in a (very) small office environment, where several new iOS devices and, for the moment, two Macs (2012 13" MacBook Pro and 2013 Mac Mini) will be able to read/write to a shared Contacts account – and at the same time maintain a second, personal iCloud account linked to the same Contacts app on one machine, which account's contacts data will remain private and inaccessible to the other Macs/devices which are likewise using the shared account.
    Can this be done? (I.e., can Contacts app on a Mac include separate iCloud accounts?)
    If so, how to set it up?
    Thanks

    Thanks for your answer. There's no problem with others accessing that Mac – it's used by one person only – my question is can you add a second iCloud account to Contacts. Over the past two days I had tried to add the shared iCloud account to Contacts and kept getting failures. But maybe the server was down or the ISP was weird: your response assumes it can be done and so, to my embarrassment, I tried again just now and violá, it's done. Thanks again.
    P.S. Finding a simple presentation that makes clear you can have more than one iCloud accounts syncing to Contacts at the same time was very hard to find, either from Apple or others on the web. Maybe I don't know how to search, but they could do with a clear explanation of this for the uninitiated.

  • How to show more than one report in a same Viewer or Form

    Dear all,
    I have develop many reports with CrystaReport XI and I'm using the CrystalReportViewer to show each of them in VB6. My Question is: Can I show more than one report in a same Viewer? if i need to show the report1.rpt and report2.rpt in a same window how can I do it?
    Sérgio Salazar - Brazilian VB developer

    No and Please re-post if this is still an issue to the Legacy Application Development SDKs Forum or purchase a case and have a dedicated support engineer work with you directly

  • More than one X.509 certificate was found with the specified parameters

    Greetings All,
    We are getting an error in our application event logs every minute or so and it seems to be causing search queries to fail. Same error is appearing in the ULS logs.
    System
    Provider
    Name]
    System.ServiceModel
    4.0.0.0
    EventID
    3
    Qualifiers]
    49154
    Level
    2
    Task
    5
    Keywords
    0x80000000000000
    TimeCreated
    SystemTime]
    2014-06-25T02:30:12.000000000Z
    EventRecordID
    92894
    Channel
    Application
    Computer
    Security
    UserID]
    EventData
    System.ServiceModel.ServiceHostingEnvironment+HostingManager/63835064
    System.ServiceModel.ServiceActivationException:
    The service '/0c98374520dc4b748d92a1e51b365dce/SearchService.svc' cannot be
    activated due to an exception during compilation. The exception message is: More
    than one X.509 certificate was found with the specified parameters.. --->
    System.ArgumentException: More than one X.509 certificate was found with the
    specified parameters. at
    Microsoft.SharePoint.Utilities.CertificateManager.GetCertificate(String
    storeName, StoreLocation storeLocation, X509FindType findType, Object findValue)
    at
    Microsoft.SharePoint.Administration.SPIisWebServiceSettings.get_LocalSslCertificate()
    at Microsoft.SharePoint.SPServiceHostOperations.Configure(ServiceHostBase
    serviceHost, SPServiceAuthenticationMode authenticationMode) at
    Microsoft.Office.Server.Search.Administration.SearchServiceHostFactory.CreateServiceHost(String
    constructorString, Uri[] baseAddresses) at
    System.ServiceModel.ServiceHostingEnvironment.HostingManager.CreateService(String
    normalizedVirtualPath, EventTraceActivity eventTraceActivity) at
    System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(ServiceActivationInfo
    serviceActivationInfo, EventTraceActivity eventTraceActivity) at
    System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String
    normalizedVirtualPath, EventTraceActivity eventTraceActivity) --- End of inner
    exception stack trace --- at
    System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String
    normalizedVirtualPath, EventTraceActivity eventTraceActivity) at
    System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String
    relativeVirtualPath, EventTraceActivity
    eventTraceActivity)
    w3wp
    6328
    Doesn't appear to affect the component health status or the crawling process, only the return of search results.
    Sorry, something went wrong.
    Search has encountered a problem that prevents results from being returned.  If the issue persists, please contact your administrator.
    I checked the certificates snapin, didn't see anything out of the ordinary but I have a feeling it goes deeper than that.
    Where can I remove this duplicate certificate? Thanks!

    Open IIS and check server certificates
    Check if there is any certificate applied to Security token service
    Did you used any certificate for web application in site
    Check binding of all web application in IIS
    Try to browse
    servername/0c98374520dc4b748d92a1e51b365dce/SearchService.svc from all servers, check the certificate details
    If this helped you resolve your issue, please mark it Answered

  • Re: More than one planned order on same day

    Dear All,
    I am getting more than one planned order for the same day in MD04 after I run MRP run. My requirement is that the planned order should get clubbed.
    My lot size is WB & 2: collective requirement setting.
    Please advice.
    Regards,
    Vivek Sharma

    Karthick,
    I am getting more than one planned order on same date.If I check any of the planned order for pegging requirements I find that the planned order has been created after clubbing all the requirements( the Raw material is being used in morethan one FG )
    Now the issue Is :
    09.06.2010     PldOrd     0019211763/STPO     13.02.2010     30     159.500
    09.06.2010     PldOrd     0019211764/STPO     18.02.2010     30     1,536
    09.06.2010     PldOrd     0019211765/STPO     25.02.2010     30     787.500
    09.06.2010     PldOrd     0019211766/STPO     11.03.2010     30     2,536.755
    09.06.2010     PldOrd     0019211767/STPO     29.03.2010     30     862.500
    09.06.2010     PldOrd     0019211768/STPO     13.04.2010     30     108.750
    09.06.2010     PldOrd     0019211769/STPO     27.04.2010     30     1,678.500
    09.06.2010     PldOrd     0019211770/STPO     30.05.2010     30     980.745
    So I dont understand how is this happening.
    Regards

  • More than one thread in Openmp

    Hello Friends,
    I am trying to paralelize a great c program and now I am having problems for getting more than one thread.
    I tried it inside my code, at first I put omp_set_dynamic(0) and after I put omp_set_num_threads(4), but I got only one thread.
    These functions worked fine with a simple hello world code and I got to run 4 threads, but in my big code they didn't work. Could anybody help me? Any hint would be very good!...
    Regards,
    Glauber

    Hi,
    Thanks, It's a big code and was divided in 9 files, even so, I will post its most important parts.
    That functions are called from sequential part before the parallel region as you will can see below:
    // global.h
    #if defined (OMP_ENABLED)
    #     include "omp.h"
    #endif
    // main.c
    #include <stdio.h>
    #include <stdlib.h>
    #include <time.h>
    #include <math.h>
    #include <string.h>
    #include <stdarg.h>
    #include "global.h"
    #ifdef USE_READLINE
    # include <readline/readline.h>
    # include <readline/history.h>
    static char **readline_completion(const char *, int, int);
    #endif
    # if defined (OMP_ENABLED)
    int           proc_id; /* process ID (0, 1, ..., num_procs-1) */
    int           num_procs; /* number of active processors */
    # endif
    int main (int argc, char *argv[])
         int i;
    # if defined (OMP_ENABLED)
    omp_set_dynamic(0);
    omp_set_num_threads(4);
    num_procs = omp_get_num_threads();
    printf("Num procs: %i\n",num_procs);
    if( num_procs <= 1)
    exit(0);
    # endif
    //mcmc.c
    #include <stdio.h>
    #include <stdlib.h>
    #include <time.h>
    #include <math.h>
    #include <string.h>
    #include <ctype.h>
    #include <limits.h>
    #include <stdarg.h>
    #include "global.h"
    int RunChain (long int *seed)
         int          i, j, k, n, chn, stopChain;
         for (chn=0; chn<numLocalChains; chn++)
    #if defined (OMP_ENABLED)
    #pragma omp parallel for private(chn)
    #endif
              for (chn=0; chn<numLocalChains; chn++)
    If you need something else, please, return me
    Thanks in advanced
    Glauber

  • [Q] Can Vision track more than one object in a same area - objects that might cross?

    Hi,
    Sorry for that long title, but that's my question.
    Can Vision track more than one object in a same area - objects that might cross?
    Because I'm able to do it, extracting XY, but it looks like "IMAQ Count Objects" doesn't track object frame after but frame, but extract the XY coordinates always in the same way, like example starting from top and everytime he sees an object, he extracts the XY, but if the objects cross (then he will extract XY without caring which objects was the previous one but just based on "scan from top to bottom").
    This is why I opened this topic in the non Vision forum part : http://forums.ni.com/t5/LabVIEW/Sort-XY-by-closest/td-p/2440428
    Thank you,
    Sébastien
    Solved!
    Go to Solution.

    Hi,
    In fact, IMAQ count object order the object regarding their top most and left most pixel, but not regarding their gravity center point.
    Axis origin of an image is situated on the left top corner.
    You need to refer to other caracteristics such as shape or color to identify your objects.
    Regards

  • How to fix "More than one receiving system has been specified for the BAPI"

    Due to patching the HR system I am testing the functionalities in our test environment before patching the production system. When doing a hiring action (in our test environment) I get this error message at infotype 0000 when I try to save:
    "More than one receiving system has been specified for the BAPI (AcctngServices, CheckAccountAssignment)"
    It is message no. B1811
    My first suggestion weas that it could be the presence of dual connections in SALE, but disabling one of them didn't help.
    Since the Basis team is currently patching the HR system I wonder if that has any affect that might end out in the above error.
    Anyone who can help me out here? Please?

    Usually, when you have HR and FI on separate boxes, certain FI information (e.g. cost center) do not physically locate on HR box. Instead of replicating these data into HR for integrity check, you have an option (for a few countries) of remotely connecting from HR box to FI to do these checking though BAPI. I think this is the scenario you have (i.e. when doing the hiring, a new ee will be assigned to a personnel area which in turn default a cost center which SAP would need to check for integrity).
    Please go into distribution model, and check if for some reason, this is set up to go to to more than 1 destination for HR accounting integrity check.
    Rgds.
    Edited by: Ted Dinh on Jun 12, 2009 8:55 AM

  • HT1719 Can more than one device access the same ITunes library?

    Can more than one device acess the same ITunes library?  And if so, does each device's list of songs remain separate and distinct for each device?

    No problems whatsoever. I have 3 iPhones and 3 iPod touches with different IOS connected.

  • More than one SDK ? More than one APP runing in each SDK at the same time ?

    Hi all! after some search at forums I'm quite sure that I can have more than one SDK installed at the same time.
    But what i Want to do is having more than one Tomcats running in those SDK
    Of course, the principal matter is about ports, but I wanna know how Can i get them running... Will i call each JVM especify?
    Will they use patyh ??
    Any tomcat+jdk user can trow me some advice ?
    thanks!

    Subemontes wrote:
    Hi all! after some search at forums I'm quite sure that I can have more than one SDK installed at the same time.Correct
    But what i Want to do is having more than one Tomcats running in those SDK Ok.
    Of course, the principal matter is about ports, but I wanna know how Can i get them running... Will i call each JVM especify?Each will run in a separate VM, and they don't need to be of the same version.
    >
    Will they use patyh ??What?

  • More than one Plant in Customer Material record

    In Customer Material Info record I want a option of more than one plant. Right now I can enter only one plant in customer material info record. What can I do to have a option of more than one plant in customer material info record.
    Regards,
    Kumar

    hello, friend.
    as i understand, you would want options for more than one plant (to choose from) and not to restrict the number of choices.
    for practical reasons, you can only enter 1 (standard) plant in the customer-material info record.  nevertheless, you can enter a different plant in the customer master, and another plant in the material master.
    when you process the sales order, you can change the plant to any other choices, even those not included in the customer-material or customer master data, as long as these plant choices and your customer are assigned the same distribution channel.  of course, your material should also be extended to these plants.
    i hope this helped, even if a little.
    regards.
    jty

  • How can i put more than one item in a same row of a form?

    guys!
    it seems item is positioned in a single row one by one each time item is appened to a form. i can't append more than one item in same row.
    i'm using sun wtk and default colored phone emulator.
    xxxx

    Hi,
    It is not possible to have more than one combo in the source frame. This is because frame drivers can take only
    two columns in the sql query, one is the display value and the other the return value.
    Thanks,
    Sharmila

  • TS2972 Using more than one Apple TV on same wireless network

    Sorry if this is answered elsewhere, but I have an Apple TV for the main home TV, and now want to add another Apple TV for elsewhere in my house.
    Can I have two or more Apple TVs using home sharing on the same home wireless network? I'm assuming that I can, but don't want to buy another Apple TV and have to return it. Thanks. RB

    Welcome to the Apple Community.
    Yes you can have more than one, but be aware this will place more demand on your network, generally speaking this shouldn't be a problem for 2 Apple TV's on a reasonable network, but if your network is flakey or you add many more Apple TV's, it may become a problem.
    We have 7 and have installed additional base stations for the network to cope with the bandwidth required.

Maybe you are looking for