How do we put an object in coherence cache when the pk is using @TableGener

Hi,
I am trying to create a sample application using Spring, JPA, Eclipselink, Coherence. I am trying to insert objects into cache and then expecting it to persist into database asynchronously. The issue is we are using @TableGenerator to generate pk. I dont have the primary key before hand to use it to put the object into the cache.
Ex: cache.put(???, object);
What is the best approach in such scenarios. Can anyone point me to an example?
Thanks.

user12107940 wrote:
The above article helps but we can't change the current architecture of generating the primary key i.e., TableGenerator. We have other non-java processes that update the database. Is there any other way to use jpa-eclipselink to know the pk before persisting the object.In this case you have to ensure that anything which comes via Coherence gets ids from a set of possible ids which is distinct from the set of possible ids generated in the database, but it is technically impossible to put something in a cache without an id already generated if the id is part of the primary key (and you want it to be).
E.g. whatever generates ids in the database must only generate odd numbers for ids (e.g. a sequence which increases not with one but with two), and whatever goes via JPA/EclipseLink must only generate even numbers.
Best regards,
Robert

Similar Messages

  • How do you put safari web pages into icloud with the safari iCloud button?

    how do you put safari web pages into icloud with the safari iCloud button?

    What that button does is sync your tabs between your devices. So if you have multiple macs with Mountain Lion and/or devices with iOS 6 (once it comes out this fall) you can pick up where you left off. For example, let's say I have apple.com, nytimes.com, and facebook.com open on my mac, but I need to run. Later, if I need to use another computer in my household, I can just restore the tabs that I was using before on this other mac.

  • How do I put an external display to sleep when I am using my MacBook Air for presentation?

    How do I put an external display to sleep when I am using my MacBook Air for presentation? I do not want to go to the projector just to turn it off and turn on again after a while? Is there a keyboard shortcut for that?

    I want to be able to sleep the external display and at the same time do things in the MacBook.( This feature is useful for me so that I can prepare some things and so that my audience will not see what I am about to show them.)
    Is there a feature for Mountain Lion?

  • Hello! how can i put and read my words documents in the notes pad of my ipod nano 3trd generation?thanks to all.the notes

    hello! how can i put and read my words documents in the notes pad of my ipod nano 3trd generation?thanks to all.

    The Notes features of the 3G iPod Nano only supports TXT files and not Word Documents.  If you want to be able to read these word documents, you'll need to copy the text from each over to a text file.  See here for more information.
    iPod: Storing and reading notes
    Keep in mind that each txt file has a limit of 4096 characters.  See this article for more information as well.
    Long notes are truncated on your iPod
    B-rock

  • How do I put an image on my podcast in the itunes store?

    How do I put an image on my podcast in the itunes store?

    The image which appears in the Store page is referenced in the 'itunes:image' tag in the feed. As you are probably using a program or an online service to create your podcast, rather than hand-writing the feed, you will need to look in their Help to find out where you input the image or the reference to it.

  • How do I invoke an ActionListener on a page when the page initially loads?

    How do I invoke an ActionListener on a page when the page initially loads?
    Page 1: A user clicks on a h:commandButton and is navigated to Page 2.
    Page 2: When the page loads and goes through RESTORE_VIEW, APPLY_REQUESTS and RENDER_RESPONSE, I need to call an ActionListener in the managed bean for Page 2.
    However, if the user comes in from any other page than Page 1, the ActionListener cannot be invoked intially when the page loads. The user has a choice to click on the h:commandButton on Page2 to invoke the ActionListener.
    What is an example of invoking a method with the ActionListener signature in Java code?
    Where would I put the code to invoke the ActionListener, in a beforePhase or afterPhase, constructor?
    Thanks,
    --Todd                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Interesting. You're right. It doesn't happen when I click away from this site and then return. Maybe I'm barking up the wrong tree. Maybe it's the specific website I was thinking of and not Firefox. Unfortunately, I have to use that site all the time for work. I'll try contacting their webmaster. Thanks for your help.

  • HT201272 How do I download previously purchased albums from iTunes when the album has either disappeared from my computer or the tunes are not playable?  The album shows as purchased on the iTunes store, but not available to download to my authorized devi

    How do I download previously purchased albums from iTunes when the album has either disappeared from my computer or the tunes are not playable?  The albums show as purchased on the iTunes store, but not available to download to my authorized device.  I also have albums that appear in my library, but are not able to be added to my iPod from my computer

    When you download something from the iCloud, it is a brand new licensed copy. Your iCloud account just contains a notation that you have this app. It isn't storing an actual copy of the app from your Mac.

  • I don't know of there is anyone than can fix this age old Apple problem.   Does anyone know how to retrieve things under an old Apple ID when the email used for that account no longer exists? I am trying to update a number of apps that was bought under an

    I don't know of there is anyone than can fix this age old Apple problem.   Does anyone know how to retrieve apps under an old Apple ID when the email used for that account no longer exists & I can't remember the password? After speaking with Apple Acct. Security, I got the security Q right but my birthday was wrong! They wanted the serial number from my phone that was 3 iPhones ago! Seriously??!!
    Any updated way to work around this? No Apple people can correct it.
    Thanks,
    Joe

    You need to ask Apple to reset your security questions. To do this, click here and pick a method; if that page doesn't list one for your country or you're unable to call, fill out and submit this form.
    (122986)

  • How can I log onto iCloud from my iPad when the option is in grey and therefore not available

    How can I log onto iCloud from my iPad when the option is in grey and therefore not available. I deleted my account as it was showing up with an old Id ( I'd changed my email) but now I've done that it won't give me the option of logging back on. Do I have to do this on another device Or computer linked to iTunes first?
    THanks

    Hi Kate, have you perchance enabled restrictions on your device. (Settings > General > Restrictions)

  • How can I prevent that emails are downloaded (POP3) when the lid of my MacBook Pro is closed?

    How can I prevent that emails are downloaded (POP3) when the lid of my MacBook Pro is closed?

    Disable Power Nap in the Energy Saver pane of System Preferences. Uncheck the box marked Enable Power Nap... in each of the tabs.

  • I have the 1st generation ipod touch i installed an update which now it is 3.1.3 version i was able to put my apps on it but when i want to use the apps it will not let me use them. what do i need to do?

    I have the 1st generation ipod touch i installed an update which now it is 3.1.3 version i was able to put my apps on it but when i want to use the apps it will not let me use them. What do i need to do?

    Does it happen with the apps that came with the iPod?
    Does it happen with all apps you have downloaded/installed?
    Have you ried deleting the apps and redownload/install the apps?  You will not be charged again if you are signed into the same iTunes account that originally purchased the apps.
    Next would be to restore from backup
    Last would be to restore to factory defaults/new iPod.

  • Hey how are you guys listen i have an iphone 4s the one i use with the H20 CARRIEr and i trying to enable the option call forwarding and when i type tho number i go back and i notice to the call forwarding it turning off as soon i back to the main menu ?

    hey how are you guys listen i have an iphone 4s the one i use with the H20 CARRIEr and i trying to enable the option call forwarding and when i type tho number i go back and i notice to the call forwarding it turning off as soon i back to the main menu ?

    There are a lot of posts in the forums today with people having problems with iMessage.   There was also a published outage yesterday, so it's possible there are still some issues that may be impacting you both.
    I would just wait it out - I'm sure it will be sorted out soon.

  • How do I set up cloud on my mac when the cloud option is not listed in my system preferences?

    how do I set up cloud on my mac when the cloud option is not listed in my system preferences?

    Welcome to the Apple Community.
    If iCloud isn't in system preferences you will need to update your operating system.
    iCloud is part of iOS 10.7.2 or better.

  • How do I insert an audio in html? When the reader access the widget it will be transferred to a page in Safari?

    How do I insert an audio in html?
    When the reader access the widget it will be transferred to a page in Safari?

    See iBooks Author: About HTML widget creation

  • HOw to find how many users into into r/3 system  and when the log in

    HI
    I need to find who are others log in to R/3 system?
    HOw to find how many users into into r/3 system  and when the log in

    Hi,
    You can also use transaction code AL08 to see the list of users logged on with the transactions they are working on.
    Regards,
    Venkat

Maybe you are looking for

  • Can't create HealthVault accounts in PPE. 'We're sorry. We could not complete your last request'

    Since last week, we've been unable to manually create any HealthVault accounts in the PPE environment. We are trying to test the patient signup process for our application but keep hitting a wall when creating the actual HealthVault account. This has

  • App Store Filtering? Can I see list of Apps for Click Wheel Interface iPods

    It's very convenient that Apple has made it easier to find Click-Wheel Games for the iPod Nano and other models sporting the click-wheel interface. Does anyone know some way to filter Apps so one can determine what other (non-game) apps are compatibl

  • How can I change my account id with CRDC?

    Resolution Please take the following steps to change your default CRDC account settings: 1.  Logon to CRDC (https://na.crystalreports.com/Home.do) 2.  Click on the "Settings" tab from the menu options By default, your "Profile Settings" will be displ

  • Olite ODBC driver and windows service problems

    Hi, I use the SOA Suite 10.1.3 and when I try in my code to locate BPEL Processes by instances using the following code: WhereCondition where = new WhereCondition(SQLDefs.CX_index_1 + " = ?"); where.setString(1, deployedId); // Find Instances IInstan

  • Is this JMX logging output?

    Have a JMX enabled app with logging enabled. jmx logging.properties file: handlers=java.util.logging.ConsoleHandler .level-INFO java.util.logging.FileHandler.pattern=%h/java%u.log java.util.logging.FileHandler.limit=50000 java.util.logging.FileHandle