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.

Similar Messages

  • 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

  • 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

  • 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

  • Qaaws not refreshing query triggered from Xcelsius, maybe a cache problem

    Hi,
    I'm having a problem with QAAWS and Xcelsius
    I'm using a List Builder component to select multiple values in this case STATES from the efashion universe
    I use the selected states as values to feed a prompt in a QAAWS query, the qwaas query has  the SALES REVENUE as the resultset and in the conditions it has a multi prompt for STATES
    When I preview my dashboard, I select the States, then UPDATE the values and then refresh the query with a CONNECTION REFRESH button, The first time I do this it works fine and returns the Sales revenue.
    If I add a new State to my selection and then run update and run run again the query with the refresh button, it doesn't work any more and it shows again the value retrieved from the first query
    First I thought that the query wasn't triggered by Xcelsius, but by doing some more tests I found that actually the query runs but it returns the value from the first query
    I think this is a cache problem , so is there a way to tell QAAWS to always run the query and not use the cache?
    thanks,
    Alejandro

    Hello Alejandro,
    QaaWS indeed uses a cache mechanism to speed up some Xcelsius interactions (from XI 3.0 onwards), but your issue should not be induced by this, as cache sessions are discriminated according to session user id & prompt values, so if you are correctly passing prompt values, QaaWS should not serve you with the previous values by error.
    Could you specify how you are passing several prompt values to the QaaWS? There might be an issue there, so make sure that:
    1. QaaWS query prompt is set using In List operator, otherwise only first value will actually be taken into account,
    2. In Xcelsius Designer Data Manager, web service input paremeters are duplicated to accept several input values (you cannot submit you list of prompt values as a list to a single input parameter).
    If this still does not work, I'd suggest you debug your dashboard runtime using an HTTP sniffer like Fiddler (available from http://www.fiddler2.com/) which enable you to inspect the sent & recieved HTTP messages with the server, where you should verify which prompt values are sent to the QaaWS servlet.
    FYI, you can set the QaaWS cache lifetime for each query, by going into QaaWS edition first wizard screen, click Advanced... button and change value for timeout parameter (default is 60 seconds)
    Hope that helps,
    David.

  • Problem of Toplink cache

    when we try to get a object form DB by Toplink, the number of sub-object is doubule or treble,
    for example: object User and object Role are many-to-many Mapping relation,get User form DB,sometime returns 4 Roles,sometime 8 Roles or 12 Roles, but the correct result is 4 Roles.
    I don't konw why.

    Yes,have only 4 unique rows in the relation table,this problem doesn't happened debug in Eclipse,just appeared on OC4J,so i suspect this is cache problem,
    the query code:
    //get the ClientSession
    ClientSession cs = getClientSession();
    Expression exp = (new ExpressionBuilder()).get("oid").equal(oid);
    User user= cs.readObject(User.class, exp);
    the User class:
    public class User extends BaseEntity {
         private String ID;
         private String localName;
         private String firstName;
         private String lastName;
         private String stat;
         private String email;
         private String phone;
         private String fax;
         private String sourceAppCode;
         private Date lastLoginRangeBegin;
         private Date lastLoginRangeEnd;
         private ArrayList roleList;
         public String getID() {
              return ID;
         public void setID(String id) {
              ID = id;
         public void setStat(String stat) {
              this.stat = stat;
         public String getStat() {
              return stat;
         public void setEmail(String email) {
              this.email = email;
         public String getEmail() {
              return email;
         public void setPhone(String phone) {
              this.phone = phone;
         public String getPhone() {
              return phone;
         public void setFax(String fax) {
              this.fax = fax;
         public String getFax() {
              return fax;
         public void setSourceAppCode(String sourceAppCode) {
              this.sourceAppCode = sourceAppCode;
         public String getSourceAppCode() {
              return sourceAppCode;
         public void setRoleList(ArrayList roleList) {
              this.roleList = roleList;
         public ArrayList getRoleList() {
              return roleList;
         public void setLastLoginRangeBegin(Date lastLoginRangeBegin) {
              this.lastLoginRangeBegin = lastLoginRangeBegin;
         public Date getLastLoginRangeBegin() {
              return lastLoginRangeBegin;
         public void setLastLoginRangeEnd(Date lastLoginRangeEnd) {
              this.lastLoginRangeEnd = lastLoginRangeEnd;
         public Date getLastLoginRangeEnd() {
              return lastLoginRangeEnd;
         public void setLocalName(String localName) {
              this.localName = localName;
         public String getLocalName() {
              return localName;
         public void setFirstName(String firstName) {
              this.firstName = firstName;
         public String getFirstName() {
              return firstName;
         public void setLastName(String lastName) {
              this.lastName = lastName;
         public String getLastName() {
              return lastName;
    }

  • 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 coordination problem with opmn lookup

    Dear all,
    We encounter some problems when we use opmn url and jms to realize the toplink cache coordination.
    Scenario:
    1. Using oracle application server 10g, create three processes(jvm) on one oc4j instance
    2. Using oc4j in memory jms server for cache coordination
    3. Using opmn url to lookup jms topic connection factory and connection, opmn url: opmn:ormi://shasudv4:6004:OC4J_TTS/tts
    When we start oc4j instance, we find the log, all the toplink cache coordination properites has been set to toplink framework, and remote command manager has been initialized successfully. All in memory jms server has also been started successfully, there are three listeners on the topic.
    But, when we test the synchronization, the data can't be synchronized between all the processes, two of them is ok, the rest of them has some problem to coordinate with the other two. There are no exceptions, we have set the level of toplink log to 'all'.
    I have checked the thread dump, I find that "HTTPThreadGroup", "RMICallHandler" and "JMSRequestHandler" threads are involved in cache synchronization.
    So, we are obliged to change the opmn url to ormi url, so we can only set a bound for rmi ports of processes, because the ormi port is dynamicly assigned.
    <port id="rmi" range="12405-12407" />
    This seems ok, and involved thread are: "RMICallHander" and "JMSRequestHandler". But we also concern that we have restricted the port bound of ormi port of every instance.
    Thanks of any advice.

    I raised a TAR with Oracle. The short answer is that you can't do cache coordination either with ADF business objects, or with Toplink Essentials (as opposed to Oracle Toplink, which doesn't yet support JPA).

  • 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")

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

  • I am facing a caching problem in the Web-Application that I've developed us

    Dear Friends,
    I am facing a caching problem in the Web-Application that I've developed using Java/JSP/Servlet.
    Problem Description: In this application when a hyperlink is clicked it is supposed to go the Handling Servlet and then servlet will fetch the data (using DAO layer) and will store in the session. After this the servlet will forward the request to the view JSP to present the data. The JSP access the object stored in the session and displays the data.
    However, when the link is clicked second time then the request is not received by our servlet and the cached(prev data) page is shown. If we refresh the page then request come to the servlet and we get correct data. But as you will also agree that we don't want the users to refresh the page again and again to get the updated data.
    We've included these lines in JSPs also but it does no good:
    <%
    response.setHeader("Expires", "0");
    response.setHeader("Cache-Control" ,"no-cache, must-revalidate");
    response.setHeader("Pragma", "no-cache");
    response.setHeader("Cache-Control","no-store");
    %>
    Request you to please give a solution for the same.
    Thanks & Regards,
    Mohan

    However, when the link is clicked second time then the request is not received by our servlet Impossible mate.. can you show your code. You sure there are no javascript errors ?
    Why dont you just remove your object from the session after displaying the data from it and see if your page "automatically" hits the servlet when the link is clicked.
    cheers..
    S

  • Caching problem of servlet

    Hi guys
    We are facing this problem of caching within our project. The project aims to generate a html code to pick up some rich media ads details at random and displaying on the html file where the generated code is expected to be pasted. We developed two servlets, one which extracts the ads from the database randomly and then depanding on the ad type it calls the other servlet as src of an iframe, which in turn puts all code for displaying the rich media ads. The script which we are generating for the user to paste onto their pages is:
    <script LANGUAGE="JAVASCRIPT" src="http://192.168.1.6:8080/advert_java/servlet/GetAdServlet?region=1&zone=1&type=nossi&cachevar=yes">
    </script>First servlet (GetAdServlet) returns the javascript statements and thus is called using this generated code. Now cotents of the iframe are supplied by the second servlet ie richMediaServlet. This servlet is called like
    iframeURL = fullHttpDir+"/servlet/RichMediaServlet?";
    iframeURL += "bannerCode="+ RNBanner (BannerCode to be called);
    out.println("document.write(\"<iframe  src='"  + iframeURL +  "' height=" + hheight +" width="+ wwidth + " SCROLLING=no FRAMEBORDER=0 MARGINWIDTH=2 MARGINHEIGHT=2 onfocus='window.focus(); return iframeFocus()'>\");");
    out.println("document.write(\"</iframe>\");");This richmediaServlet returns HTML into <iframe>. when richmediaservlet is called, a parameter 'bannerCode' is passed. then richmediaServlet fatches the banner from the database and displays the banner into the <iframe>.
    Now the problem comes when we run the html file containing the script tag mentioned above, and refresh our page, ideally it should pick the ads randomly and pass it on to RichMediaServlet.
    I also try debugging both servlets. I called the getadservlet from javascript mentioned above and put debugging info in both the servlets, now for every refresh we do on the html side, we are getting a different random bannercode in adservlet but in richmedia when we print the bannercode received in querystring it is taking an older value which was displayed some time back and keeps on doing this for quiet a long time, making it look like some caching problem of RichMediaServlet.
    Instead when we tried to put the same html <script> code into another servlet's doGet, everything seems to be working fine.
    i have also used the following code to prevent the caching on both the setvlets
    long currentTime = System.currentTimeMillis();
    response.setHeader("Cache-Control", "no-cache, must-revalidate");
    response.setHeader("Pragma", "no-cache");
    response.setDateHeader("Last-modified", currentTime);
    response.setHeader("Expires", "Sat, 6 May 1995 12:00:00 GMT");     and following in the iframe's head tag before the iframe tag in the getAdServlet.
    out.println("document.write('<head>');");
    out.println("document.write('<meta http-equiv=\"Cache-Control\" content=\"no-cache,must-revalidate\">');");
    out.println("document.write('<meta http-equiv=\"Pragma\" content=\"no-cache\">');");
    out.println("document.write('<meta http-equiv=\"Last-modified\" content=\""+ currentTime + "\">');");
    out.println("document.write('<meta http-equiv=\"expires\" content=\"Sat, 6 May 1995 12:00:00 GMT\">');");
    out.println("document.write('</head>');");I request you all geeks to try and help me to your best. The project is at its final stages and in high urgency now.

    i think the caching is being in the browser, with the iframe.
    You should try passing a random param to the servlet in the iframe URL, something like:
    var a = Math.random() * 10000000; //for example
    out.println("document.write(\"<iframe  src='"  + iframeURL +"&rand="+a+"' height=" + hheight +" width="+ wwidth + " SCROLLING=no FRAMEBORDER=0 MARGINWIDTH=2 MARGINHEIGHT=2 onfocus='window.focus(); return iframeFocus()'>\");");
    out.println("document.write(\"</iframe>\");");
    ...It should force the browser to ask for the servlet again
    hope this helps...

  • BPM Cache Problem

    Hi All,
    I hav created a Business process. when i modified that process, it is not getting reflected in the SXI_CACHE. No matter how many times i activated it, it is not getting modified. i tried for around two hours and restarted the server again as the last alternative. I had refreshed the cache even with the mode 'full' which din't result in the expected outcome.
    Any suggestions about this as i don't want spend two more hours next time.
    Thnx
    Anil.

    Hi guys,
    I had done the samething which u ppl were mentioning for two hours. but my problem is that the BPM is taking the previous version itself.And i din't know how to enable BPM to consider the latest version.And now, my problem got solved.
    In the Integration directory, i deleted my integration process(say MyXXXBPM) and created a new integration process with the same name(MyXXXBPM) and imported the same process. It is taking the latest version now.
    Anyways.......Thnx guys
    Anil.

Maybe you are looking for

  • Windows XP driver problem - Nomad Zen Xtra and Zen To

    I have both a Nomad Zen Xtra 60GB and a Zen Touch 20GB, both of which were working fine with my Windows XP Pro SP2 computer until a couple of days ago. I had recently put firmware 2.0.03 onto the Zen Xtra, and was using the drag-and-drop method in Wi

  • ITunes 12.0.1.26 quits on launch Windows 7 64-bit

    Hi, so I recently got a new iPhone, and naturally, I wanted to install iTunes. When I install iTunes and run it, it tells me I need to install Bonjour. I do that, and then it tells me to do something else, then something else, then something else, an

  • Is AIR getting restricted by Xcode 5?

    Hi, Apple has notified with below statement, so wanted to make sure it doesn't mean to restrict AIR for developing iOS apps (https://developer.apple.com/news/index.php?id=12172013a#top) Make Your Apps Work Seamlessly with iOS 7 December 17, 2013 Star

  • StackOverflow error on xjc version 2.0-b26-ea3

    Hi, I am hitting a stackOverflowError while compiling a schema using xjc. Here is the stack trace: parsing a schema... compiling a schema... java.lang.reflect.InvocationTargetException      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Metho

  • How to combine different projects to create final clip in after effect?

    Hello; i am newbie and learning adobe after effects cs6. I have downloaded  different templates from web and edited them according my wish and now i  want to create final movie by combining all the clips. Some clips/projects are with different resolu