ConversionException in Toplink TIMESTAMP mapping

We have a column mapped in Toplink as java.sql.Timestamp. In order to make this work they've added a few lines to the toplink Oracle.xml file defining the timestamp type.
Inside JDeveloper this runs fine, however when run under Ant I get the following:
EXCEPTION [TOPLINK-3001] (TopLink - 9.0.3 (Build 423)): oracle.toplink.exceptions.ConversionException
EXCEPTION DESCRIPTION: The object [oracle.sql.TIMESTAMP@258], of class [class oracle.sql.TIMESTAMP], could not be converted to [class java.sql.Timestamp].
I've downloaded the newest JDBC drivers but the problem persists.
Anyone have some advice?

EXAMPLE CONVERSION MANAGER SOLUTION:
package example;
import java.sql.SQLException;
import java.sql.Timestamp;
import oracle.sql.*;
import oracle.toplink.exceptions.ConversionException;
import oracle.toplink.internal.helper.ConversionManager;
* Example conversion manager that will add the ability to convert Oracle9i DB's
* TIMESTAMP values into java.sql.Timestamp. This is required for TopLink
* 9.0.3 and 9.0.4.
* To use this class you must register the conversion manager prior to loading
* your project.
* <code>
* ConversionManager.setDefaultManager(new MyConversionManager());
* </code>
public class MyConversionManager extends ConversionManager {
private static final Class TIMESTAMP_TYPE = TIMESTAMP.class;
     protected Timestamp convertObjectToTimestamp(Object original) {
if (original.getClass() == TIMESTAMP_TYPE) {
try {
return ((TIMESTAMP) original).timestampValue();
} catch (SQLException se) {
throw ConversionException.couldNotBeConverted(original, Timestamp.class, se);
// NOTE: Similar check and comparisons could be done for TIMESTAMPTZ and TIMESTAMPLTZ
return super.convertObjectToTimestamp(original);
}

Similar Messages

  • How can i using datasource in toplink's map file

    In the TopLink map :
    <toplink:login xsi:type="toplink:database-login">
    <toplink:platform-class>oracle.toplink.platform.database.oracle.Oracle10Platform</toplink:platform-class>
    <toplink:user-name>test</toplink:user-name> <toplink:password>C23487CFA591952D44310804F3D591CB</toplink:password>
    <toplink:sequencing>
    <toplink:default-sequence xsi:type="toplink:native-sequence">
    <toplink:preallocation-size>1</toplink:preallocation-size>
    </toplink:default-sequence>
    </toplink:sequencing>
    <toplink:driver-class>oracle.jdbc.driver.OracleDriver</toplink:driver-class>
    <toplink:connection-url>jdbc:oracle:thin:@192.168.0.1:1521:testdb</toplink:connection-url>
    <toplink:bind-all-parameters>true</toplink:bind-all-parameters>
    </toplink:login>
    How can i modify it using datasource?

    The login information stored in the map file is good for direct connection and design time login information.
    For your runtime login information I would use the sessions configuration (sessions.xml). It provides complete deployment configuration:
       <session>
          <name>my-session</name>
          <!-- This references the ORM map XML file -->
          <project-xml>META-INF/employee-basic.xml</project-xml>
          <session-type>
             <server-session/>
          </session-type>
          <login>
             <datasource>jdbc/TopLinkDS</datasource>
             <uses-external-connection-pool>true</uses-external-connection-pool>
             <uses-external-transaction-controller>true</uses-external-transaction-controller>
          </login>
          <external-transaction-controller-class>oracle.toplink.essentials.transaction.oc4j.Oc4jTransactionController</external-transaction-controller-class>
          <enable-logging>true</enable-logging>
          <logging-options>
             <log-exceptions>true</log-exceptions>
             <print-thread>false</print-thread>
             <print-date>false</print-date>
          </logging-options>
       </session>Doug

  • How to use TopLink's mapping info at runtime

    Can anybody kindly instruct how to do the following:
    1) Once the "JavaSource.java" file or the "ProjectDeployment.xml" file is generated by TopLink from a TopLink project, how can it be included and used in a J2EE project at runtime? I understand that this step may be specific to the type of IDE used, let us say WebLogic, WebSphere or JDeveloper9i.
    2) Can TopLink generate the file "sessions.xml" automatically or it has to be hard-coded? Does this file have also to be included in a J2EE project under the directory of META-INF at runtime?

    Hi John,
    Probably the best way I can explain the process of putting a J2EE app with TopLink into production would be to describe the best practices of doing so.
    Firstly, I recommend using an IDE to develop your Java source code, although it is possible to generate Java source directly from the Mapping Workbench, this is considered more of a rapid prototyping or quick start process. Once the Java source has been compiled, the Meta-Data (project.xml) can be deployed from the Mapping Workbench.
    The next step really depends on the type of application you are creating. Since you are developing a J2EE based application and it will be multi-user, TopLink recommends using a ServerSession architecture. (Consult the documentation for detailed explanations). Configuring the session can be done in a number of ways, the best way would be to use the SessionManager and an external file called sessions.xml. Both the sessions.xml and project.xml must be visible by the J2EE component that will be using it. (Servlet/Session Bean, etc...). This is done through managing your deployment properly using something like an EAR.
    The key to getting the application and TopLink working together is the session, and here's a basic example on how you could set this up:
    sessions.xml code:
    <toplink-configuration>
         <session>
              <name>myProject</name>
              <project-xml>myProject.xml</project-xml>
              <session-type>
                   <server-session/>
              </session-type>
              <connection-pool>
                   <is-read-connection-pool>false</is-read-connection-pool>
                   <name>default</name>
                   <max-connections>10</max-connections>
                   <min-connections>5</min-connections>
              </connection-pool>
              <enable-logging>true</enable-logging>
         </session>
    </toplink-configuration>
    Somewhere in your application code, you might have a login method that makes use of the SessionManager to load and create the session:
    SessionManager sm = SessionManager.getManager();
              Server serverSession = (Server)sm.getSession("myProject", this.getClass().getClassLoader());
    The sessions.xml must be created manually at this point, a future version of the TopLink product will contain an editor which will help out.
    Darren Melanson

  • Toplink XML mapping: mapping choice

    I am doing a proof of concept and we try to use Toplink mapping without changing the original XML Schema.
    We use Toplink 10.1.3.
    The XML contains a child element defined as a complexType with a <choice>of 3 elements of type A, B or C.
    Those 3 elements do have some common properties and we wanted to map them as a collection of concrete Java classes A, B & C extending a common Abstract Java class.
    Any clue how we can do that?
    Robin

    Ok, I understand.
    So basically, I replace the [choice] with A,B or C in my schema by a [sequence] where A, B or C are with minOccurs=0.
    In my case, I have a collection of these choices.
    [choice minOccurs="1" maxOccurs="unbounded"]
    The problem is that there is a list of A, B & C elements which are unsorted.
    [root]
    [some child elements]
    [a]
    [c]
    [a]
    and so on
    In the schema, the list of A, B & Cs is represented by a choice with maxOccurs="unbounded".
    I can't figure how to express that in TopLink, if ever it is possible to handle this case.
    Thanks for your help.
    Robin
    Message was edited by:
    mulkers: I have replaced XML elements brackets by [] because the forum message editor was dropping them

  • TOPLINK-6094: Mapping OntToMany (JPA)

    Hello!
    I'm learning how to use Java Persistence API and I'm getting an error which i don't know more what to do to solve it... :(
    Exception Description: The parameter name [cdUsuar] in the query's selection criteria does not match any parameter name defined in the query.
    Query: ReadAllQuery(sysgroups.entity.Profissao)
    at oracle.toplink.essentials.exceptions.QueryException.parameterNameMismatch(QueryException.java:966)
    at oracle.toplink.essentials.internal.expressions.ParameterExpression.getValue(ParameterExpression.java:206)
    So, I'm mapping the tables User (USUARIO) and Jobs(PROFISSAO) in my entities like that:
    Entities:
    @javax.persistence.Entity
    @javax.persistence.Table(name = "USUARIO")
    @javax.persistence.NamedQueries( {
    @javax.persistence.NamedQuery( name = "Usuario.findByCdUsuar",
    query = "SELECT u FROM Usuario u WHERE u.cdUsuar = :cdUsuar"),
    @javax.persistence.NamedQuery( name = "Usuario.findByLogin",
    query = "SELECT u FROM Usuario u WHERE u.dsLogin = :dsLogin and u.dsSenha = :dsSenha"),
    @javax.persistence.NamedQuery( name = "Usuario.findByNmUsuar",
    query = "SELECT u FROM Usuario u WHERE u.nmUsuar = :nmUsuar"),
    @javax.persistence.NamedQuery( name = "Usuario.findByDsLogin",
    query = "SELECT u FROM Usuario u WHERE u.dsLogin = :dsLogin"),
    @javax.persistence.NamedQuery( name = "Usuario.findByDsSenha",
    query = "SELECT u FROM Usuario u WHERE u.dsSenha = :dsSenha")
    public class Usuario implements Serializable {
    @javax.persistence.Id
    @javax.persistence.Column(name = "CD_USUAR", nullable = false)
    @GeneratedValue(strategy=javax.persistence.GenerationType.SEQUENCE, generator="SqUsuario")
    @SequenceGenerator(name="SqUsuario",sequenceName="SQ_USUARIO", allocationSize=20)
    private BigDecimal cdUsuar;
    @javax.persistence.Column(name = "NM_USUAR", nullable = false)
    private String nmUsuar;
    @OneToMany
    @JoinTable(
    name="USUARIO_PROFISSAO",
    joinColumns=@JoinColumn(name="CD_USUAR", referencedColumnName="cdUsuar"),
    inverseJoinColumns=@JoinColumn(name="CD_PROFI", referencedColumnName="cdProfi")
    private java.util.List <sysgroups.entity.Profissao> profissoes;
    // gets and sets...
    @javax.persistence.Entity
    @javax.persistence.Table(name = "PROFISSAO")
    @javax.persistence.NamedQueries( {
    @javax.persistence.NamedQuery(name = "Profissao.findByCdProfi", query = "SELECT p FROM Profissao p WHERE p.cdProfi = :cdProfi"),
    @javax.persistence.NamedQuery(name = "Profissao.findAll", query = "SELECT OBJECT(p) FROM Profissao p"),
    @javax.persistence.NamedQuery(name = "Profissao.findByDsProfi", query = "SELECT p FROM Profissao p WHERE p.dsProfi = :dsProfi")
    public class Profissao implements Serializable {
    @javax.persistence.Id
    @javax.persistence.Column(name = "CD_PROFI", nullable = false)
    private BigDecimal cdProfi;
    @javax.persistence.Column(name = "DS_PROFI")
    private String dsProfi;
    // gets and sets
    The tables are like that:
    USUARIO
    cd_usuar (PK)
    nm_usuar
    PROFISSAO
    cd_profi (PK)
    ds_profi
    USUARIO_PROFISSAO
    cd_usuar
    cd_profi
    And the error appears, for example, when i try to do something like that:
    Usuario usuario = (Usuario)manager.createNamedQuery("Usuario.findByLogin").
    setParameter("dsLogin",login.getLogin()).
    setParameter("dsSenha",login.getSenha()).
    getSingleResult();
    if (usuario.getProfissoes() != null) { // OK
    // Test
    System.out.println("Nr Profissoes = "+ usuario.getProfissoes().size());
    // ERROR...
    enviroment:
    netbeans 5.5 beta 2 Build: 200607190830, Ent. Pack 20060810
    Sun Java System App Server 9
    jdk1.5.0_05
    Guys,
    Sorry my poor english, but I hope u can get the idea.
    Thanks a lot!

    Hello,
    The original posting seems to have defined the relationship mappings joinColumns incorrectly. For instance, in the case of :
    joinColumns=@JoinColumn(name="CD_USUAR", referencedColumnName="cdUsuar"),
    The referencedColumnName should refer to the Database table's Column name, not the object's property name. So USUARIO_PROFISSAO's CD_USUAR column should reference USUARIO's CD_USUAR column, not "cdUsuar" which doesn't exist.
    Check to see your mappings are set up correctly as well.
    Best Regards,
    Chris

  • TopLink : attribute-mapping direct-xml-type-mapping

    hi
    Using TopLink Workbench 10g Release 3 (10.1.3.0.0) Build 060118 it is possible to configure a "Direct to XML Type" mapping.
    see http://www.oracle.com/technology/products/ias/toplink/doc/1013/main/_html/relmapun004.htm#CHDFIFEF
    In the TopLink map this results in a
    <opm:attribute-mapping xsi:type="toplink:direct-xml-type-mapping">Is there a way to configure this kind of attribute mapping using JDeveloper?
    thanks
    Jan Vervecken

    Hi Paul,
    The problem you're going to hit trying to do this with a TransformationMapping in 904 (as in my other post) is that during the UnitOfWork commit, when TopLink is checking for changes a .equals will end up being called on an XMLType instance which will throw a NullPointerException (in oracle.sql.Datum I think).
    One way to work around this (depending on the requirements for your app) is to set the isMutable flag on the TransformationMapping to false. This flag indicates that the value in the object's attribute isn't going to be changed, so we don't bother trying to check to see if it's changed. This will allow you to do reads, inserts and deletes with no problems.
    The downside is that if you need to be able to change the XML content in your objects model and do an update of the row, TopLink will never detect a change and never issue an update of the XMLType field.
    Incidentilly, if you happen to hit the same issue you had with the DirectToXMLTypeMapping where you were getting back an instance of java.sql.Opaque instead of the expected oracle.xdb.XMLType from JDBC, you should be able to handle that case in your AttributeTransformer by doing
    XMLType myXML = XMLType.createXML(myOpaque)
    Document = myXML.getDocument();
    Hope this helps
    Matt MacIvor

  • TOPLINK Timestamp Issue

    We have noticed that when TOPLINK is used to insert a datetime into our table, the time entered is always an hour ahead. We are in the EST zone. When we use custom SQL and use SYSDATE to enter or update dates, the datetime is stored at the correct time zone. The BPEL transforms always show the time correctly in the BPEL monitor but by the time it gets inserted into the table it is an hour ahead. I thought maybe it was getting the date from the server but we checked and that time is local time.
    Any ideas?

    Are you trying to insert the date from BPEL Console or from ESB console. If you are inserting it from ESB console check the SYS time in ESB database.
    I guess there might be a hour time difference ESB and BPEL metadata.
    -Ramana.

  • Toplink Missing  Mapping  - Jdeveloper 11g BUG-

    Hi ,
    I am generating two entities using JDeveloper 11g both Tables has 280 columns, I am using "entities from tables" wizard.
    For the first table it is generating the proper meta data like this one:
    @Id
    @Column(name="CLIENT_ID_DWH", nullable = false)
    private String clientIdDwh;
    @Id
    @Column(nullable = false)
    private String effectivefromdate;
    @Column(nullable = false)
    private String effectivetodate;
    @Column(name="HEDAAB_TXBRONC_DATE")
    private Timestamp hedaabTxbroncDate;
    @Column(name="HEDAAB_TXBRONC_EFFDT")
    private String hedaabTxbroncEffdt;
    @Column(name="HEDAAB_TXBRONC_QUAL")
    private String hedaabTxbroncQual;
    @Column(name="HEDAAB_TXBRONC_RCVD")
    private Long hedaabTxbroncRcvd;
    @Column(name="HEDAAB_TXBRONC_REASON")
    private String hedaabTxbroncReason;
    @Column(name="HEDAAB_TXBRONC_REQ")
    private Long hedaabTxbroncReq;
    @Column(name="HEDADD01_ADHDINIT_DATE")
    private Timestamp hedadd01AdhdinitDate;
    @Column(name="HEDADD01_ADHDINIT_EFFDT")
    private String hedadd01AdhdinitEffdt;
    @Column(name="HEDADD01_ADHDINIT_QUAL")
    private String hedadd01AdhdinitQual;
    @Column(name="HEDADD01_ADHDINIT_RCVD")
    private Long hedadd01AdhdinitRcvd;
    @Column(name="HEDADD01_ADHDINIT_REASON")
    private String hedadd01AdhdinitReason;
    @Column(name="HEDADD01_ADHDINIT_REQ")
    For the second table it is generating the following meta data for exampe:
    @Id
    @Column(nullable = false)
    private String clientiddwh;
    @Id
    @Column(nullable = false)
    private String cycle;
    @Id
    @Column(nullable = false)
    private String cyclemod;
    private Long hedisadhdmedfollowupinitiald;
    private String hedisadhdmedfollowupinitialdt;
    private Long hedisadhdmedfollowupinitialn;
    private String hedisadhdmedfollowupinitialop;
    private String hedisadhdmedfollowupinitialqu;
    private Long hedisadhdmedfolupcontd;
    private String hedisadhdmedfolupcontdt;
    private Long hedisadhdmedfolupcontn;
    private String hedisadhdmedfolupcontop;
    private String hedisadhdmedfolupcontqu;
    private Long hedisadolwellcarevisitsd;
    private String hedisadolwellcarevisitsdt;
    private Long hedisadolwellcarevisitsn;
    private String hedisadolwellcarevisitsop;
    This is totally not understandable, what is going on?
    A.B

    Hello,
    You might want to post this in the JDeveloper forums. For the second class, it just looks like the column names haven't been put into the generated class. This is only a problem if the defaulted column names would not match what is in the database - ie @Id String clientiddwh will default to use the "CLIENTIDDWH" field. Does this match what is in the table?
    Best Regards,
    Chris

  • Oracle Toplink Jaxb mapping

    Hi,
    i try to use the developer Preview 3(10.1.3.0)workbench
    and it work fine with simple java class (two xml files generation).
    But with java servlet who use the same classes nothing
    work i got some exception :
    05/03/01 08:24:33 exceptionProvider oracle.toplink.ox.jaxb.JAXBContextFactory could not be instantiated: java.lang.NoSuchMethodError: oracle.toplink.publicinterface.Session oracle.toplink.tools.sessionmanagement.SessionManager.getSession(oracle.toplink.tools.sessionconfiguration.XMLSessionConfigLoader, java.lang.String, java.lang.ClassLoader, boolean, boolean)
    I have also a strange message in the log window in jdev 9052 :
    Cutting log (size: 101767, max: 100000)Component returned failure code: 0x80470002 (NS_BASE_STREAM_CLOSED) [nsIFileOutputStream.write]Component returned failure code: 0x80470002 (NS_BASE_STREAM_CLOSED) [nsIFileOutputStream.write]Component returned failure code: 0x80470002 (NS_BASE_STREAM_CLOSED) [nsIFileOutputStream.write]Cutting log (size: 101866, max: 100000)Error cleaning up log: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISeekableStream.seek]
    Thank you for your help.

    The version of TopLink on your application server class path may be an older version of TopLink that does not contain the method mentioned in the stack trace.
    If you are using OC4J the toplink.jar can be found in the following location:
    &lt;OC4J_HOME&gt;\toplink\jlib\toplink.jar
    The 10.1.3 DP3 version of OC4J can be found on OTN in the following location:
    http://www.oracle.com/technology/software/products/ias/preview.html

  • How to upgrade mapping files of  TOPLink 2.5.1 to the latest?

    We are planning to update our TOPLink 2.5.1 to the latest,but we don't know whether Oracle has some tools or new features in TOPLink 9.0.3 that directly migrate the mapping files of TOPLink 2.5.1 to the TOPLink 9.0.3?
    Thanks very much!

    Hi, Mr Smith
    I have same problem as Mr. Tai .
    I want to contact you with email, but the mail box [email protected] or [email protected] are invalid with my outlook report.
    So below is my email contents, and my mail address is [email protected] .
    Mr Smith:
    I met some confusions in upgrading our system from TOPLINK2.5.1 to TOPLINK Release 2(Oracle9.0.3).
    And because I didn't use TOPLINK tools before this project, I spent one week to know the structure of our system. Unfortunately, Our company isn't a supported Oracle customer. We just bought Oracle product, didn't buy support service.
    First of all, I'll describ our system structure. The system is Weblogic5.1 + Toplink 2.5.1 + Oracle8.1 .Using Toplink we mapping our EJB to Oracle. The results of this procedure aremany .table, .descriptor, .topclass under the mapping forlder, and weblogic-ejb-jar.xml, topling-cmp-XX.xml, ejb-jar.xml under the deploy forlder. That's all.
    So, after our ant-build, we copy these results to Weblogic server directory, and compile with EJB, deploy them. It's correct?
    OK, as my considering, I install TOPLINK Release 2 , use Renamer tool to rename my source code from old TOPLINK library to oracle.toplink, complie them again. And create new project in TOPLINK 9.0.3 , import classes, login Database correctly. Do mapping as in TOPLINK2.5.1. Generate packagename.ClassDescriptor.xml under Descriptor, forlder ClassRepository, Class, Table, Database generate xml files also.
    Do the above process correct? OK, let's assume it' correct. But how can I modify my ant-build , you know the structure is difference between Weblogic 5.1 and Weblogic 6 or 7. Additionally, I don't know where should I copy new TOPLINK library to Weblogic directory. Yes, I know old TOPLINK library location, but I think it has difference.
    So , please tell me I can use Weblogic5.1 + TOPLINK 9.0.3 + Oracle 8.1 , is it right? I will be appreciated if you can give me some detail steps in upgrading TOPLINK.
    And perhaps we need to upgrade out system from TOPLINK 2.5.1 to TOPLINK 4.x first?
    Thanks for your view.
    Yours
    Denver Yang
    Software Engineer
    E-MA Logistics Systems (Shanghai) Limited
    Tel: 86-21-6361-1177 Ext.140

  • TopLink Question - Mutliple Object to Single Table mapping

    Just a short question,
    Does toplink support mapping feature as such that it can map two distinct objects with single table that when in insertion or selection those two objects can be manipulated, selected in single operation? I know that TopLink mapping supports single object from multiple table mapping, but I'm not sure about multiple objects being associated with single table.
    Secondly, does Hibernate has something like what I described above?
    Howard.

    Hi Howard,
    You can map two objects to a single table if the objects are related by aggregation.
    In TopLink, two objects–a source (parent or owning) object and a target (child or owned) object–are related by aggregation if there is a strict one-to-one relationship between them, and all the attributes of the target object can be retrieved from the same data source representation as the source object. This means that if the source object exists, then the target object must also exist, and if the source object is destroyed, then the target object is also destroyed.
    http://www.oracle.com/technology/products/ias/toplink/doc/1013/main/_html/tutbuild004.htm#sthref2325
    -Blaise

  • OracleAS TopLink 10g (10.0.3) Developer Preview 2 - NOW AVAILABLE

    Earlier this week we upgraded the 10.0.3 Developer Preview. The full set of functionality is documented in the release notes available on the preview landing page(http://otn.oracle.com/products/ias/toplink/preview/index.html).
    The functionality added in this refresh of the preview includes:
    - OC4J CMP Support
    - CTS 1.4 compliance
    -Support for hot/re-deployment of TopLink enabled CMP applications
    - Bean Pessimistic Locking - Have any of your beans locked on the database as you access them in a TX
    - Read-only entity beans are now supported
    - Enhanced integration with OracleAS for DMS capturing of performance statistics
    - Object-XML mapping enhanced:
    - Document Preservation - keep your un-mapped XML from being lost in the translation
    - JAXB Compiler - Generate an object model from schema with TopLink MW project
    - EIS/JCA mapping enhanced. Access your non-relational data source through OracleAQ or MQ Series
    - Object-Relational Enhancements
    - Value return from write - Use triggers to assign and return your PK or other calculated values on INSERT or UPDATE
    - Isolated Session Cache - Use TopLink to map your VPD/OLS managed tables
    - Conversion support for oracle.sql.TIMESTAMP & TIMSTAMPTZ
    - Generic history support - With versioning columns you can perform queries for past points in time using the HistoricalSession
    - Stored Function Support - Invoke your favourite stored function in the Oracle DB
    - Configurable query timeout support
    - Enhanced and re-organized examples. See examples link from preview landing page
    Additionally we have also added several new how-to docs that can also be accessed from the preview link above.
    If you encounter any issues with the preview please post them to this forum.
    Cheers,
    Doug Clarke
    Principal Product Manager
    OracleAS TopLink

    Sorry about the link above. Try:
    http://otn.oracle.com/products/ias/toplink/preview/index.html
    Doug

  • Bad performance when using  complex database view with Toplink

    Hi
    Problem description
    1. I have a complex query that collects the data from many DB tables. For this reason I create a database view based on this select. Using EJB 3.0 with Toplink I
    mapped this view to a java object the same way I map database tables. The method I use to get the results is:
    snippet code...
    public List<VwKartela> VwKartela(Integer pperid) {
    List<VwKartela> results = null;
    Session session = getSessionFactory().acquireSession();
    ExpressionBuilder bankfile = new ExpressionBuilder();
    Expression exp1 = bankfile.get("perid").equal(pperid);
    ReadAllQuery query = new ReadAllQuery();
    query.setReferenceClass(VwKartela.class);
    query.setSelectionCriteria(exp1);
    results =(List<VwKartela>)session.executeQuery(query);
    When running the select on the view prom SQL Plus I haven’t any performance problem.
    2.Question: How can I improve the performance? I referenced to Toplink docs but I didn't improve the it.
    Have anyone any experience is such cases?
    Thank you
    Thanos

    Hi
    After my last tests I conclude at the followings:
    The query returns 1-30 records
    Test 1: Using Form Builder
    -     Execution time 7-8 seconds
    Test 2: Using Jdeveloper/Toplink/EJB 3.0/ADF and Oracle AS 10.1.3.0
    -     Execution time 25-27 seconds
    Test 3: Using JDBC/ADF and Oracle AS 10.1.3.0
    - Execution time 17-18 seconds
    When I use:
    session.setLogLevel(SessionLog.FINE) and
    session.setProfiler(new PerformanceProfiler())
    I don’t see any improvement in the execution time of the query.
    Thank you
    Thanos

  • Native mapping with JPA doesn't work by default - not marked cascade persi

    I started to use our old TopLink native mapping but via JPA instead of EclpseLink native API.
    But at first execution it's already complaining of my mappings. When using the native mappings shouldn't EclipseLink interpret it to keep old behavior?
    What are the other expected changes of behavior so that I can fix them proactively?
    What is the workaround for this specific problem?
    The error is:
    java.lang.IllegalStateException: During synchronization a new object was found through a relationship that was not marked cascade PERSIST: Id: 0
    DateTime: Mon Jun 08 02:00:00 EDT 2009
    Entry Type: 10009
    Entry Type In/Out: 10014
    calendarDate: Mon Jun 08 00:00:00 EDT 2009
    businessDate: Mon Jun 08 00:00:00 EDT 2009
    origin: timecard
    Inserted: true
    Changed: false
    Deleted: false
    Mon Jun 08 02:00:00 EDT 2009.
         at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.discoverAndPersistUnregisteredNewObjects(UnitOfWorkImpl.java:4016)
         at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.discoverUnregisteredNewObjects(RepeatableWriteUnitOfWork.java:182)
    persistence.xml is:
    <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0">
         <persistence-unit name="AllInOne" transaction-type="JTA" >
         <description>This represent all CITYADM schema mappings. It does include pmsi.</description>
              <exclude-unlisted-classes>false</exclude-unlisted-classes>
              <properties>
                   <property name="eclipselink.session-name" value="AllInOne"/>
                   <property name="eclipselink.sessions-xml" value="sessions.xml"/>
              </properties>
         </persistence-unit>
         <persistence-unit name="DataServices" transaction-type="JTA">
         <description>This represent all REPORTADM schema mappings</description>
              <exclude-unlisted-classes>false</exclude-unlisted-classes>
              <properties>
                   <property name="eclipselink.session-name" value="DataServices"/>
                   <property name="eclipselink.sessions-xml" value="sessionsDataServices.xml"/>
              </properties>
         </persistence-unit>
    </persistence>

    Hello Sebastien,
    You are using em.persist instead of uow.regsiterObject, which has different behaviour as mandated by the JPA specification. EclipseLink/TopLink automatically registered referenced objects through registerObject, but the JPA specification states that persist will only cascade if the mapping is marked cascade persist - otherwise it is required to throw the exception you see.
    If you wish to use the JPA with a project defined through native api, you will need to modify your mappings to match how you want to use the API. In this case, to get the same effect as you would from registerObject, you will need to mark your mappings as cascade persist. Depending on how you merge your entities (shallow, deep etc) you might also need to evaluate how you plan to use the JPA merge method and mark mappings as cascade merge appropriately.
    See setCascadeMerge on ForeignReferenceMapping.
    Best Regards,
    Chris

  • Toplink xml binding session.xml and servlet

    I made a project with toplink-jaxb mapping
    with simple pojo object it works fine.
    I made another project with servlet
    and the same session.xml and java classes
    but when my process start it throw an exception :
    jaxbexception : Provider oracle.toplink.ox.jaxb.JAXBContextFactory could not be instantiated:
    It is like the process could not read the session.xml files, but this file and two xml file for the mapping are in the classpath (in WEB-INF/classes).
    Have i to put these files in another place ?
    Thanks.

    Hi,
    thank you for your response but
    here is the code :
    javax.xml.bind.JAXBContext jaxbContext = javax.xml.bind.JAXBContext.newInstance(
    "fr.cnav.cramse.pgpe.contactsnationaux"),this.getClass().getClassLoader());
    but i still got the same exception :
    05/03/01 08:24:33 exceptionProvider oracle.toplink.ox.jaxb.JAXBContextFactory could not be instantiated: java.lang.NoSuchMethodError: oracle.toplink.publicinterface.Session oracle.toplink.tools.sessionmanagement.SessionManager.getSession(oracle.toplink.tools.sessionconfiguration.XMLSessionConfigLoader, java.lang.String, java.lang.ClassLoader, boolean, boolean)
    I have also a stange message in the log window in jdev :
    Cutting log (size: 101767, max: 100000)Component returned failure code: 0x80470002 (NS_BASE_STREAM_CLOSED) [nsIFileOutputStream.write]Component returned failure code: 0x80470002 (NS_BASE_STREAM_CLOSED) [nsIFileOutputStream.write]Component returned failure code: 0x80470002 (NS_BASE_STREAM_CLOSED) [nsIFileOutputStream.write]Cutting log (size: 101866, max: 100000)Error cleaning up log: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISeekableStream.seek]
    Thank you for your help.

Maybe you are looking for

  • MRP issue.  Extra stock suggested

    Hi there ,              I have one material say ABC which is to be procured from outside. Now I have maintained the schedule line aggreement & source list for the same . The safety stock is maintained as zero &  the lot sizing is weekly lot size.. I

  • Need Authority Check so that Do not display Customer in Production Order

    Hi, I our business we use MTO in PP.Thats why Customer code with Customer Name is shown in Production Order General Tab.Now I want to restrict this view in production order so that no user can able to see the Customer Code and Name in production Orde

  • Export presentation to iPad

    Ok, I give up. I have Keynote on both my MBP and my iPad Mini. MBP is on OSX 10.9.1. Keynote on MBP is 4.0.4. I am completely at sea in how to export onto my iPad. I thought I could bring into iTunes. Apparently not. I'm being told my iTunes needs to

  • Where can I download Acrobat X?

    I have a license for Acrobat version 10. How do I download that particuliar version?

  • Database Adapter - Datasource creation Issue - Using WLST

    Hi , Im tring to create a weblogic multi data source in an osb cluistered env using the wlst script and getting an issue while updating the plan.xml via script. im getting the plan path via this command in WLST planPath = get('/AppDeployments/DbAdapt