Manually Refresh Toplink cache

Gurus,
Can we write some servlet which will alllow to manually refresh toplink cache, on click of button.
Do we have to change any settings in session.xml or server.xml.
Please point me in right direction.
Thanks
gbk

There is no straight forward way of refreshing all the objects in the cache (short of looping through all the objects in the cache and manually refreshing them).
The most common approach to this issue is to determine which queries need refreshing and refresh those.
If this solution isn't what you were looking for, please provide more detail and I will be happy to help you further.
Peter

Similar Messages

  • 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

  • Refreshing TopLink cache problem

    Hello,
    Assume I configure TopLink to cache Class1 and Class2 objects. Class1 is related with Class2 with one-to-one relationship, and Class2 is related with Class1 with one-to-many relationship, Class2 is parent of Class1. When I invalidate instance of Class1 and its parent instance of Class2 with
    session.getIdentityMapAccessor().invalidateObject(object);
    session.getIdentityMapAccessor().invalidateObject(object.getParent());
    and read Class1 by Id with ReadObjectQuery, object of Class1 is refreshed from database, however, if I try to access its parent with Class1#getParent(), that parent is stale, it is not automatically refreshed from database. When I read it (invalidated parent object) with ReadObjectQuery by ID, it is refreshed from database.
    Is there any way to force TopLink to refresh objects that have been invalidated automatically without querying them by ID? If object A of type Class1 has been invalidated, object B of type Class2 has been invalidated, object A references its parent B and I query A by ID, I would like TopLink to refresh not only A, but B object too.

    If the parent is invalidated, then when you access the refreshed Class1's parent the parent should be refreshed. Are you sure you are invalidating both the Class1 and its parent before reading Class1?
    Otherwise I am not sure why you are seeing it not being refreshed.
    Perhaps try this on another object to see if it is something specific to how you have mapped the object.
    Otherwise enable FINEST logging and include the TopLink log.

  • Issues with TopLink Cache Coordination using JMS for manual DB updates

    Hi,
    We are having 2 web application using same Database and Toplink library but 2 session objects for both the applications. We are using JMS for cache coordination. JMS propagating messages successfully between the applications and able to see the same object changes in both the applications properly. Now, we are trying to refresh cache for manual updates in Database. We are trying to refresh single object which is modified in database in one application, refreshing in one application from which refresh happened but not in other application (JMS publishing the topic but updating one).
    Our intention is refreshing in one application so that JMS should coordinate and update in others when DB manual updates. Please let us know any comments for the same.
    Database using: Oracle 11g
    Toplink Version:- 9.0.3

    See,
    http://www.coderanch.com/t/592919/ORM/databases/Toplink-Cache-coordination-JMS-manual

  • 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.

  • Toplink Cache not getting refreshed after executing UpdateAllQuery

    After executing UpdateAllQuery, the records in the database are getting updated, however the Toplink cache is not getting refreshed with the new data, it still has stale data which is causing issues.
    We're also setting
    updateQuery.setCacheUsage(UpdateAllQuery.INVALIDATE_CACHE);
    Thanks.

    Toplink version is 10.1.3.0.0
    Here is the code
    UpdateAllQuery updateQuery = new UpdateAllQuery(RegisterImpl.class);
    updateQuery.setCacheUsage(UpdateAllQuery.INVALIDATE_CACHE);
    ExpressionBuilder registerBuilder = updateQuery.getExpressionBuilder();
    updateQuery.addArgument("userIdArg");
    updateQuery.addArgument("channelArg");
    updateQuery.addArgument("tokenArg");
    updateQuery.addArgument("dateArg");
    updateQuery.addArgument("businessFuncIdArg");
    Expression reservedDetailRegExp = registerBuilder.get("reservedDetail");
    // build expressions
    Expression userIdExp = reservedDetailRegExp.get("userId").equal(
    registerBuilder.getParameter("userIdArg"));
    Expression channelExp = reservedDetailRegExp.get("channel").equal(
    registerBuilder.getParameter("channelArg"));
    Expression tokenExp = reservedDetailRegExp.get("token").equal(
    registerBuilder.getParameter("tokenArg"));
    Expression dateExp = reservedDetailRegExp.get("date").equal(
    registerBuilder.getParameter("dateArg"));
    Expression busFuncExp = registerBuilder.get("businessFuncId").equal(
    registerBuilder.getParameter("businessFuncIdArg"));
    // set selection criteria
    updateQuery.setSelectionCriteria(userIdExp.and(channelExp.and(tokenExp.and(dateExp
    .and(busFuncExp)))));
    // substitute the values
    updateQuery.addUpdate(reservedDetailRegExp.get("userId"), "");
    updateQuery.addUpdate(reservedDetailRegExp.get("channel"), "");
    updateQuery.addUpdate(reservedDetailRegExp.get("token"), "");
    updateQuery.addUpdate(reservedDetailRegExp.get("date"), "");
    updateQuery.addUpdate(registerBuilder.get("businessFuncId"), "");
    In the object model for the query, the RegisterImpl has an aggregate mapping (ReservedDetail), which in turn has a number of direct-to-field mappings and an one-to-one mapping to businessFunction (for our query we use a direct query key "businessFuncId")

  • 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

  • (Automatic) Refresh of Cached object after insert/update

    Hi,
    (I am using Toplink 9.0.3 against an Oracle Database)
    I am inserting and updating records in the database through objects registered in a TopLink UnitOfWork. I happen to know that certain database columns will get a (changed) values because of Database triggers.
    Is it true that the only way to get these changed values reflected back to the TopLink cache is by explicitly executing a
    session.refreshObject();
    call for every object changed in the UnitOfWork?
    Is there no way to inform TopLink (for example through the descriptors for the relevant classes) that for certain classes after the insert/update an automatic synchronization with the database must be performed?
    I have not been able to find such a setting, but I may have overlooked it - I hope I did.
    Thanks for your help,
    Lucas Jellema (AMIS)

    In this case use a postMerge event -- it will get called after the merge of the cache and then you could update the object explicitly.
    Ultimately, the way to achieve the behavior you're looking for is events or refreshing.
    - Don

  • 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

  • Child Objects  and TopLink Cache

    All,
    I have a problem RE the TopLink cache:
    Object A has a Vector of Object Bs (1:M) and Object B has a Vector of Object Cs(1:M). I am using ValueHolderInterface and indirection pattern for each of these Vectors.
    When I update an Object C, it is not refreshed the next time I read Object A using the readObject(expression). I can see the changes in the database. Can someone tell me the best way to refresh the cache to get the updated Object Cs that belong to Object A.
    What I am doing is updating the C objects that belong to object A (thru Vector B) and then retrieving them again in the very next method call. Hope this makes sense!
    Thanks!
    J

    There is something wrong with your test case, I've seen this before -- if you update a C, then without fail the cached version of C is updated and if you have a handle to the cached A that has the B that has the C in question, then you will see the update. It sounds like perhaps you're not actually looking at the cached A, but instead looking at it from a UOW, etc.
    Send me an email, it's simply my firstname . lastname at Oracle.com. I'll send you a UOW primer that should help better understand these semantics...
    - Don

  • Toplink Cache problem

    I am using JDev of following version "Studio Edition Version 10.1.3.1.0.3984
    Build JDEVADF_10.1.3.0_NT_061009.1404.3984".
    I had an application with JSF and Toplink and am facing issues with toplink cache mechanism while TESTING IN JDEV . Following is the scenario.
    1) When clicking on a link, say 'Get status' , i am querying data from database and displaying in JSF.
    2) Later, i am updating particular record.
    3) when i click on the link again (Get status), updated data is not gettng reflected.
    Here is the code to get data and i am calling this method whenever i am clicking on 'Get status' link.
    public Vector getMaintenanceStatusList(){
    Vector lockersStatus = null;
    try {
    Session sess = ToplinkDBUtils.getTopLinkSession();
    sess.validateCache();
    ReadAllQuery query = new ReadAllQuery();
    query.dontCheckCache();
    query.dontMaintainCache();
    query.setReferenceClass(LockerMaintenanceStatus.class);
    query.useDistinct();
    lockersStatus = sess.readAllObjects(LockerMaintenanceStatus.class);
    } catch (DatabaseException e) {
    e.printStackTrace();
    //******** Printing the updated value.
    for (Iterator i = lockersStatus.iterator();i.hasNext();){
    LockerMaintenanceStatus tmp = (LockerMaintenanceStatus)i.next();
    System.out.println("Status value :: "+tmp.getStatus());
    return lockersStatus;
    Here, i am getting old status value for second time though i have updated the database with new status. (scenario if i work in same browser with same toplink session)
    i am getting updated values only when i restart the JDEV oc4j.
    Please let me know how i can solve the problem.
    Thanks!
    Veeraswami K

    Veeraswami,
    In your code you are constructing a query but are not executing it. Instead you are simply calling session.readAllObjects. The result of this call will be the cached versions (based on default cache config).
    I would recommend doing:
    ReadAllQuery query = new ReadAllQuery(LockerMaintenanceStatus.class);
    query.refreshIdentityMapResult();
    lockersStatus = (Vector) sess.executeQuery(query);The other settings you had used would bypass the cache and not result in its results being refreshed.
    Doug

  • Toplink Cache issues in Cluster

    Hi
    Our production environment is have a clustered environment and we have been noticing the following problem. When a user is trying to save a record she repeatedly encounters the "Toplink-5006" exception that I have included below.
    TopLink Error]: 2006.07.19 04:49:23.359--UnitOfWork(115148745)--null--Exception [TOPLINK-5006] (TopLink (WLS CMP) - 10g (9.0.4.2) (Build 040311)): oracle.toplink.exceptions.OptimisticLockException
    Exception Description: The object [[email protected]ce459] cannot be updated because it has changed or been deleted since it was last read.
    Class> com.rhii.mjplus.fo.people.beans.People_z2e2a7__TopLink_CMP_2_0 Primary Key> [1001280937, 0]
    [TopLink Error]: 2006.07.19 04:49:23.359--UnitOfWork(115148745)--null--Exception [TOPLINK-5006] (TopLink (WLS CMP) - 10g (9.0.4.2) (Build 040311)): oracle.toplink.exceptions.OptimisticLockException
    Exception Description: The object [[email protected]ce459] cannot be updated because it has changed or been deleted since it was last read.
    Class> com.rhii.mjplus.fo.people.beans.People_z2e2a7__TopLink_CMP_2_0 Primary Key> [1001280937, 0]
    <Jul 19, 2006 4:49:23 PM PDT> <Error> <EJB> <BEA-010026> <Exception occurred during commit of transaction Name=[EJB com.rhii.mjplus.fo.people.beans.PeopleManagerBean.setPeople(java.util.HashMap,java.lang.String,java.lang.String,java.lang.String,java.util.HashSet,com.rhii.mjplus.common.login.data.UserInfoDO)],Xid=BEA1-795A6481D2E1938A8EAD(115171166),Status=Rolled back. [Reason=Exception [TOPLINK-5006] (TopLink (WLS CMP) - 10g (9.0.4.2) (Build 040311)): oracle.toplink.exceptions.OptimisticLockException
    Exception Description: The object [[email protected]ce459] cannot be updated because it has changed or been deleted since it was last read.
    Class> com.rhii.mjplus.fo.people.beans.People_z2e2a7__TopLink_CMP_2_0 Primary Key> [1001280937, 0]],numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=0,seconds left=60,XAServerResourceInfo[weblogic.jdbc.wrapper.JTSXAResourceImpl]=(ServerResourceInfo[weblogic.jdbc.wrapper.JTSXAResourceImpl]=(state=rolledback,assigned=MS15_mjp),xar=weblogic.jdbc.wrapper.JTSXAResourceImpl@6dcf50b),SCInfo[mjp+MS15_mjp]=(state=rolledback),properties=({weblogic.transaction.name=[EJB com.rhii.mjplus.fo.people.beans.PeopleManagerBean.setPeople(java.util.HashMap,java.lang.String,java.lang.String,java.lang.String,java.util.HashSet,com.rhii.mjplus.common.login.data.UserInfoDO)], weblogic.jdbc=t3://10.253.129.56:2323}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=MS15_mjp+10.253.129.56:2323+mjp+t3+, XAResources={},NonXAResources={})],CoordinatorURL=MS15_mjp+10.253.129.56:2323+mjp+t3+): Local Exception Stack:
    Exception [TOPLINK-5006] (TopLink (WLS CMP) - 10g (9.0.4.2) (Build 040311)): oracle.toplink.exceptions.OptimisticLockException
    Exception Description: The object [[email protected]ce459] cannot be updated because it has changed or been deleted since it was last read.
    Class> com.rhii.mjplus.fo.people.beans.People_z2e2a7__TopLink_CMP_2_0 Primary Key> [1001280937, 0]
         at oracle.toplink.exceptions.OptimisticLockException.objectChangedSinceLastReadWhenUpdating(Ljava/lang/Object;Loracle/toplink/queryframework/ObjectLevelModifyQuery;)Loracle/toplink/exceptions/OptimisticLockException;(OptimisticLockException.java:109)
    What is puzzling is that the occurance of this nature has increased with user load and the toplink cache does not seem to have been refreshed after it encounters the first Optimistic Lock exception. We have run several test and this is not reproducabile in the DEV environment where we do not have a clustered set. After making a few updates to a record users starts experiencing the problem ... for some this persist for a really long time.
    We do not have Cache synchronization
    Cluster setup is as followes
    There are 4 boxes and each box has one admin and 4 managed servers.
    I have included the toplink-cmp-people.xml ( Thisis the particular entity bean we have a problem with) Our application server is Weblogic and we have Toplink version 9042
    <toplink-ejb-jar>
    <session>
    <name>People</name>
    <project-class>
    com.rhii.mjplus.fo.people.beans.PeopleToplink
    </project-class>
    <login>
    <datasource>MJPool</datasource>
    <non-jts-datasource>MJPool</non-jts-datasource>
    </login>
    <use-remote-relationships>true</use-remote-relationships>
    <customization-class>com.rhii.mjplus.common.TopLinkCustomization
    </customization-class>
    </session>
    </toplink-ejb-jar>
    I would appreciate any kind of feedback
    Thanks
    Lakshmi

    Can you refresh that record using a query before you save it ?
    Hi
    Our production environment is have a clustered
    environment and we have been noticing the following
    problem. When a user is trying to save a record she
    repeatedly encounters the "Toplink-5006" exception
    that I have included below.
    TopLink Error]: 2006.07.19
    04:49:23.359--UnitOfWork(115148745)--null--Exception
    [TOPLINK-5006] (TopLink (WLS CMP) - 10g (9.0.4.2)
    (Build 040311)):
    oracle.toplink.exceptions.OptimisticLockException
    Exception Description: The object
    [com.rhii.mjplus.fo.people.beans.People_z2e2a7__TopLin
    k_CMP_2_0@6dce459] cannot be updated because it has
    changed or been deleted since it was last read.
    Class>
    com.rhii.mjplus.fo.people.beans.People_z2e2a7__TopLink
    CMP2_0 Primary Key> [1001280937, 0]
    [TopLink Error]: 2006.07.19
    04:49:23.359--UnitOfWork(115148745)--null--Exception
    [TOPLINK-5006] (TopLink (WLS CMP) - 10g (9.0.4.2)
    (Build 040311)):
    oracle.toplink.exceptions.OptimisticLockException
    Exception Description: The object
    [com.rhii.mjplus.fo.people.beans.People_z2e2a7__TopLin
    k_CMP_2_0@6dce459] cannot be updated because it has
    changed or been deleted since it was last read.
    Class>
    com.rhii.mjplus.fo.people.beans.People_z2e2a7__TopLink
    CMP2_0 Primary Key> [1001280937, 0]
    <Jul 19, 2006 4:49:23 PM PDT> <Error> <EJB>
    <BEA-010026> <Exception occurred during commit of
    transaction Name=[EJB
    com.rhii.mjplus.fo.people.beans.PeopleManagerBean.setP
    eople(java.util.HashMap,java.lang.String,java.lang.Str
    ing,java.lang.String,java.util.HashSet,com.rhii.mjplus
    .common.login.data.UserInfoDO)],Xid=BEA1-795A6481D2E19
    38A8EAD(115171166),Status=Rolled back.
    [Reason=Exception [TOPLINK-5006] (TopLink (WLS CMP) -
    10g (9.0.4.2) (Build 040311)):
    oracle.toplink.exceptions.OptimisticLockException
    Exception Description: The object
    [com.rhii.mjplus.fo.people.beans.People_z2e2a7__TopLin
    k_CMP_2_0@6dce459] cannot be updated because it has
    changed or been deleted since it was last read.
    Class>
    com.rhii.mjplus.fo.people.beans.People_z2e2a7__TopLink
    CMP2_0 Primary Key> [1001280937,
    0]],numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds
    since begin=0,seconds
    left=60,XAServerResourceInfo[weblogic.jdbc.wrapper.JTS
    XAResourceImpl]=(ServerResourceInfo[weblogic.jdbc.wrap
    per.JTSXAResourceImpl]=(state=rolledback,assigned=MS15
    _mjp),xar=weblogic.jdbc.wrapper.JTSXAResourceImpl@6dcf
    50b),SCInfo[mjp+MS15_mjp]=(state=rolledback),propertie
    s=({weblogic.transaction.name=[EJB
    com.rhii.mjplus.fo.people.beans.PeopleManagerBean.setP
    eople(java.util.HashMap,java.lang.String,java.lang.Str
    ing,java.lang.String,java.util.HashSet,com.rhii.mjplus
    .common.login.data.UserInfoDO)],
    weblogic.jdbc=t3://10.253.129.56:2323}),OwnerTransacti
    onManager=ServerTM[ServerCoordinatorDescriptor=(Coordi
    natorURL=MS15_mjp+10.253.129.56:2323+mjp+t3+,
    XAResources={},NonXAResources={})],CoordinatorURL=MS15
    _mjp+10.253.129.56:2323+mjp+t3+): Local Exception
    Stack:
    Exception [TOPLINK-5006] (TopLink (WLS CMP) - 10g
    (9.0.4.2) (Build 040311)):
    oracle.toplink.exceptions.OptimisticLockException
    Exception Description: The object
    [com.rhii.mjplus.fo.people.beans.People_z2e2a7__TopLin
    k_CMP_2_0@6dce459] cannot be updated because it has
    changed or been deleted since it was last read.
    Class>
    com.rhii.mjplus.fo.people.beans.People_z2e2a7__TopLink
    CMP2_0 Primary Key> [1001280937, 0]
    at
    t
    oracle.toplink.exceptions.OptimisticLockException.obje
    ctChangedSinceLastReadWhenUpdating(Ljava/lang/Object;L
    oracle/toplink/queryframework/ObjectLevelModifyQuery;)
    Loracle/toplink/exceptions/OptimisticLockException;(Op
    timisticLockException.java:109)
    What is puzzling is that the occurance of this nature
    has increased with user load and the toplink cache
    does not seem to have been refreshed after it
    encounters the first Optimistic Lock exception. We
    have run several test and this is not reproducabile
    in the DEV environment where we do not have a
    clustered set. After making a few updates to a record
    users starts experiencing the problem ... for some
    this persist for a really long time.
    We do not have Cache synchronization
    Cluster setup is as followes
    There are 4 boxes and each box has one admin and 4
    managed servers.
    I have included the toplink-cmp-people.xml ( Thisis
    the particular entity bean we have a problem with)
    Our application server is Weblogic and we have
    Toplink version 9042
    <toplink-ejb-jar>
    <session>
    <name>People</name>
    <project-class>
    com.rhii.mjplus.fo.people.beans.PeopleToplink
    </project-class>
    <login>
    <datasource>MJPool</datasource>
    <non-jts-datasource>MJPool</non-jts-datasource>
    </login>
    <use-remote-relationships>true</use-remote-relationsh
    ips>
    <customization-class>com.rhii.mjplus.common.TopLinkCu
    stomization
    </customization-class>
    </session>
    </toplink-ejb-jar>
    I would appreciate any kind of feedback
    Thanks
    LakshmiCan you refresh that record using a query before you save it ?

  • POWL: Refresh the cache results of POWL during page load.

    Hi Friends,
    I am using a feeder class for my POWL. Whenever the user clicks opens the POWL, he sees the cached data/results and he is expected to do a manual refresh to see current/new data. I want to eliminate this by refreshing the cache during the page load itself and show user current data. I already know about the exporting parameter in handle_action method which is used to do refresh. But it does not work in this case.
    Pls help.

    Hello Saud,
    In which release you are? in new release you can do refresh by personalization where options are there.
    There are other options also to refresh
    1) By passing URL parameter refreshA=X it will refresh all queies when loading
    2) By passing refreshq=X, it will refresh the current query
    best regards,
    Rohit

  • TopLink caching policy and inheritance

    Just looking for some confirmation on TopLink caching policy behavior for descriptors involving inheritance.
    The TopLink workbench allows me to specify the "Identity" policy advanced property for descriptor that involve inheritance (subclasses).
    Subclass descriptors can have different identity policies right?
    I could have some subclasses (descriptors) which I wish to use a FullIdentityMap and other subclasses (descriptors) that I wish to have a SoftCacheWeakIdentityMap?
    Thanks for clarification. The manuals don't really clarify this behavior.
    ...Steve

    TopLink maintains one identity map (cache) per root class. That means that all settings are shared for an inheritance tree and cannot be overridden on a per class basis.
    Doug

  • Multiple Rows Update / Refresh Toplink Query when database trigger involved

    Hi everybody!
    I have two easy troubles for you; the platform is the same as the SRDemo Toplink version.
    1.     Multiple Rows Update: I want to update with mergeEntity method, multiple rows for an isolated table; that method receives a parameter that I try to bind with the iterator "dataProvider" but it only merges the first row, not all, any other combination returns an error.
    What I want to do is to have a form (like tabular forms in Apex) that lets me update multiple rows in a single page. ¿May anyone tell me how to do it?
    2.     Refresh Toplink Named Query: I have a list on a page with two columns. From another page, a button does an action that fires a database trigger that updates one of the columns on the list´s page. When I go back to the list, it is not updated; however, the CacheResults´s property is set to false on the iterator.
    Thanks in advance,
    Alejandro T

    I didn't use it (yet), but - you might take a look. You'll find a [url http://www.oracle.com/technetwork/developer-tools/apex/application-express/apex-plug-ins-182042.html]Timer plug-in on this page. It is a dynamic action which allows you to periodically fire other dynamic actions in the browser. For example use the timer to refresh a region every five minutes. You can perform any dynamic action you want using this infrastructure.So I was thinking: you might use it to run a dynamic action which would check whether something changed in that table (I suppose you'll know the way) (for example, a database trigger might set a flag in some table, timestamp or similar), and - if you find that something really changed - refresh the page.
    As I said, I never used it so that's pure theory. Someone else might know better, though.

Maybe you are looking for