Native mapping with JPA doesn't work by default - not marked cascade persi

I started to use our old TopLink native mapping but via JPA instead of EclpseLink native API.
But at first execution it's already complaining of my mappings. When using the native mappings shouldn't EclipseLink interpret it to keep old behavior?
What are the other expected changes of behavior so that I can fix them proactively?
What is the workaround for this specific problem?
The error is:
java.lang.IllegalStateException: During synchronization a new object was found through a relationship that was not marked cascade PERSIST: Id: 0
DateTime: Mon Jun 08 02:00:00 EDT 2009
Entry Type: 10009
Entry Type In/Out: 10014
calendarDate: Mon Jun 08 00:00:00 EDT 2009
businessDate: Mon Jun 08 00:00:00 EDT 2009
origin: timecard
Inserted: true
Changed: false
Deleted: false
Mon Jun 08 02:00:00 EDT 2009.
     at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.discoverAndPersistUnregisteredNewObjects(UnitOfWorkImpl.java:4016)
     at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.discoverUnregisteredNewObjects(RepeatableWriteUnitOfWork.java:182)
persistence.xml is:
<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0">
     <persistence-unit name="AllInOne" transaction-type="JTA" >
     <description>This represent all CITYADM schema mappings. It does include pmsi.</description>
          <exclude-unlisted-classes>false</exclude-unlisted-classes>
          <properties>
               <property name="eclipselink.session-name" value="AllInOne"/>
               <property name="eclipselink.sessions-xml" value="sessions.xml"/>
          </properties>
     </persistence-unit>
     <persistence-unit name="DataServices" transaction-type="JTA">
     <description>This represent all REPORTADM schema mappings</description>
          <exclude-unlisted-classes>false</exclude-unlisted-classes>
          <properties>
               <property name="eclipselink.session-name" value="DataServices"/>
               <property name="eclipselink.sessions-xml" value="sessionsDataServices.xml"/>
          </properties>
     </persistence-unit>
</persistence>

Hello Sebastien,
You are using em.persist instead of uow.regsiterObject, which has different behaviour as mandated by the JPA specification. EclipseLink/TopLink automatically registered referenced objects through registerObject, but the JPA specification states that persist will only cascade if the mapping is marked cascade persist - otherwise it is required to throw the exception you see.
If you wish to use the JPA with a project defined through native api, you will need to modify your mappings to match how you want to use the API. In this case, to get the same effect as you would from registerObject, you will need to mark your mappings as cascade persist. Depending on how you merge your entities (shallow, deep etc) you might also need to evaluate how you plan to use the JPA merge method and mark mappings as cascade merge appropriately.
See setCascadeMerge on ForeignReferenceMapping.
Best Regards,
Chris

Similar Messages

  • My map with ios6 doesn't work. It shows my location but map is just a grid. How do I fix this?

    How do I get a map and not just a grid on new ios6 maps. I have an iPhone 4.

    Katiplum wrote:
    I am located in Wisconsin right by Illinois boarder.
    I thought maybe map data was missing in your are, but just looked and that doesn't seem to be the case.
    Matt

  • Cropping pictures with Viewer doesn't work.

    Cropping pictures with Viewer doesn't work.
    Selecting < or ~ 12 pictures. (picture size are Snapshots with iphone resolution) ->Viewers opens and display them. -> Russian roullette between cmd+k or the little crop button. No indication which one will process a crop or which not. -> Both result in picture selection disappear with no crop.
    Selecting > 12 pictures. (picture size are Snapshots with iphone resolution) -> Viewer opens and display them. I crop them one by one with same Russian roulllette behavior between cmd+k or the little crop button. -> Closing Viewer. -> Pictures remain like they've been before. Not cropped.

    I just tried what you described (although I can't really fathom why you would describe it as Russian roulette (with a variable number of L's). Unless you've been drinking a lot, which is what people are usually doing when they are playing Russian roulette. Your post was hard enough to decipher without that.
    Anyway, my cropping was saved each time. I think there's something wrong with your Preview.app. Have you changed anything about the autosave functions of OSX?
    I would try:
    Boot into your recovery partition (restart, hold down ⌘R until you see the Apple logo), and use Disk Utility to repair your hard drive. Repair permissions too while you're there. OS X: About OS X Recovery
    if that doesn't help, then I'd reinstall Mavericks over your current installation.

  • My photoshop cc doesn't work. "_crtCreateSymbolicLinkW not found in DLL "C.\Windows\SYSTEM32\MSVCP110.dll"". Please help

    my photoshop cc doesn't work. "_crtCreateSymbolicLinkW not found in DLL "C.\Windows\SYSTEM32\MSVCP110.dll"". Please help

    I checked my windows 7 pro machine for the module I see many copies if the DLL with different dates two different sizes all are version 11.0.51106.1 so I guess there are 32bit and 64bit versions. Some are in Adobe folders some in Wacom folders ad in two windows folders including system32.  I do not know if there is and entry point "_crtCreateSymbolicLinkW" in it.

  • TS1702 After I have upgraded to the new iOS 6.1.2, the email software doesn't work and is not downloading.  While before it was working fine.

    After I have upgraded to the new iOS 6.1.2, the email software doesn't work and is not downloading.  While before it was working fine.
    How to fix this?

    There seems to be massive amounts of problems with every aspect of iOS 6. From what I understand all you can do is try and reset your device and pray that Apple bequeaths working software next time or allows users to revert to iOS 5 while they search for someone who knows what they are doing. Perhaps you will need to use an alternate email app until then? (Although, Gmail seems to be the only one that works properly)

  • My iPhone 4s doesn't work. i can not swipe to open it or to even turn it off. what can i do??????

    my iPhone 4s doesn't work. i can not swipe to open it or to even turn it off. what can i do??????

    I would attempt a reset. This is done by holding both the powerbutton and the home button for about 10 seconds for it to restart.
    When it boots back up, test the issue. If the issue persists, I would then recommend a restore through iTunes on a computer, set up as new, and test again. If it's now working, i'd recommend to restore from your last back up see if it resolved your issue.
    Hopefully the first reset solves it, in most cases it does.
    Regards

  • Every app on my ipod (2nd gen) which requires wifi connection doesn't work although the wifi mark is on. i did try restarting my ipod, resetting network setting, disconnect from wifi and reconnected it but non of them worked.

    every app on my ipod (2nd gen) which requires wifi connection doesn't work although the wifi mark is on. i did try restarting my ipod, resetting network setting, disconnect from wifi and reconnected it but non of them worked.

    This may sound silly but try your date a time setting my ipod had the same problem and i had even checked the the date and time went all the way to the apple store for help and the genius guy just rest the date and time and it worked just fine.

  • I got a external Apple Wired Keyboard (w/ NumPad), caps lock mapped to control doesn't work with tab + caps lock + shift

    I got a external Apple Wired Keyboard (w/ NumPad) since I'm a developer. I have used control panel > keyboard > modifier keys to make the caps lock key the control key. I can't get it to work when I press caps lock (which maps to control) +shift + tab (which I use to change tabs backwards).
    Any ideas? It works when I use the regular control key, and it works on my built-in MBPro keyboard. Thx!

    Hi Steve, Welcome to apple discussions.
    Hmm, that is a strange problem. Well, you've already done what I would suggest which is to go to the keyboard settings and click the "Restore defaults" button in the modifier keys window and try again. If that doesn't work then you can restart the computer and check. If that doesn't work you can try to reset the pram. Hold the optioncommand+PR buttons after you hear the startup chime, it should chime again, I let it chime a third time just for good measure and see if things look better.
    If that fails then you can try making another account and seeing if the caps lock works in the new account. There might be some strange error on your account that would be corrected for in a new account. After that it gets more labor intensive. Do a system re-install, do an erase and install.
    You might consider a trip to the apple genius bar there in Honolulu if can. The should be able to run through all that for you. You're still under warrantee so take advantage and get some help.
    Oh, and just a disclaimer that I learned from Adam on the maccast podcast. Make a full, complete backup including a time machine and bootable (like superduper or carbon copy cloner) disk before you do any of the above or take the unit it for service.
    Hope this helps.
    John

  • Apple maps satellite imagery doesn't work

    After upgrading to iOS 6 and eagerly trying out the new maps , I was met with disappointment as the satellite imagery function doesn't work, I'm left with a pin surrounded by complete blackness. The normal map view works fine and so do all the other features . Except hybrid and satellite so this includes flyover and all the 3d goodies.
    Help?

    Maybe, but I didn't pay £600 to become a beta tester for Apple. Google maps worked and worked well. Navigation has been a key selling point since the first iPhone and my user experience has deteriorated markedly with the introduction of iOS 6.0.
    If I could roll back, I would but Apple won't let us do that. They haven't given us new maps because that's the best possible solution, they've done it because they want to distance themselves from the creators of Android. If they valued customer opinion then they'd at least provide a Google alternative and allow people to choose which is the default mapping app. Unfortunately Apple now believes its own hype and customers have become something to be tolerated ("it's Apple so they'll buy it regardless" mentality).
    A pity as I would have previously considered myself a "fanboy" who's owned a 3GS, 4, now a 4s (not to mention the iPad 3 I'm typing this on while listening to my Nano).

  • Printing PDDoc with AFExecuteThisScript() doesn't work after an upgrade from SDK 5 to SDK8

    Hello,
    I have made an upgrade of my plug-in which was developed with the Acrobat 5 SDK. I upgrade it to Acrobat 8 SDK and my print function doesn't work anymore.
    Actually I print my document using a javascript trusted function instead the function provided by the C++ library for internal reason.
    Here below is the code used to print my document :
    char szJavaPrint[6000];
    sprintf(szJavaPrint,
    "pp = this.getPrintParams(); \r\n"
    // fill pp with parameters
    "pp.interactive = pp.constants.interactionLevel.silent; \r\n"
    "\r\n"
    "this.trustedPrint(this, pp);"
    PDDoc pdDoc = AVDocGetPDDoc(avDoc);
    AFExecuteThisScript(pdDoc, szJavaPrint, NULL);
    It was working with the Acrobat 5 SDK but the print seems to have no effect using the Acrobat 8 SDK. I know that there is a change between Acrobat 5 and 8 concerning the Character Set (currently I set the Character Set to "Not Set" in the Configuration Properties of the project) but I don't think that my problem comes from the Character Set.
    All ideas to resolve this problem are welcome.
    Kind regards,
    Joe

    See what happens if you remove the "setting of interactive to silent"...
    There is a restriction on silent printing in Acrobat, but I would not have expected that to be passed into this method - but it could have been overlooked and be a bug.
    Also, I don't recall a trustedPrint() method in Acrobat JS - check the documentation for the correct name of this function...

  • After upgrade to IOS 8.3 sync with iTunes doesn't work

    After upgrade iPhone 6, iPad Air to IOS 8.3, the sync (over wifi, as well) to iTunes doesn't work anymore.
    On iMAC iTunes, the last sync's hour and day appear different from what is recorded on mobile devices (iPhone and iPad); with IOS 8.2 and the previous iTunes' version the sync worked correctly: the dates are the same only for few seconds after syncronization, then the IOS devices show the syncronization's dates related to two weeks ago.
    Thanks

    you'll need to contact your carrier.

  • Fit the window with mouse doesn't work after new update 10.9.2

    Hi, I could fit a windows using my mouse wheel or two finger(on trackpad), doesn't work after I set up new Mavericks update(10.9.2) I'm using Haswell rMBP. Can anyone help me please? Thanks a lot. (Also, minimize with mouse wheel doesn't work too.)

    Doesn't anyone having this issue?

  • Synchronization of tasks and interaction logs with Outlook doesn't work

    Dear SAP Experts,
    I'm workink on CRM 7.0 (release 7.7.06.010).
    We are trying to make the synchronization of activities, contacts and tasks from our CRM system to Microsoft Outlook.
    It's working fine for the contacts and for the Apointment BP visit (transaction type Y020).
    But no synchronization made for others activities (interaction log Y007 and telephone calls PCAL) or BP Tasks (Y030) we created in the system.
    We just applied today SAP Note 1415263 and Groupware Integration 3.057.
    I made the settings in the CRM Calendar tab in Outlook (with synchronization from CRM to Outlook), and checked apointment, contacts and tasks.
    In customizing (CRM > Transactions > Basic settings > Define transaction types), I flagged for the following transaction types the little 'Calendar' box: Y020, Y030, Y007 and PCAL.
    In another entry (CRM > CRM Middleware and related components > Settings for client-based synchronization), I indicated the transaction type Y020 for DEFAULT_APPT_PROC_TYPE and Y030 for DEFAULT_TASK_PROC_TYPE.
    Any idea about what is missing or not already done?
    Any help will be apppreciated.
    Thanks in advance for your help,
    Kind regards,
    Grégory KREMSER
    Edited by: Grégory Kremser on Feb 3, 2010 3:13 PM

    We don't have a CAS array set up.  We want the fail over to be fully manual and only fail over to another server when mb1 is in a completely failed state and won't be back up and running withing a set time frame.  We can get everything working
    on MB3 and only Outlook doesn't work when everything is on MB2.  Outlook also doesn't work if databases are on another server and DNS is pointing Outlook to MB2 (again MB3 works fine).

  • Powerdns with MySQL doesn't work

    I recently switched from ubuntu to Arch and I love it. However I have problems with PowerDNS running with MySQL database. When I set pdns.conf to
    launch=gmysql                                                                                                           
    gmysql-host=127.0.0.1                                                                                                   
    gmysql-user=user                                                                                                 
    gmysql-password=pass                                                                                             
    gmysql-dbname=database_name 
    and restart pdns i get this error:
    Oct 22 22:43:34 Archlinux pdns[3337]: Caught an exception instantiating a backend, cleaning up
    Oct 22 22:43:34 Archlinux pdns[3337]: gmysql Connection failed: Unable to connect to database: Lost connection to MySQL server at 'reading initial communication packet', system error: 0
    Socket connection doesn't work either.
    If someone could help me out of this I would be very happy.
    Best regards!
    Jernej

    It works! Thank you! Thank you! Thank you!
    I wasted so many hours combating this...
    I owe you a beer byte! Thx again!

  • 'Alt' with + or - doesn't work

    The adjustment increment of several of the sliders is supposed to be reduced by holding the Alt key down while the + or - key. This doesn't work on my system. I've tried tested both Alt keys with both + and - keys on my keyboard. No luck. All I get is the Windows error tone. Using the Shift key to increase the adjustment increment works as it should. Any ideas out there? TIA, njb

    I consider it's working OK on Windows
    But it's platform dependent !
    To resume :
    Windows   + and -  give  small  increments , shift and + and - give   big increments
    Mac          + and - give  big increments ,  alt and + and - give small increments.
    And the Martin Evenings book is the best LR book for me, though here he's may be not clear enough.

Maybe you are looking for

  • Can't get WiDi working on Portege R705 and Z930

    So frustrating! I had a Toshiba R705 (i3, from Best Buy in the US), which was very nice, until.. I then started to use it for scoring car rallies, and wanted to share my "results" screen with the large tv screen at the local football club where we ru

  • Importing Power Point Slides into FCE

    Hey all, Have a project where I need to use a customer's power point slides in the finished video. Can I import them someway? Or maybe import into Live Type???? Trying to avoid having to type all of them. Thanks, Al

  • Configuring Message archiving

    Hi, while configuration of XI 3.0 for the step <b> Configuring Message Archiving for the Adapter Engine and the PCK</b> on the URL http://<host>:<port>/DataArchivingService/DAS when we click on the link like "Configure Archive Store "under Administra

  • Image retrieval from database

    How can i display an image item (BLOB) of oracle database on an HTML page using JAVA servlets?

  • Configuration not dispplayed on the screen

    Hi, I have created two different configurations for a view. one as default and the other specifying an object type. have done the following coding in the DO_CONFIG_DETERMINATION method of the view implementation class.   data: lv_object_type    TYPE