AboutToUpdate and UpdateAllQuery

We have extended DescriptorEventAdaptor to use the aboutToUpdate method for auditing fields. That works fine.
When an UpdateAllQuery is executed on an object I would expect the aboutToUpdate to add the auditing fields in the update statement too, specially when the locking field(version in my test case) gets added to my update statement.
But my tests show that this is not the case
The update statement that’s gets generated by UpdateAllQuery is -
UPDATE USER04.COMMODITY_RELATIONX SET VERSION = (VERSION + ?), DESCRIPTION = UPPER(DESCRIPTION) WHERE (NAME = ?)
Can someone please explain this and let me know what I am doing something wrong here.
Thanks.
This is my test –
ExpressionBuilder builder = new ExpressionBuilder();
Expression WhereClause = builder.get("name").equal("UpdateTest");
UpdateAllQuery updateQuery = new
UpdateAllQuery(CommodityRelationX.class);
updateQuery.setSelectionCriteria(WhereClause);
updateQuery.addUpdate(builder.get("description"),
builder.get("description").getFunction("UPPER"));
updateQuery.setShouldDeferExecutionInUOW(false);
int num = (Integer)uow.executeQuery(updateQuery);
txn.commit();

In your event first determine that this query is the UpdateAllQuery that you want, then add your updates.
If the column are not mapped you could use a query-key, or can use a field expression,
updateQuery.addUpdate(updateQuery.getExpressionBuilder().getField("UPDATEDBYCOL"), "UpdateUser");

Similar Messages

  • DescriptorEventAdapter's aboutToUpdate and calling event.getOriginalObject

    Hi All
    We have a class extending DescriptorEventAdapter and implementing its aboutToUpdate() method to update some audit information in every object. The implementation is here.
    public void aboutToUpdate(DescriptorEvent event)
    log.debug("Object updated " + event.getOriginalObject().getClass().getSimpleName());
    event.updateAttributeWithObject("SOME_FIELD", obj.getId().intValue());
    Above implementation causing the object(being updated) having null values in it and database throws eerror complaining about NULL values.
    It looks call to event.getOriginalObject() in log.debug statement updating/replacing? the object with null values
    If we delete the log.debug... line then it works fine.
    Any idea why/how call to event.getOriginalObject() causing this issue.
    Thanks you very much for clearing concepts.
    Regards,
    HH

    take a look at java.util.Observable and java.util.Observer. Alternatively, write your own event dispatch framework.

  • DescriptorEvents-What am I doing wrong?

    I am running 9.0.3.4 of Oracle Toplink. I am registering a DescriptorEvent, but it does not appear to be working, it never get's called Perhaps someone could point out what I am doing wrong.
    This is the code for monitoring the event:
    public class AuditInfoListener
    extends DescriptorEventAdapter
         public void aboutToInsert(DescriptorEvent arg0)
    System.out.println("In Insert Event");          super.aboutToInsert(arg0);
              processInsertEvent(arg0);
         public void aboutToUpdate(DescriptorEvent arg0)
    System.out.println("In Update Event");
              super.aboutToUpdate(arg0);
              processUpdateEvent(arg0);
         public AuditInfoListener()
              super();
         public static void addListeners(Project project)
              Iterator iterator =
              project.getDescriptors().values().iterator();
              while (iterator.hasNext())
                   Descriptor descriptor = (Descriptor)iterator.next();
                   if (!descriptor.isChildDescriptor() )
                   descriptor.getEventManager().addListener(new AuditInfoListener());
    This is the code to registed the event with the project:
    project = XMLProjectReader.read(projectXmlFile);
    serverSession = (ServerSession) project.createServerSession();
    serverSession.setProject(project);
    serverSession.setName(projectKey);
    serverSession.getEventManager().addListener(new DiamondTopLinkEvents());
    serverSession.login();
    AuditInfoListener.addListeners(serverSession.getProject());
    I see in the debugger that it registers the events with the descriptors. But I never see the events get called. I
    have break points and messages in the aboutToInsert and aboutToUpdate and neither gets called on when writing objects. I know they are writing because I see the sql and the database is updated. I have tried registering the event before creating the ServerSession, before login and here after login, nothing seems to work. I know I am missing something, but not sure what.
    Thansk

    Try this way, add the listeners to the project before you login. I wouldn't be surprised if something was setup during the login, something cloned, etc...
    project = XMLProjectReader.read(projectXmlFile);
    AuditInfoListener.addListeners(project);
    serverSession = (ServerSession) project.createServerSession();
    serverSession.setProject(project);
    serverSession.setName(projectKey);
    serverSession.getEventManager().addListener(new DiamondTopLinkEvents());
    serverSession.login();
    - Don

  • "aboutToUpdate" event hook and clustering using JMS Coordinated Cache

    On certain object, In the aboutToUpdate method I'm calling the DescriptorEvent.updateAttributeWithObject to update the object with the last person who update the object and the date.
    CODE:
    event.updateAttributeWithObject("_lastUpdatedBy", utm.getUser());
    event.updateAttributeWithObject("_lastUpdatedByID", new Integer(utm.getUser().getID()));
    event.updateAttributeWithObject("_lastUpdateDate", utm.getUpdateDate());
    This is somehow making the RCM call
    JMSTopicTransportManager.createJMSTopicRemoteConnection
    I have no idea why it's doing this but it is. As a workaround I've set the descriptor's cacheSynchronizationType to invalidate and I've noticed that it doesn't call the createJMSTopicRemoteConnection and doesn't break the JMS topics; however, this is a major performance hit.
    CODE:
    __descriptor.setCacheSynchronizationType(oracle.toplink.descriptors.ClassDescriptor.INVALIDATE_CHANGED_OBJECTS);
    I need a solution that will allow normal caching policy with this event hook. Does anyone know of any?
    Message was edited by:
    esn

    The set up in sessions.xml is correct. The error points to a problem with the topic/jms setup in WebLogic, and so if you get this error again, you will need to verify the jms factory and topic configuration. This current problem was resolved by using the default jms factory/topic defined in WLS' example server.
    Best Regards,
    Chris

  • UpdateAllQuery and Native SQL

    Hi,
    I have below three update statements, and need to be in one transaction. How can I accomplish it using UpdateAllQuery? Finance_Management is a child table of Org mapped through org_id; Org_Finance is a child table of Finance_Management linked by finance_management_id.
    Update Org
    Set Account_Balance = Account_Balance + 25, Update_User = 'Jeff_Org', Update_Date = Systimestamp
    Where Org_Id = 10226;
    Update Finance_Management
    Set Account_Balance = (Select Account_Balance From Org Where Org_Id = 10226),
    Transaction_Amount = 25, Transaction_Date = Systimestamp
    where finance_management_id = 1701152;
    Update Org_Finance
    Set Check_Mo_Number = 5432, Payment_Type = 'C'
    where Finance_Management_Id = 1701152;
    Alternatively, when I tried native SQL with executeNonSelectingCall within unit of work like below, it appears that even through the second SQLCall failed, the first one still committed to the database. How can I ensure the three SQLCalls are in one transaction?
    UnitOfWork uow = getSessionFactory().acquireUnitOfWork();
    uow.executeNonSelectingCall(new SQLCall(orgSql));
    uow.executeNonSelectingCall(new SQLCall(fmSql));
    uow.executeNonSelectingCall(new SQLCall(orgFnSql));
    uow.commit();
    Thanks for your help!
    Jeffrey

    I think I have figured it out.
    For using UpdateAllQuery, three different UpdateAllQueries need to be constructed. One critical piece is that, use beginEarlyTransaction() before execute the three queries inside UOW. Same is true when using native SQLs.
    Few questions though that I need some experts to clear my mind:
    - so all database Queries can run inside unit of work, become part of the single transaction within UOW by using beginEarlyTransaction(), is this correct?
    - How about insert? InsertObjectQuery and WriteObjectQuery don't seem allow to use expression, which I need for populating a field like "Account_Balance = (Select Account_Balance From Org Where Org_Id = 10226)". Any suggestions on what API call I should use without using native SQL?
    Thanks,
    Jeffrey

  • Source and Original Object

    In our application, we are using both mergeXXX() and uow register api in different scenarios. I find that while using uow.register, in aboutToUpdate(), getSource() returns the updated object while in the case of former, getOriginalObject() returns the updated object. Is this how it works, or is anything wrong?

    The source of the aboutToUpdate event in the UnitOfWork clone, and should contain the changes and does reflect what will be committed to the database. getOriginalObject() should normally not be used from the aboutToUpdate event as the transaction has not yet been committed and the original should not be changed. In your mergeXXX case it seems that the object being merged was not in the shared cache, so the merge clone was used as a placeholder for the original.
    If you are not seeing the object being committed correctly to the database, you may be having issues in your mergeXXX.

  • Toplink UpdateAllQuery Issue

    We're experiencing some problems with an UpdateAllQuery when trying to update some fields belonging to an aggregate mapping within the component we're trying to update.
    We want to set these fields to NULL.
    One of the fields in the Aggregate mapping is a OneToOne mapping lookup type component. We want to set this field to NULL. (In a nutshell we want to set the FK to this lookup type object to NULL).
    In order to accomplish this, we have created a DirectQueryKey for the OneToOne mapping inside of the Aggregate mapping and then physically mapped it within the Component that makes use of the Aggregate mapping.
    It appears that this DirectQueryKey is not working properly. Even when we create a ReadAllQuery and use the same selection criteria, TopLink complains with a TOPLINK 6015 "Invalid QueryKey [businessFuncId] in expression" exception when trying to execute the query.
    We have checked to make sure the QueryKey name in our TopLink mapping matches the name used in the query definition... we're stumped... can someone review and provide some clues as to what we may be doing wrong.
    Here is the UpdateAllQuery definition:
    UpdateAllQuery updateQuery = new UpdateAllQuery(RegisterImpl.class);
    updateQuery.setCacheUsage(UpdateAllQuery.INVALIDATE_CACHE);
    ExpressionBuilder registerBuilder = updateQuery.getExpressionBuilder();
    updateQuery.addArgument("userId");
    updateQuery.addArgument("channel");
    updateQuery.addArgument("token");
    updateQuery.addArgument("date");
    updateQuery.addArgument("businessFuncId");
    Expression reservedDetailReg = registerBuilder.get("reservedDetail");
    Expression userIdExp = reservedDetailReg.get("userId").equal(
    registerBuilder.getParameter("userId"));
    Expression channelExp = reservedDetailReg.get("channel").equal(
    registerBuilder.getParameter("channel"));
    Expression tokenExp = reservedDetailReg.get("token").equal(
    registerBuilder.getParameter("token"));
    Expression dateExp = reservedDetailReg.get("date").equal(
    registerBuilder.getParameter("date"));
    Expression busFuncExp = reservedDetailReg.get("businessFuncId").equal(
    registerBuilder.getParameter("businessFuncId"));
    updateQuery.setSelectionCriteria(userIdExp.and(channelExp.and(tokenExp.and(dateExp
    .and(busFuncExp)))));
    updateQuery.addUpdate(reservedDetailReg.get("userId"), "");
    updateQuery.addUpdate(reservedDetailReg.get("channel"), "");
    updateQuery.addUpdate(reservedDetailReg.get("token"), "");
    updateQuery.addUpdate(reservedDetailReg.get("date"), "");
    updateQuery.addUpdate(reservedDetailReg.get("businessFuncId"), "");
    descriptor.getQueryManager().addQuery(QueryConstants.UNFREEZE_REGISTER_BY_RESERVED_DETAIL,
    updateQuery);
    Thanks in advance.

    In answer to your posted questions:
    1) Are you mapping a query key for the lookup object(between an attribute of the object and a field of the table) or are you adding a query key for the relationship mapping?
    Answer: We are mapping a DirectQueryKey (see "businessFuncId" above) to a field on the table directly related to the component being updated. However, the query key represents the foreign key (primary key) for a OneToOne mapping contained within an aggregate descriptor.
    Here's an explanation of the OR mapping/object relationship (reference the query definition in the original posting for more details):
    RegisterImpl (target of updateAllQuery) contains a ReservedDetail (Aggregate mapping) which in turn contains a OneToOne mapping to a BusinessFunction (read-only lookup type object).
    We created a DirectQueryKey: businessFuncId which represents the FK on the RegisterImpl table that is used within the ReservedDetail aggregate mapping for the OneToOne mapping to the BusinessFunction component.
    This query key is for query purposes only. As you can see from the query definition it is used to avoid a join with a BusinessFunction table. This is because, as we understand it, an UpdateAllQuery can only update ONE target component (table). The problem we're having is: how do you set a OneToOne FK reference field on the target component to NULL???
    2) To which descriptor are you adding the query key?
    Answer: The query key ("businessFuncId") must be, by convention, defined within the ReservedDetail aggregate mapping. When we map the ReservedDetail aggregate mapping within the RegisterImpl component mapping, we map the query key to the businessFunction FK field contained with the RegisterImpl table, (the target table we're trying to update).

  • Aggregate descriptors and query keys

    We are in the process of migrating from TopLink to EclipseLink.
    I have a class Audit that contains the auditing columns that are common to other classes
    I have another class Customer that extends the Audit.
    Audit is an aggregate descriptor mapped in Customer.
    There is an UpdateAllQuery to update a single customer row in the customer.
    To update the audit column an addUpdate is added on the field.
    query.addUpdate(builder.getField("LAST_UPDT_USER_C"), "Test");
    When this query is executed I get an error saying the field is not mapped. But this field is mapped in the aggregate.
    This used to work in TopLink.
    Any idea why it errors out and how to solve it?
    Thanks for the help.
    The JavaDoc says that getField work on non mapped field -
    Expression org.eclipse.persistence.internal.expressions.DataExpression.getField(String fieldName)
    ADVANCED: Return an expression representing a field in a data-level query. This is used internally in EclipseLink, or to construct queries involving fields and/or tables that are not mapped.
    ERROR -
    Exception Description: Attribute name or expression passed as a first parameter to addUpdate method defines a field from a table that's not mapped to query descriptor.
    Attribute name or Expression: [
    Field LAST_UPDT_USER_C
    Base QUERY OBJECT]
    Wrong field: [LAST_UPDT_USER_C]

    Hello,
    I can't see what has changed in the area that throws the exception, as it seems similar to TopLink 11. Which version of TopLink was this working on, and what version of EclipseLink are you using?
    If the field is mapped, why are you not using the attribute mapping via the builder.get("audit").get("auditMappingForTheField") instead of accessing the field directly?
    The code itself seems to throw an exception because the table for the field cannot be found in the descriptor's table list You can try to define the table name in the field and see if this helps: builder.getField("Tablename.LAST_UPDT_USER_C"). If this works, please file a bug as it should not be neccessary or the error message needs to be fixed.
    Best Regards,
    Chris

  • Help with aboutToUpdate

    Hi,
    I need to automatically set a 'last_update_user' and 'last_update_date' when an object is updated. I believe I need to use a descriptorEvent, but that's about as far as I've got.
    I'm using mapping workbench 9.0.4.2
    I can view the events tab for the descriptor, but when I select 'inserting methods', there are no options available in the drop-down for 'about to'.
    What I'd like to do is write the logic for this operation in a separate class, then configure the descriptors in workbench to refer to this class. Can someone explain how I do this?
    thanks

    You can add a DescriptorEventListener to register for this event. The Mapping Workbench does not currently support registering an event listener, so you need to define an amendment (after-load) method to do this.
    Your event listener can then add the user and time to the update events row.
    i.e.
    public void addToDescriptor(Descriptor descriptor) {
    descriptor.getEventManager().addEventListener(new DescriptorEventAdapter() {
    public void aboutToUpdate(DescriptorEvent event) {
    event.getRow().put("LAST_USER", MyApp.getCurrentUser());
    event.getRow().put("UPDATE_TIME", new Timestamp(System.currentTimeMillis()));
    }

  • UpdateAllQuery

    I get an exception when I run an updateAllQuery without setting a SelectionCriteria.
    Is it not possible to do a whole table update using updateAllQuery?
    Can someone please point what is wrong.
    Thanks
    UpdateAllQuery updateQuery = new UpdateAllQuery(Person.class);
    updateQuery.addUpdate("name", "Z");
    updateQuery.setShouldDeferExecutionInUOW(false);
    updateQuery.setCacheUsage(UpdateAllQuery.INVALIDATE_CACHE);
    uow.executeQuery(updateQuery);
    Exception:
    Exception [TOPLINK-6089] (Oracle TopLink - 10g Release 3 (10.1.3.1.0) (Build RELEASE)): oracle.toplink.exceptions.QueryException
    Exception Description: The expression has not been initialized correctly. Only a single ExpressionBuilder should be used for a query.
    For parallel expressions, the query class must be provided to the ExpressionBuilder constructor, and the query's ExpressionBuilder must
    always be on the left side of the expression.

    Thanks for the update.
    Is there any other way to add 1=1?
    I am using this
    updateQuery.setSelectionCriteria(updateQuery.getExpressionBuilder().postfixSQL("1=1"));
    It works, but the JavaDoc mentions this -
    Warning: Allowing an unverified SQL string to be passed into this method makes your application vulnerable to SQL injection attacks.

  • Changes to lastmodified column in aboutToUpdate event doesn't work

    We use the following code in the aboutToUpdate event to set the lastmodified date on changed object:
    DatabaseRow row = event.getRow();
    lastModified = now();
    Descriptor descriptor = event.getSession().getDescriptor(this);
    DatabaseMapping mapping = descriptor.getMappingForAttributeName("lastModified");
    if (mapping != null) {
    String modField = ((DirectToFieldMapping) mapping).getFieldName();
    DatabaseTable table = descriptor.getDefaultTable();
    String qualifier = table.getQualifiedName();
    if (qualifier.length() > 0) {
    modField = qualifier + "." + modField;
    row.put(modField, lastModified);
    This code is in the aboutToUpdate event on the superclass in the hierarchy.
    However, on one of the machines, this code doesn't update the lastmodified for one of the types of objects. Lastmodified is updated on objects of other types on that machine. The same code works fine on objects of all types on other machines.
    I enabled the logSQL mechanism of TOPLink and found that update SQL was not modifying the lastModified field. However, when I look at the code through debugger, I do see the lastmodified in the DatabaseRow of the event.
    After having verified the versions of TOPLink and jdbc driver, I'm trying to debug the issue by previewing the sql that is generated by TOPLink. These are the 2 things I have tried so far and both of them return null SQL String:
    1.
    WriteObjectQuery dbQuery = new WriteObjectQuery();
    dbQuery.setObject(this);
    try {
    dbQuery.prepareCall(event.getSession(), row);
    String query = dbQuery.getSQLString();
    } catch (QueryException qe) {
    qe.printStackTrace();
    2.
    DatabaseQuery d = event.getQuery();
    d.prepareCall(event.getSession(), d.getTranslationRow());
    String query2 = d.getSQLString();

    Very strange. Is there anything special about the machine or the class that it does not work for? Did you verify the event is being raised for that class on that machine?
    The only thing that I can think of that would cause this is if the class were using custom SQL or a custom query for its update.
    The reason that you do not see the SQL when creating a WriteObjectQuery is that it does not generate it's SQL until after the prepare as it must first determine if an insert or update is required. It also will not work with an UpdateObjectQuery, because the update SQL is dynamic (depends on what was changed) so the SQL cannot be prepared in the query.
    I believe the following will return the SQL that TopLink would generate for an update, provided you use the row from the aboutToUpdateEvent.
    UpdateObjectQuery dbQuery = new UpdateObjectQuery();
    dbQuery.setObject(event.getObject());
    dbQuery.setModifyRow(event.getRow());
    dbQuery.prepareCall(event.getSession(), event.getQuery().getTransactionRow());
    String query = dbQuery.getSQLString();

  • Toplink compared to its competitors and futur of this product in O/R domain

    I am sincerely disappointed by the evolution of TopLink whereas I have been in favour of this product for several years at important customers.
    1- New version 10.1.3 (10.0.3 included) has been in beta for almost 3 years!
    2- patch corrects only the bugs without any evolution on the level of the functionalities, all the new functionalities are in the 10.1.3 which does not manage to leave. By way of comparison of the product as KODO JDO brings in each patch: New features + Notable Exchanges + Bugfixes 3.4.0 - 3.3.4 - 3.3.3 - 3.3.2 - 3.3.1 - 3.3.0 -! I AM JEALOUS OF KOKO CUSTOMERS
    You can see KOKO evolution on 2005 at : http://www.solarmetric.com/Software/Documentation/3.4.0/docs/relnotes.html
    3- Other editors (KODO+COCOBASE+JBOSS) start to set up beta versions EJB 3.0 with “very very “complete documenatation and product. Whereas Toplink provides only examples (tutorial) over OC4J (10.1.3 preview in beta since 3 years!) . No real toplink (bata vversion) of Documentation or Product. Like KODO 4 @ : http://www.solarmetric.com/Software/beta/4.0.0EA/
    + Real and Rich documentation @ : http://www.solarmetric.com/Software/Documentation/4.0.0EA/docs/
    4- 4 10.1.3 preview Toplink brings functionalities JCA, JAXP but not much of things on the level of mapping O/R: updateAll, cacheEviction, returning, java.util.logging. These functionalities already available on the others concurrent product do not make me any more dream !
    I hope that it other evolutions (not announced) on Object/Relational scope ?
    5-     does Oracle have still wants to really invest in O/R mapping. There is much marketing, much of mediatic show (Eclipse, GlassFish, EJB3 lead) but not much of technical evolutions compared to competitors.
    Thank you to product management make a factual answer because I am a real customer, I am really in favour of the product for 5 years. But I am really disappointed when I see new small actors (KODO...) much better doing?

    I am sincerely disappointed by the evolution of
    TopLink whereas I have been in favour of this product
    for several years at important customers. I am sorry to hear about your disappointment. Hopefully I can provide some insight into where we are with TopLink. It is a critical part of our J2EE/EJB infrastructure providing its classic POJO persistence as well as EJB 2.1 CMP/BMP, and now our preview support of EJB 3.0 persistence.
    1- New version 10.1.3 (10.0.3 included) has been in
    beta for almost 3 years! As an integrated part of the Oracle Application Server we ship in coordination with the overall release. I understand your frustration and we are working hard to ensure we have a high quality 10.1.3 AS release as well as a first rate persistence solution.
    2- patch corrects only the bugs without any evolution
    on the level of the functionalities, all the new
    functionalities are in the 10.1.3 which does not
    manage to leave. By way of comparison of the product
    as KODO JDO brings in each patch: New features +
    Notable Exchanges + Bugfixes 3.4.0 - 3.3.4 - 3.3.3 -
    3.3.2 - 3.3.1 - 3.3.0 -! I AM JEALOUS OF KOKO
    CUSTOMERS
    You can see KOKO evolution on 2005 at :
    http://www.solarmetric.com/Software/Documentation/3.4.
    0/docs/relnotes.htmlOur patch-sets are just that. Patches to fix issues important to our customers. They are not new feature releases. As an independent product (prior to the Oracle acquisition) we also had many smaller releases but we were also not well integrated with any container. This integration providing better diagnostics, management, and out of the box support requires us to integrate with the container. I believe you will find Kodo will start to feel this as BEA starts to deliver an integrated persistence solution that may compete with TopLink's complete solution.
    Note: This does not mean that we are not supporting other containers. We do extensive testing across non-Oracle databases and application servers to ensure that we continue to work well there as well.
    3- Other editors (KODO+COCOBASE+JBOSS) start to set
    up beta versions EJB 3.0 with “very very “complete
    documenatation and product. Whereas Toplink provides
    only examples (tutorial) over OC4J (10.1.3 preview in
    beta since 3 years!) . No real toplink (bata
    vversion) of Documentation or Product. Like KODO 4 @
    : http://www.solarmetric.com/Software/beta/4.0.0EA/
    + Real and Rich documentation @ :
    http://www.solarmetric.com/Software/Documentation/4.0.
    0EA/docs/At the time of our EJB 3.0 preview we had the best support available for both within the container as well as outside the container. This was primarily documented through how-to's. As we move towards our release (post 10.1.3) that implements the complete specification, which is not yet final, we will be delivering more complete and formal documentation.
    The feedback I had received on our how-to's has been excellent to date. It does require more updates now with our 10.1.3 release to address additional functionality we will be providing in the EJB 3.0 persistence areas.
    4- 4 10.1.3 preview Toplink brings functionalities
    JCA, JAXP but not much of things on the level of
    mapping O/R: updateAll, cacheEviction, returning,
    java.util.logging. These functionalities already
    available on the others concurrent product do not
    make me any more dream !
    I hope that it other evolutions (not announced) on
    Object/Relational scope ?If you look at the list of new features in 10.1.3 here you will see that we have also invested heavily in improvements to our core ORM.
    updateAll = UpdateAllQuery
    cacheEviction = cache invalidation/expiration (time-to-live) as well as cache coordination mode using invalidation
    returning= we have a returning policy for use with triggers and stored procs
    logging = we have updated our logging infrastructure to use java.util.logging
    Many of these and others have been available in our earlier previews as well. We have a dedicated team here focused both on ORM as well as OXM (including JCA). I would estimate that 75% of our efforts have been on enhanced ORM functionality.
    >
    5- does Oracle have still wants to really invest in
    O/R mapping. There is much marketing, much of
    mediatic show (Eclipse, GlassFish, EJB3 lead) but not
    much of technical evolutions compared to
    competitors.I believe with 10.1.3 we raise the bar of ORM persistence solutions. The new ORM functionality and improved mapping editors will provide existing users new features they have been asking for as well as help grow the developer community. Our community edition of TopLink in GlassFish delivers core ORM persistence to those projects where the full licensed product is not required as well as providing these customers a seamless upgrade to the full solution when they wish to.
    As this release comes out we will be updating our collateral and I will strive to ensure our continued leadership and investment in ORM functionality is reflected.
    >
    Thank you to product management make a factual answer
    because I am a real customer, I am really in favour
    of the product for 5 years. But I am really
    disappointed when I see new small actors (KODO...)
    much better doing?I hope you find this helpful. I would be more than happy to discuss this further. This does make it clear that we need to be more vocal and clear about our work as well as getting the 10.1.3 release out the door. I appreciate the feedback and will try to address these concerns directly.
    Doug Clarke
    Principal Product Manager
    Oracle TopLink

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

  • A problem with Threads and loops.

    Hi, I have some code that needs to be constantly running, like while(true)
          //code here
    }However, the code just checks to see if the user has input anything (and then if the user has, it goes to do some other stuff) so I don't need it constantly running and hogging up 98% of the CPU. So I made my class (which has the method that needs to be looped, call it ClassA) implement Runnable. Then I just added the method which needed to be looped into the public void run()
    I have another class which creates an instance of the above class (call it ClassB), and the main(String[] args) is in there.
    public static void main(String[] args)
              ClassA test = new ClassA();
              Thread thread = new Thread(test.getInstanceOfClassA());
              thread.start();
              while(true)
                           //I do not know what to put here
                   try
                        thread.sleep(100);
                   catch(InterruptedException iex)
         }However, the thread only calls run() once,(duh...) but I can't think of away to get it to run - sleep - run -sleep forever. Can someone help me?

    Hi, I have some code that needs to be constantly
    running, like while(true)
    //code here
    }However, the code just checks to see if the user has
    input anything (and then if the user has, it goes to
    do some other stuff) so I don't need it constantly
    running and hogging up 98% of the CPU. Where does the user input come from. Are you reading from an InputStream? If so, then your loop will be blocked anyway when reading from the InputStream until data is available. During that time, the loop will not consume processor cycles.
    public static void main(String[] args)
              ClassA test = new ClassA();
    Thread thread = new Thread(test.getInstanceOfClassA());I have never seen this idiom. If ClassA instanceof Runnable, you simply write new Thread(test).
              thread.start();
              while(true)
    //I do not know what to put
    do not know what to put here
                   try
                        thread.sleep(100);
                   catch(InterruptedException iex)
         }However, the thread only calls run() once,(duh...)Yeah, why would you want to call it more than once given that you have an infinite loop in ClassA.run()?
    Harald.
    Java Text Crunching: http://www.ebi.ac.uk/Rebholz-srv/whatizit/software

  • A problem with Threads and MMapi

    I am tring to execute a class based on Game canvas.
    The problem begin when I try to Play both a MIDI tone and to run an infinit Thread loop.
    The MIDI tone "Stammers".
    How to over come the problem?
    Thanks in advance
    Kobi
    See Code example below:
    import java.io.IOException;
    import java.io.InputStream;
    import javax.microedition.lcdui.Graphics;
    import javax.microedition.lcdui.Image;
    import javax.microedition.lcdui.game.GameCanvas;
    import javax.microedition.media.Manager;
    import javax.microedition.media.MediaException;
    import javax.microedition.media.Player;
    public class MainScreenCanvas extends GameCanvas implements Runnable {
         private MainMIDlet parent;
         private boolean mTrucking = false;
         Image imgBackgound = null;
         int imgBackgoundX = 0, imgBackgoundY = 0;
         Player player;
         public MainScreenCanvas(MainMIDlet parent)
              super(true);
              this.parent = parent;
              try
                   imgBackgound = Image.createImage("/images/area03_bkg0.png");
                   imgBackgoundX = this.getWidth() - imgBackgound.getWidth();
                   imgBackgoundY = this.getHeight() - imgBackgound.getHeight();
              catch(Exception e)
                   System.out.println(e.getMessage());
          * starts thread
         public void start()
              mTrucking = true;
              Thread t = new Thread(this);
              t.start();
          * stops thread
         public void stop()
              mTrucking = false;
         public void play()
              try
                   InputStream is = getClass().getResourceAsStream("/sounds/scale.mid");
                   player = Manager.createPlayer(is, "audio/midi");
                   player.setLoopCount(-1);
                   player.prefetch();
                   player.start();
              catch(Exception e)
                   System.out.println(e.getMessage());
         public void run()
              Graphics g = getGraphics();
              play();
              while (true)
                   tick();
                   input();
                   render(g);
          * responsible for object movements
         private void tick()
          * response to key input
         private void input()
              int keyStates = getKeyStates();
              if ((keyStates & LEFT_PRESSED) != 0)
                   imgBackgoundX++;
                   if (imgBackgoundX > 0)
                        imgBackgoundX = 0;
              if ((keyStates & RIGHT_PRESSED) != 0)
                   imgBackgoundX--;
                   if (imgBackgoundX < this.getWidth() - imgBackgound.getWidth())
                        imgBackgoundX = this.getWidth() - imgBackgound.getWidth();
          * Responsible for the drawing
          * @param g
         private void render(Graphics g)
              g.drawImage(imgBackgound, imgBackgoundX, imgBackgoundY, Graphics.TOP | Graphics.LEFT);
              this.flushGraphics();
    }

    You can also try to provide a greater Priority to your player thread so that it gains the CPU time when ever it needs it and don't harm the playback.
    However a loop in a Thread and that to an infinite loop is one kind of very bad programming, 'cuz the loop eats up most of your CPU time which in turn adds up more delays of the execution of other tasks (just as in your case it is the playback). By witting codes bit efficiently and planning out the architectural execution flow of the app before start writing the code helps solve these kind of issues.
    You can go through [this simple tutorial|http://oreilly.com/catalog/expjava/excerpt/index.html] about Basics of Java and Threads to know more about threads.
    Regds,
    SD
    N.B. And yes there are more articles and tutorials available but much of them targets the Java SE / EE, but if you want to read them here is [another great one straight from SUN|http://java.sun.com/docs/books/tutorial/essential/concurrency/index.html] .
    Edited by: find_suvro@SDN on 7 Nov, 2008 12:00 PM

Maybe you are looking for

  • Error while updating to target i.e., InfoCube

    Hi All, I am getting error as " Char value CPV does not exist in the master data table of char ' 0SALES_UNIT' .Therefore this value could not be transformed into internal SID" Do let me know the soln for above error , Regards, Anjali Singh

  • Deploying Azure Web Site and Custom Domain Name

    I'm new to Azure and not at all familiar with the various methods of publishing to Azure via Git, etc. I belong to the old school of plain old IIS folder structures and uploading HTML files to Inetpub directory for deploying web contents. I have crea

  • Creative Media Source 5 and Zen

    I own the Zen VW and use the Creative Media Source 5. The problem I find is when I try to transfer songs to the Zen. I am trying to copy my smart playlist of fi've star tracks over. On the pc it has over 000 tracks, but only 550 or so end up on my Ze

  • I have bought the adobe acrobat xi but didnt receive e-mail and my cridet card was charged already

    dear sirs I just bouth the acrobat XI but didn't receive any confirmation number nor an e-mail and my credit card was already charged, how can I contact service center@@

  • Cisco WLSE

    Hi, I am having problem configuring (managing) two devices with Cisco WLSE, after importing the file with AP IP address I get CDP Discovery completed, but I also get Number of devices (re)discovered 0. For all AP that I am able to configure(manage) I