HELP! Newbie: Unable to update fields

Hello.
I am teacher of a Java course and I am teaching Kodo JDO to my students. But
I am unable to update my persistent fields to the DB. I have a persistent
class Employee with two fields: name and wage. I have the following code:
PersistenceManager pm = JDOFactory.getPersistenceManager();
Transaction tran = pm.currentTransaction();
fillDatabase(pm,tran);
Employee john = getJohn(pm);
tran.begin();
System.out.println("Before update" + determineState(john));
john.wage = 20000.;
System.out.println("After update" + determineState(john));
tran.commit();
pm.close();
Employee John never gets updated to the DB. The program has the following
output:
Before update. Persistent-Clean-NonTransactional
After update. Persistent-Clean-NonTransactional
That is, the field doesn't get dirty.
I attach all the source code to this message. It's a very simple example.
What am I doing wrong? How can I persist my updates to the DB?
Please I'm desperate. I don't know how to do and I need this solution for
tomorrow afternoon (I have class with my students then).
Any help would be gretly appreciated.
Thank you,
Vicent Palas__
begin 666 kodoHELP.zip
M4$L#!!0````(`$H).RVD)9P]$ (``$8$```/````:V]D;RYP<F]P97)T:65S
M?5-=;]I $'R/Q']8*2^M!":!2DA(?BFHJA*24)KV?3FO[2-WM_3N#+B_OGM
MFU0!7C#RS,[LQ_@:[KE@N)L^P=SSFGS4%$"Q*W75>(R:7>>J<W4-SPRT0=-@
M)& /Z\:K&@,!@M&*G/Q[H;8+&QUTA#K&];C?WVZW66"#WE+T6F6*;>=*?OY[
M^2+^V>R@<4]M/AP,:#@<]G!X6]X.1KT1EOAI.>A1.2IOAJ-S`EQ5Y/,0"V[B
M&0Y1]H .*RH6C8O:TNO$^;-'%U"E>0\<_XB6\A5N<-Q_#Z:=)&R7K41X3C[H
M$,DI.N)?A,V^G1@,(3_9C+9K(\5+E=U-/T_.*KRUX77J()NP<[1O9NKUYM@H
M^RJK5C&S-K-M^&6R`W:Q_$<X%GOF>)$YES&V[(N\EC$N:RYF>9IJO.]",F!8
MH:DYQ#ZM2&9FB=H)A2=Y6-F 5GGT#9U@+"BB=C\E@G*N,YQ'=O'U5F@6A,61
MFS(\J=%5VE40:Y+ 1I;T.G:]W^094K@)MMH8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YL;P$8["U>B,
M3Q(/:E<GIM:W=$L!9=X#7'11<9FG_M/)!D.=!-[RHFXPNC8H_!A+035X2*NL
M_9YE4$@$BZA-`H!*VQ)]XJ^2I)903:\^;Q1ZTFFPVN'H6!0M@WOD!GCO),W4
M$@8KS:&F"*T&EZXUC1T2,%LH&F'X3-JP'KQCHKT6_F<CI5UWQGQAP7SXX)JD
MZQL:WTWGA?7Q'#I*[CYTOBI .?YTRGL2SO-E^O O^OF$$^!F)+7%!N;!K5(#
MZ78RA. [,XQOL^[;'?M_JQYYM'3WBJ/K4S!E'.G]`U!+`0(6"Q0````(`#D'
M.RV)RENO@ ```,X````-``````````$`( " @0````!%;7!L;WEE92YJ879A
M4$L!`A8+% ````@`L 8[+<!N;LL;`@``%P4```\``````````0`@`("!JP``
M`$I$3T9A8W1O<GDN:F%V85!+!08``````@`"`'@```#S`@````!02P$"%@L4
M````" !*"3LMI"6</1 "``!&! ``#P`````````!`" `@($`````:V]D;RYP
M<F]P97)T:65S4$L!`A8+% ````@``@<[+8C8QR*'`@``G 8``!$`````````
M`0`@`("!/0(``%1E<W1%;7!L;WEE92YJ879A4$L!`A8+% ````@`E0([+6-!
MX#U3````;0````T``````````0`@`("!\P0``&5M<&QO>65E<RYJ9&]02P$"
M%@L*``````#1"3LMVC!\3H$#``"!`P``#0```````````" `@(%Q!0``96UP
@;&]Y965S+GII<%!+!08`````! `$`/(````="0``````
`
end

Thank you very much, Abe.
Of course, I always advocate the benefits of encapsulation with my students.
In this example, I declared my fields as public only because I was trying
with private fields and it wasn't working (I don't know why). So I try with
public fields to see whether it would work.
Anyway, I had encapsulated my fields and everything worked OK. I was in
trouble (the class is only some hours away and some of my students are
prospects of customers so my image is fundamental). You have get me out of
trouble.
Thank you for your help.
Vicent Palas__
"Abe White" <[email protected]> escribi__ en el mensaje
news:an1rrf$bnk$[email protected]..
john.wage = 20000.;JDO detects field updates by modifying the bytecode of the class accessing
the field. When you use public fields, that means all classes thataccess
the fields need to be run through the enhancer, even if some of thoseclasses
are not persistent themselves (note: only persistent classes
should have metadata -- the enhancer uses the presence of metadata to
determine whether to make the class persistent or just modify persistent
field access to other classes).
Because it's a pain to track which non-persistent classes accesspersistent
fields of persistent classes, we recommend that you keep your persistent
fields private, or protected and only accessed by subclasses. Plus, as a
teacher, I would think you'd be advocating the benefits of encapsulation
anyway :)

Similar Messages

  • Help! Unable to update Adobe CC applications

    I am an active CC member but I am unable to update certain CC applications through the Creative Cloud desktop application or by using the *Updates* button under *Help* under each application. For some reason, the *Updates* button is always greyed out.
    I successfully updated Muse, Edge Animate and Dreamweaver earlier today, but I am unable to update other applications like Photoshop, Illustrator, InDesign etc. Can you please help me out with this?
    Regards,
    RK

    Are you an enterprise customer?
    Please refer:
    http://helpx.adobe.com/creative-suite/kb/disable-auto-updates-application-manager.html
    Make sure your updates are not disabled and remove files which suppress updates as mentioned in the link.
    Regards,
    Ashutosh

  • HELP..Unable to update my Nokia N85 Device Softwar...

    i just bought my Nokia N85, and its current device software version is 20.175,
    i checked the latest deveice software vesion for N85 is 30.019....
    but, when i key *#0000# into my phone's home screen and select Options > Check for updates, it showed no update available!
    anyone can help or advice me on this? 

    if your phone is locked to a network you will have to wait for them to approve of the update read the following
    from grschinon
     /discussions/board/message?board.id=topfaq&thread.id=114
    If  i have helped at all a click on the white star below would be nice thanks.
    Now using the Lumia 1520

  • CAN SOMEONE HELP? , unable to update mini ipod

    I found out I have 2 libraries, but there is no music in the second. When I try to update, itunes shows the process happening but ipod is empty. To even do this I have to drag library icon to ipod icon because the inital screen is empty. i've tried to update with manual & auto. With auto a window pops up asking if I want to merge libraries. I tried options yes and no. With the yes option it will show itunes updating but ipod still empty after completion. HOW did I create the 2nd library and is that why music is not showing up on ipod mini?

    Are you an enterprise customer?
    Please refer:
    http://helpx.adobe.com/creative-suite/kb/disable-auto-updates-application-manager.html
    Make sure your updates are not disabled and remove files which suppress updates as mentioned in the link.
    Regards,
    Ashutosh

  • Unable to update Logical Delete field in AS400

    hi all,
    We have an ESB process that polls for data in AS400 DB and transfers this data into an Oracle DB. This polling is based on Logical Delete. The data transferred is in the range of some lakhs of records. So we are sending around 5000 records per transaction in ESB. When we deploy the process, the data in AS400 is being read and getting transferred. However, the status field is not changing to 'Read Value'. Due to this, we are facing a lot of issues like, when we're in middle of data transfer and the opmn restarts, the data which has already been transferred is also being read and this is throwing an error because of primary constraint violation. Even after the data transfer, if we delete any rows in Oracle DB, the data transfer resumes as the status field is not updated.
    I have worked with logical delete in Oracle DB before and was working fine.
    Please help me with Logical Delete functionality in case of AS400 Database and also please let me know the privilages we need to have on the AS400 DB to successfully run this process.
    Thanks,
    Kamal.

    Hi,
    According to your post, my understanding is that you was unable to update managed metadata field in designer workflow.
    You need to provide the exact string for the MMS value, in the form of <id>;<value>.
    The format of the value you wanted to set is uncorrectly, so you cannot update the managed metadata field.
    If you want to set the managed metadata field value with correct format, you’d better to create custom action.
    There is an article for your reference, although it is about the SharePoint 2010, it is similar to SharePoint 2013.
    http://patrickboom.wordpress.com/2013/07/23/workflow-activity-set-managed-metadata-column/
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Unable to update Requester and Deliver to location field in iProcurement

    Hi,
    I am unable to update the 'Requester' and 'Deliver to location' field in iProcurement Preferences.
    i am trying to change the default settings in IProcurement Prefernces(MyProfile page(xml))
    1)Navigation ->iProcurement Hompage->Preferences->iProcurement Preferences
    2)Modified Requester and Deliver-to-location and clicked Apply changes
    3)Logged Out and again logged In. the changes are gone.Its showing me the old data.
    Please help..if someone faced this issue..
    I am using Oracle 11.5.10.
    TIA.

    Hi TIA,
    check out the profile options:
    ICX: Override Location Flag or POR: Override Location Flag
    ICX: Override Requestor or POR: Override Requestor
    The naming varies in the manual compared to my test-environment. Flipping this did the trick for me!
    They control whether a user is allowed to override the default requestor and the deliver-to location in the requisition and apparently also the preferences.
    The following profile options holds the values set by a user in the preferences as per your requirement:
    POR : Preferences - Deliver to Location
    Enables requesters to set their preferred deliver-to location.
    POR : Preferences - Requester
    Enables requesters to set a default requester
    /Niels LM

  • HT204266 My iPad (version 1, IOS 5.1) has quit connecting with the store. I am unable to update or buy any app. I did a reboot and a reset with deleting the data. I can not find anything in support for this problem. Any help will be appreciated.

    My iPad (version 1, IOS 5.1) has quit connecting with the store. I am unable to update or buy any app. I did a reboot and a reset with deleting the data. I can not find anything in support for this problem. Any help will be appreciated.

    My iPad (version 1, IOS 5.1) has quit connecting with the store. I am unable to update or buy any app. I did a reboot and a reset with deleting the data. I can not find anything in support for this problem. Any help will be appreciated.

  • I am unable to update my apps... in my purchases page it appears as "update", then a message tells me to log on with the Apple ID I purchased the app with... Well I have tried my two different accounts and neither one will work, can someone help ??

    I am unable to update my apps... in my purchases page it appears as "update", then a message tells me to log on with the Apple ID I purchased the app with... Well I have tried my two different accounts and neither one will work, can someone help ??
    And is there any way to sync all my purchases and accounts to just have one... It is a bit stupid that you dont even get a list of something of what account you may of used, or some kind of hint, so you could log on to the right account. I am really stuck ...
    Please Advise......

    You can't merge accounts. But you can check your purchase history:
    iTunes Store & Mac App Store: Seeing your purchase history and order numbers
              http://support.apple.com/kb/HT2727
    Also, what may seem stupid to you... may be a protection of privacy to others.

  • I have the latest itune but i am unable to update my phone or my ipad 2 i have been in to the shop and they said i need to download a diffrent type of itunes for wifi can you please help

    I have the latest iTunes but am unable to update my phone or my ipad 2 I have been in to the shop and they said I need to download a different type of iTunes for wifi I have a desk top with windows vista and wifi can you please help

    We'll need more information before anyone can be of much help. What model iPhone is it, what versions of iOS are running on the iPad 2 now, what exactly are you trying to update, and what version of iTunes are you running? And what exactly is going wrong (include error messages if any).
    Once we have that information, someone here can probably offer advice. Note that you cannot sync content or upgrade iOS wirelessly until you get your iPhone and iPad up to iOS 5 and that requires that you connect those devices to your computer via the Dock-USB cable.
    Regards.

  • When I went to update my iPod touch on iTunes, it said unable to update then the iPod shutdown and no longer showed connected in iTunes.  I have tried holding down both buttons for up to 3 mins with no luck turning it on, even after a full charge.  Help?

    When I went to update my iPod touch on iTunes, it said unable to update then the iPod shutdown and no longer showed connected in iTunes.  I have tried holding down both buttons for up to 3 mins with no luck turning it on, even after a full charge.  Help?

    Try:
    - iOS: Not responding or does not turn on
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - Try on another computer                            
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
    Apple Retail Store - Genius Bar                                     

  • Unable to update itunes. help. error message when trying to update to latest version of itunes. "the installer has encountered an unexpected error installing this package. this may indicate a problem with this package. error code 2721"

    unable to update itunes. help. error message when trying to update to latest version of itunes. "the installer has encountered an unexpected error installing this package. this may indicate a problem with this package. error code 2721"

    Hello chae84swangin,
    I recommend following the steps in the article below when getting an error message trying to install iTunes:
    Trouble installing iTunes or QuickTime for Windows
    http://support.apple.com/kb/HT1926
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • I am unable to update the software for my 4s. I am also unable to connect to the app store or itunes, it does not give an error message just says that i am unable to connect. Please help

    I am unable to update my software in settings, just says an error occured. I am alsos unable to connect to the app and itunes store. (no error message occured) just says unable to connect. I am using cellular data and its turned on. Help me please

    Lyndsay237 wrote:
    This device does not have a sim card in it. Could this be the reason or am I missing something when I am trying to update.
    Yes. You can't update or restore any GSM iPhone without a valid sim card installed in the phone. The sim card need not be activated, but it must be valid & present. If you want to update, you need to get a sim card.

  • I am unable to update, uninstall, or reinstall iTunes on my laptop.  Windows 7 Ultimate 32 bits.  Error code is 2330.  Can somebody please help me?

    I am unable to update, uninstall, or reinstall iTunes on my laptop.  Everything was working fine until recently when there was an update available for iTunes, and when I tried to update this, I got the message, "The installer has encountered an unexpected error installing this package.  This may indicate a problem with this package. Error code is 2330."  Can somebody please help me?
    System configuration:
    Windows 7 Ultimate 32 bits.
    Version:  6.1.7601 Service Pack 1 Build 7601
    System Directory:  C:\Windows\system32
    RAM:  1.00 GB.

    For general advice see Troubleshooting issues with iTunes for Windows updates.
    The steps in the second box are a guide to removing everything related to iTunes and then rebuilding it which is often a good starting point unless the symptoms indicate a more specific approach. Review the other boxes and the list of support documents further down the page in case one of them applies.
    The further information area has direct links to the current and recent builds in case you have problems downloading, need to revert to an older version or want to try the iTunes for Windows (64-bit - for older video cards) release as a workaround for installation or performance issues, or compatibility with QuickTime or third party software.
    Your library should be unaffected by these steps but there are also links to backup and recovery advice should it be needed.
    tt2

  • Unable to update to ios 5 on windows 7. please can someone help me i have tried everything? i deleted itunes and downloaded the new version when i plug my iphone 4 in it does a back and then I try and update the software it extracts error 3194

    unable to update to ios 5 on windows 7. please can someone help me i have tried everything? i deleted itunes and downloaded the new version when i plug my iphone 4 in it does a back and then I then everything runs normal and it extracts and then i get an error code at the end 3197. had the iphone for two months and its new.
    Please can somene help me, i am currently on version 4.3.3 (8J2)
    Modem Firmware 04.10.01

    followed someones instructions and it has worked ios 5 is now working on my iphone 4

  • Unable to update BLOG field

    Can any one help me to solve this problem?
    Am updating worklog field in one of our application which is of type binay large object.
    this is the syntax:
    Update T61 set C536870928='hrtut' where C536870928='koko'
    But it is giving me the following error
    ORA-00932: inconsistent datatypes: expected BINARY got BINARY
    can anybody help how can we update this field??
    Pls helpme as this is very urgent

    It's because of bug 4401822 which apparently has been fixed.

Maybe you are looking for

  • Copy file from local system to Azure VM using powershell

    Hi Is there a simple powershell command to copy a small file from local computer to Azure VM. Point to Site is not an option for me. I am hoping for something simple like Copy-Item C:\Wabash\Logfiles\trasfer.txt -Destination C:\Presentation -Connecti

  • How much work is it to create a custom flash player with chapter navigation

    I am bidding on a job to do a simple instructional video that will be about 2 minutes in length.  The client wants me to put the video in a flash player that has some buttons on it that a user can click on to go to a specific step.  The instructions

  • Can't pair macbook air with muse mini blue tooth speaker?

    I am trying to pair up my new Muse Mini blue tooth speaker and my MacBook Air  computer wont even recognize it. I am able to pair it to my iphone5 and it works wonderful. I would appreciate any assistance solving this. Thanks Jim

  • I have my photos neatly arranged in photoshop elements 9 in windows xp.

    I have just purchased a new computer with windows 8.1. My old computer has windows xp. I have a ton of photos stored and neatly arranged on my elements 9 photoshop with only a fraction uploaded to revel. How do I upload the remainder of my photos wit

  • I have A large avi file but cant burn it in idvd

    So i have an avi movie file, 802mb. I want to be able to burn this to a dvd and have it play in any dvd player. I really dont care about titles and such. Every time i open idvd i drag the movie under the menu then it says, "+Your project exceeds the