TopLink caching behaving strangly?

Hi folks,
Realizing that my previous post titled 'Session#acquireUnitOfWork() resets identiy maps' at Session#acquireUnitOfWork() resets identiy maps may be a bit muddleheaded I'll take a different approach at the same problem.
I'm not yet very familiar with TopLink caching (links to good articles greatly appreciated) but the behaviour we see here still does not make sense to me. Caching is provided by identity maps referenced by the server session. That much I understand. So, every time an application reads/writes data from/to the database TopLink would update those identity maps - if necessary. Based on that I assume that those maps remain untouched as long as I do not modify a certain object and commit those modifications.
[Pseudo code]
1: TopLink.save(obj1)
2: obj2 = TopLink.read(queryForObj1)
3: obj1 == obj2
It all boils down to the simple question why obj1 and obj2 are two different instances? I would expect them to be one and the same instance.
I would greatly appreciate if someone could provide some clarification.
Regards,
Marcel

Hello Marcel,
Your question in this and the other thread touch on how the UnitOfWork and TopLink caching works. Basically what you are seeing is probably because you are reading instances from different UnitOfWork objects. Each UOW has its own cache to maintain transactional issolation. Using a UOW will return a cloned copy of the object contained in the central cache so that you can modify it without changes being seen outside the transaction. On commit, the changes in the clone are put in the database and merged into the object in the main cache. Only changes made to the UnitOfWork working copy of an object will be persisted, but you can read from the session or ClientSession directly instead of the UnitOfWork - this will return the copy from the central cache.
When you commit/release a UnitOfWork, all working copies become detached; changes will no longer be persisted to the database.
I would recommend looking over the white paper on the UnitOfWork at:
http://www.oracle.com/technology/products/ias/toplink/technical/unitOfWorkWP.pdf
Best Regards,
Chris

Similar Messages

  • Finder behaving strange

    Hi everybody,
    After upgrading to Mac OS X 10.10 Yosemite, my Finder is behaving strange. Every time I open op a new Finder window, it appears like below image. The icons look very strange and they are not clickable, well you can click something and notice a change in the window name in the top.
    I really don't know what is happening, nor don't I know what to search for, to find a solution, as I even can describe i properly.
    My Mac specs is as below:
    I hope some of you guys might be able to help!
    Love and cheers!
    Kenn Nielsen,
    Denmark

    Is Dropbox the only application you are seeing this in? Try the list and column view to see if you get the same thing.
    Try a restart.
    Do a backup, using either Time Machine or a cloning program, to ensure files/data can be recovered. Two backups are better than one.
    Try setting up another admin user account to see if the same problem continues. If Back-to-My Mac is selected in System Preferences, the Guest account will not work. The intent is to see if it is specific to one account or a system wide problem. This account can be deleted later.
    Isolating an issue by using another user account
    Try booting into the Safe Mode using your normal account.  Disconnect all peripherals except those needed for the test. Shut down the computer and then power it back up after waiting 10 seconds. Immediately after hearing the startup chime, hold down the shift key and continue to hold it until the gray Apple icon and a progress bar appear and again when you log in. The boot up is significantly slower than normal. This will reset some caches, forces a directory check, and disables all startup and login items, among other things. When you reboot normally, the initial reboot may be slower than normal. If the system operates normally, there may be 3rd party applications which are causing a problem. Try deleting/disabling the third party applications after a restart by using the application un-installer. For each disable/delete, you will need to restart if you don’t do them all at once.
    Safe Mode - Mavericks
    Safe Mode - About

  • How do I sync Toplink Cache with my Database?

    Hey guys,
    We are running macro's through an excel sheet that connects to the database and performs Updates and Inserts.
    Since this database update is NOT taking place through TopLink (in a Unit of Work) - we do not see the database changes through the web app on the front end unless we bounce our webserver. Presumably the Toplink cache is re-built on start up...so then we can see the changes.
    My question is, what can I do to make sure the TopLink cache is aware of the database changes we have made through the macro without having to bounce the server? Is there a re-fresh or sync command that can be run?
    This task is sort of a one time thing, so I don't want a solution that involves the cache going to sync itself on a schedule or anything like that. Maybe bouncing is the best solution?
    Thoughts?
    We are using Toplink 9.0.4
    Thanks.

    Hello,
    Because it is a one time thing, if you can make sure no other TopLink process are going on, you can probably get away with initializeAllIdentityMaps() or the intitializeIdentityMap(Class) methods on the session. These will clear the identity maps, having the obvious draw back of removing all object identity which will cause problems with running processes though. It might be better than bouncing the server - it depends on the application. Logging out of the session and logging back in has the same effect of clearing the cache, but with a bit more overhead. Benifit is that running processes will get errors if they continue to use the session, rather than strange behaviior if they continue to use objects after identity is lost.
    Another alternative is to run refresh queries on the data you know might be in the cache or that might have been affected. Drawbacks are that this brings them into the cache if they are not already there.
    TopLink 9.0.4 is a quire a few versions back, and in newer versions there is cache invalidation. An object marked as invalid is not removed, so object identity is maintained, but on the next query the data will be refreshed - ensuring subsequent queries will get results from the database without having to be told explicietly to refresh or being set to always refresh. Invalidation can be triggered on particular objects, classes or the entire cache or different policies can be set to set a time to live etc.
    Except for bouncing the server or logging out of the session, all of the above leave some possibility that a concurrent user will still have a reference to stale data and continue to use it after the process has run on the database. So I hope you use optimistic locking and that your batch process updates the version to avoid other process from overwriting with stale data.
    Best Regards,
    Chris

  • Database Change Notification and TopLink Cache Invalidation

    Has someone succeeed in implementing the How-to Database Change Notification and TopLink Cache Invalidation.
    I have corrected some document errata about the pl/sql content and I manage to have messages in the 'notify_queue'.
    I obtain the Topic in Java from this queue.
    But the TopicSuscriber instances do not receive any message. Is there something to have in mind to make it work ?
    Regards.

    Reviving this thread again...
    I am using DCN feature to build a middle-tier cache. I know oracle has problem sending physical rowid in case of 'Index Organized Table', however, in normal table also its not able to send proper rowid.
    e.g, I have 2 records in Table A with rowid AAARIUAAGAAAV/uABw and AAARIUAAGAAAV/pAAX.
    I have updated both the records. Strangely for the first record, oracle is sending INVALID rowid, although for the second record its sending the valid one.
    Following is the output:
    Row 1:  (Wrong rowid being sent, AAARIUAAGAAAV/uABw is replaced with AAARIUAAGAAAXDCAAr)
    Connection information  : local=localhost.localdomain/127.0.0.1:47633, remote=localhost.localdomain/127.0.0.1:2278
    Registration ID         : 2102
    Notification version    : 1
    Event type              : OBJCHANGE
    Database name           : <sid>
    Table Change Description (length=1)
        operation=[UPDATE], tableName=<table_name>, objectNumber=70164
        Row Change Description (length=1):
          ROW:  operation=UPDATE, ROWID=AAARIUAAGAAAXDCAAr
    Row 2:  (Right rowid being sent, AAARIUAAGAAAV/pAAX)
    Connection information  : local=localhost.localdomain/127.0.0.1:47633, remote=localhost.localdomain/127.0.0.1:2278
    Registration ID         : 2102
    Notification version    : 1
    Event type              : OBJCHANGE
    Database name           : <sid>
    Table Change Description (length=1)
        operation=[UPDATE], tableName=<table_name>, objectNumber=70164
        Row Change Description (length=1):
          ROW:  operation=UPDATE, ROWID=AAARIUAAGAAAV/pAAX
    Any idea ?

  • Toplink Cache not refreshed

    In my project, TOPLINK is used. To carry out the CRUD operation, Stored procedures are used on all objectcs.
    Toplink query is not used.
    In some cases, since we wanted to use the existing Stored procedures for running the business logic, toplink is not used.
    After running these procedures, we refresh the Toplink Cache by using "refreshObject(java.lang.Object p1)" method of UnitOfWork before we read the Object.
    When we read this object, the data appears to be in sinc with what is present in the database tables.
    But when we write the data once again to the database, Toplink some how refers to the Old data ( Data which was present before refreshing).
    It seems to be a strange issue.
    Kindly help.

    If you call refresh on an object already loaded in the UnitOfWork, and the object was modified before you call refresh, the refresh will override the modification done to the object.
    You should never need to call refresh.
    What you should do instead of refresh is to invalidate on session cache so when ever you read the object later, it will be refresh if was invalidated, so more efficient.
    If you use TopLink 11 JPA api you need to flush to get current transaction/uow see the modified data in db.
    But realistically, stored procedure do not work well with O-R framework, and you say Toplink query is not used, why not removing TopLink from the equation? If you want better JDBC you can use iBatis or Spring.

  • Just done a fresh install of Snow Leopard with all updates,iMac 5.1 behaves strange, sometimes I start Google Chrome and look at youtube videos the computer freezes and shuts down immediately, I believe its  related to overheating ?

    Just done a replacement of the pata DVD drive (its new and is working ok),  and a fresh clean  install of Snow Leopard with all updates, iMac 5.1 behaves strange, sometimes I start Google Chrome and look at youtube videos the computer freezes and shuts down immediately,
    I believe its  related to overheating ?
    iStat Pro shows GPU diode temp at 66 C, CPU at 48 C,  Fan rpms is around 1000
    Any ideas somebody ?
    The hard disk has been previously checked with state of the art techniques that have confirmed that the hard disk drive is in perfect condition.

    1.5-3 minute boot up as opposed to 15-20 seconds
    And
    why it takes a long time to load a lot of things.
    I have restored this
    from a time machine partition.
    TimeMachine is only a backup and restore, it won't fix issues in software and according to your information, doesn't even optimize the restore for best performance on boot hard drives.
    What you need to do to regain your speed is to understand how your machine works
    Why is my computer slow?
    Fix any and all issues in software following this list of fixes
    ..Step by Step to fix your Mac
    Then follow this defrag method I've outlined
    How to safely defrag a Mac's hard drive
    Most commonly used backup methods
    There shouldn't be need to reinstall OS X fresh unless your having file structure issues which if they are should appear when in the Steps, which then a zero erase and install will cure as well as any bad sector issues, the defrag step wouldn't be necessarry on a freshly installed system obviously as the files are written all together, not in portions all over the drive.
    Hope this assists.

  • Has anyone ever encountered layer blend modes behaving strangely?

    I use photoshop quite a bit for retouching and photo compositing. Tonight I encountered a strange problem. I was trying to create a vintage look on a photo and had a number of adjustment layers including a curves, levels, color fill and there were also a few texture/noise layers all set to varying opacities. Near the top of all this I had a vignette layer that was black around the edges and white in the center set to blend mode of multiply. Well, when I was clicking on and off I realize that that vignette layer was definitely lightening the center part of the overall image quite a bit (the part that is white on the vignette layer), almost like a screen. So I flipped the vignette layer through different opacity modes and saw that there was no change in its behavior, every mode was screening the white, even darker color and multiply. I thought maybe it was interacting in a weird way with one of the other layers so I turned all the others off except the back ground-- still no change. Then I dropped the layer down one at time until it was below the background. When I started to move it up again, it was behaving normally for a moment until I moved it up a couple levels in the stacking order and then it went back to the screen behavior. Anyway I shuffled it around a bit but there was no consitency to when it would display the correct opacity and when it wouldn't, so it did not seem to be an interaction with any specific layer. I don't know, but I can't really think of any case where white set to multiply should produce a lighter result even if it were interacting with another opacity. In any case it does seem to me that there is something going on with the overall computation of opacities. I tried creating a new black and white layer and it was also doing the same thing, behaving strange and not displaying the correct opacity.
    I'm tired, so I'm going to bed. I'm going to shut off the computer and hope this goes away when I reboot, but if it does not, does this sound familiar to anyone? I'm not a regular visitor to this forum, but I thought I'd put it out there in case anyone else has experienced anything like this. I've only got 5 gigs of ram on this computer and I've been working away for a while... maybe photoshop just couldn't keep up(?) I'm using Photoshop CS5, RGB Adobe 1998 colorspace.  I've never had anything like this happen in the last 11 years I've been using photoshop. Hmmm.... hope I don't have to reinstall or call support or worse. fingers crossed.

    Nevermind. It is still having the problem. I have to think that this file is just corrupt somehow because I just opened another file and can't seem to cause the same problem. Basically, I can fill a layer with white, put it to a blend mode of multiply or darker color and it will block out everything of the image below, ie totally opaque. The opaqueness varies depending on the if there are other layers also on blend modes, but it does not seem to correspond to normal blend mode interaction. If I put it right on top of a regular layer with an image on it, it totally blocks it out on a blend mode of multiply... weird. I am going to scrap this file and see if the problem recurs in other files. My 2006 Mac Pro is getting some years on it and has been running pretty slow. I'm not a hardware expert but I've done everything I know how to do to maintain it. Was thinking of upping the ram to see if I can hold out a bit longer before I upgrade the computer. Wouldn't surprise me if this problem is related to the computer.

  • Metronome behaving strangely

    When I press the record button in GB 3.0.4 The level meter displays a pulsing level, but I hear no sound for the metronome until I depress a key on my MIDI keyboard. This remains true whether I have it set to "Count In" or not. Another curious problem is that if I set the metronome to play during both Playback and Recording, I don't hear it during playback, until it reaches a region. For example, if I start playing from m. 1 but no instruments enter until m. 2, I don't hear the click start until after the instruments enter.
    Anyone else having this problem? Any ideas what might be causing it?
    Thanks,
    Michael

    Hangtime, thanks for your help, but the issue isn't the volume of the metronome. Normal GB functionality is that if you have Metronome selected to be "on," then when you click on the Record button you immediately hear the metronome, as well as see the click registering on the meter. I don't hear it, even though it is registering on the meter, until I depress a key on my MIDI keyboard. Then I hear it just fine. I've been working with this software since version 1 came out, and I've never had this problem before. I also have Sibelius, Logic, and Reason, so I am wondering if I may have unknowingly tweaked some setting that is making MIDI in GB behave strangely.

  • Why is my MacBook display behaving strangely?

    I am using an alumin(i)um MacBook (13", late 2008 model with multi-function glass trackpad). In the past couple of weeks, the display has started to behave strangely. The screen seems to freeze (meaning any mouse movements or keystrokes do not display), and then the screen begins to fade to grey. It seems to be resolved by tilting the display until the MacBook "wakes". There has also been some occasional flickering of the display, although far less frequent. Could someone help me with this? Is it something like a loose connection, and, if so, how should I deal with it? (The MacBook is now out of warranty, so my next step would be my local Apple store). Thanks in advance!

    Same thing happening to me - began about four weeks ago, two weeks after warranty expired. Has gotten to the point where it's difficult to use the computer - don't get through composing an e-mail before it starts to fade - now know that even though computer display is frozen, the keystrokes are still getting through, so be careful what keys you press trying to get it to pay attention!
    I believe it's going to turn out to be a connection problem between the computer and the display in the hinge area. I found out yesterday that as it freezes, and I start to pick it up off my lap and put it aside, if I pick it up with my left hand near the lower left of the keyboard and my right hand behind the display, down low near then hinge, and pulling slightly towards me, this fixes it (for a while), and this is (for me) the most reliable way to wake it back up. I've seen references elsewhere to this being a simple problem where a connection is maintained with a black foam pad to provide pressure to the connection. I think the foam must degrade or lose resiliency (apparently at 12.5 months from purchase!) and there may be a simple solution available. When I figure it out for this particular model, I'll post my conclusions.

  • My Macbook Air behaves strangely with my USB devices.

    Hello! My Macbook Air behaves strangely with my USB devices. They appear in the Finder but the icon then quickly disappears, as if the device has never been connected. Sometimes the devices work fine, however. Could you please help me identify the problem?

    USB draws power from the MBA, and MBA will shut them down if too much is taken.  Try a self-powered (not USB-powered) hub, to see if the AIr acts better.  Costs about $25 at BestBuy.
    May not tbe the final solution, but no a bad idea anyway.

  • How to Add Index in Toplink Cache

    Hi
    We are using toplink as ORM.we are using default cache option (soft cache weak identity)provided by toplink, need to optimize the object retrival from cache, is there any option to create Index ( like database index) on the toplink cache.
    Message was edited by:
    [email protected]

    The TopLink cache is indexed by primary key only. It does not support additional indexes.
    Doug

  • Querying the toplink cache under high-load

    We've had some interesting experiences with "querying" the TopLink Cache lately.
    It was recently discovered that our "read a single object" method was incorrectly
    setting query.checkCacheThenDB() for all ReadObjectQueries. This was brought to light
    when we upgraded our production servers from 4 cores to 8. We immediatly started
    experiencing very long response times under load.
    We traced this down to the following stack: (TopLink version 10.1.3.1.0)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x00002aab08fd26d8> (a oracle.toplink.internal.helper.ConcurrencyManager)
    at java.lang.Object.wait(Object.java:474)
    at oracle.toplink.internal.helper.ConcurrencyManager.acquireReadLock(ConcurrencyManager.java:179)
    - locked <0x00002aab08fd26d8> (a oracle.toplink.internal.helper.ConcurrencyManager)
    at oracle.toplink.internal.helper.ConcurrencyManager.checkReadLock(ConcurrencyManager.java:167)
    at oracle.toplink.internal.identitymaps.CacheKey.checkReadLock(CacheKey.java:122)
    at oracle.toplink.internal.identitymaps.IdentityMapKeyEnumeration.nextElement(IdentityMapKeyEnumeration.java:31)
    at oracle.toplink.internal.identitymaps.IdentityMapManager.getFromIdentityMap(IdentityMapManager.java:530)
    at oracle.toplink.internal.queryframework.ExpressionQueryMechanism.checkCacheForObject(ExpressionQueryMechanism.java:412)
    at oracle.toplink.queryframework.ReadObjectQuery.checkEarlyReturnImpl(ReadObjectQuery.java:223)
    at oracle.toplink.queryframework.ObjectLevelReadQuery.checkEarlyReturn(ObjectLevelReadQuery.java:504)
    at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:564)
    at oracle.toplink.queryframework.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:779)
    at oracle.toplink.queryframework.ReadObjectQuery.execute(ReadObjectQuery.java:388)
    We moved the query back to the default, query.checkByPrimaryKey() and this issue went away.
    The bottleneck seemed to stem from the read lock on the CacheKey from IdenityMapKeyEnumeration
    public Object nextElement() {
    if (this.nextKey == null) {
    throw new NoSuchElementException("IdentityMapKeyEnumeration nextElement");
    // CR#... Must check the read lock to avoid
    // returning half built objects.
    this.nextKey.checkReadLock();
    return this.nextKey;
    We had many threads that were having contention while searching the cache for a particular query.
    From the stack we know that the contention was limited to one class. We've since refactored that code
    not to use a query in that code path.
    Question:
    Armed with this better knowledge of how TopLink queries the cache, we do have a few objects that we
    frequently read by something other than the primary key. A natural key, but not the oid.
    We have some other caching mechanisms in place (JBoss TreeCache) to help eliminate queries to the DB
    for these objects. But the TreeCache also tries to acquire a read lock when accessing the cache.
    Presumably a read lock over the network to the cluster.
    Is there anything that can be done about the read lock on CacheKey when querying the cache in a high load
    situation?

    CheckCacheThenDatabase will check the entire cache for a match using a linear search. This can be efficient if the cache is very large. Typically it is more efficient to access the database if your cache is large and the field you are querying in the database is indexed in the table.
    The cache concurrency was greatly improved in TopLink 11g/EclipseLink, so you may wish to try it out.
    Supporting indexes in the TopLink/EclipseLink cache is something desirable (feel free to log the enhancement request on EclipseLink). You can simulate this to some degree using a named query and a query cache.
    -- James : http://www.eclipselink.org

  • Refresh toplink cache from tirgger

    How to update the toplink cache due to change in the database by some external process or procedure?
    This question was posted some time back and one of the suggestion was to create a trigger on the table holding the data and implement callout to the toplink cache to refresh. I will appreciate if any one can let me know where I can I find more information to implement such a callout method from trigger on the database table.
    We are accessing the toplink objects from OC4J container from where a singleton is managing the calls to the toplink objects. We already have methods in place to refresh the cached object based on timeouts but now the new requirements are to refresh the objects only if the data is changed in the database.
    Thanks
    Ahmad

    I have url error on this thread : How to refresh cache in TopLink, turn off cache
    [b]Discussion Forums Error
    We cannot process your request at this time. Please try again later.
    Thank's

  • Toplink Caching issue

    I have three Entities say C1 , P1 and card. Relation between these
    entities are like this
    P1 to Card ( one - one mapping )
    C1 to Card ( one - many mapping )
    I have three usecases. Usecase 1 uses the mail Entity C1. It will
    create one record using C1. ( keep in mind that there will not be any data for entity card at that time ).
    Second usecase , Usecase 2 , uses Entity P1 and creates data in P1 as
    well as Card.
    Third usecase will again take C1 and try to get the card data which
    were inserted through P1.
    But unfortunately , it is coming as null ... But if I restart the server and access the third usecase then I'm getting all the card data from C1 Entity which were saved through P1 Entity .
    To summarise my finding , issue is with Toplink caching. When i
    accessed the first usecase, C1 is cached. In the second usecase , I updated Entity card using P1. When i accessed the third usecase , toplink is returing the cached entity. Toplink is not able to identify whether related entity got changed or not....
    Workaround is not to use cache for C1 entity. It is working but it will
    not be the correct solution.
    any one faced this issue in Toplink ?
    Correct me if my findings are not correct...

    Hello,
    Its not that the cache isn't working, its that you are updating relationships in the database but not in the cache. Take the case of a 1:M from B->C used in a previous response. It looks like the foreign key used in this relationship (in the C table) is mapped to the C object either as a direct to field mapping, or through a 1:1 to the A object. When you change this so that it now somehow points to the B object, you haven't updated the B object to include the C in its collection. Because B has a 1:M mapping collection of Cs, when you next get that B object from the cache, its collection will not contain the newly referenced C (assuming indirection is not used or has been previously triggered). This is a result of you mapping the 1:M in the first place - since it is storing the collection in the object.
    If you are going to make changes that affect relationships and yet not update the relationships directly I would suggest either:
    A) refreshing affected objects from the database when done. In this case, refreshing the B object will result in TopLink requerying the B->C relation and picking up any changes (depending on your refresh options on the B descriptor though - please check the docs if you need more info).
    B) Not mapping these relationships. Instead, when you need to find C objects referenced from B, query for them.
    Both options are less efficient as they cause more hits to the database. This is why it would be preferred if you updated the relationships when you change fields that affect those relationships, but it is up to you to decide which will work best for your application.
    Please note that the cache is working, in fact the situation you are seeing is due to it working. I am not sure of how your situation would work with DAO as you mentioned in a previous post, but it sounds like it would always hit the database. This situation is a result of you making changes in the database but not changing the object model to reflect those changes, proving that the cache is indeed working. While you mention that some objects are not in your use case, they are in the database but just not mapped in TopLink. In the case of a 1:M mapping, the database shows a 1:1 back relationship that you have not mapped in your object model. So this would be more a case of your object model not matching your database model, and not being taken into account in your use cases.
    Best Regards,
    Chris

  • After waking from sleep bluetooth mouse behaves strangely

    Hello
    I have this issue . First of all i have Allow bluetooth to wake from sleep but it doesn't happen but i don't really care about that.
    Most important thing is that after waking up from sleep my mouse has lag when moving , the mouse behaves strangely and movement of mouse is not natural .Restarting or shutting down doesn't fix it .
    Anyone knows why this happens?

    Try resetting the PRAM and SMC.
    Barry

Maybe you are looking for

  • JRE 1.5 plugin for Firefox on Linux works as root but not as an other user

    I am trying to usel the JRE plugin for Firefox on Fedora Core 4. I downloaded and installed it as "root" and created the symbolic link so Firefox can "see" it. It now works just fine if I run Firefox as "root", but if I run it as any other user, it t

  • AQ: How to query user_data?

    Hi, I want to query my queue_table.user_data column. I must find out whether there is an entry in the queue depending of the payload. (I imagined something like this: select str_value from queue_table qt where qt.user_data.???.??? (myPayloadField) =

  • Common Distribution Channel and Divisions

    <b>How to configure Common Distribution Channel and Divisions and what is the advantage of the same?</b>

  • Print Jobs Stuck in Print Que

    I have a USB printer connected to my MacPro (Leopard), the driver is correct, has been reloaded, print system reset, etc., all of the expected fixes for routine issues. I've replaced the USB cord, tried another identical printer, etc. About 2 in 5 pr

  • IPad  upgrading to iPad2- all messages lost after restore.

    I couldn't find this anywhere, but I thought I saw someone talking about it a couple of weeks ago. I have an iPad and just got my new iPad2. The 'restore' worked just fine, but all the messages I had on Mail are gone. Anyway to get them back? Most ar