Cocobase --- Toplink conversion.

I'm investigating if it's possible to convert a databse access layer application implemented with Cocobase to an implementation with Toplink.
The project is using EJB architecture, there are Bean Managed Persistent EJB's (persistency is handled by cocobase) and session bean(s) controling user requests.
Since code generation is done using templates in Cocobase, it looked powerful to me in this way. Is this supported by Toplink?.
or has anybody done such a conversion before???
regards.
Erdem.

Why are you thinking of switching from cocobase? The technical services team has a lot of experience migrating from homegrown and various O/R mappers to the TopLink persistence framework. You can send me an email if you'd like me to hook you up with them. BTW, there is typically no costs for this kind of help. TopLink supports BMP and does not require the use of templates -- you use your favorite modeling tool or IDE to build your BMP in a completely independent manner.
I'm investigating if it's possible to convert a databse access layer application implemented with Cocobase to an implementation with Toplink.
The project is using EJB architecture, there are Bean Managed Persistent EJB's (persistency is handled by cocobase) and session bean(s) controling user requests.
Since code generation is done using templates in Cocobase, it looked powerful to me in this way. Is this supported by Toplink?.
or has anybody done such a conversion before???
regards.
Erdem.

Similar Messages

  • Struts/ADF/Toplink conversion from 10.1.2 to 10.1.3

    Hi. We have a J2EE application based on Struts/ADF/Toplink.
    We just let the JDeveloper migrate the whole application itself.
    We solved a few minor problems, but now we have the greater one:
    - we have in domain classes some getX...(), setX...() methods, intended for example
    for getting attributes of nested objects or for conversion from String to Date.
    In older version, when you had some getXSomeAtr() method in domain class, the attribute
    XSomeAttr was automatically generated into Data Control.
    In newer version it's not! If you want the attribute to be in data control, you must
    have an private attribute XSomeAtr declared in domain class.
    Example - we have these attibutes (first two has their own getters and setters and are
    mapped in toplink, the third is unmapped)
         private Date datum;
    private String nazev;
    private String XDatumAsDate;
    and methods
    public String getXDatumAsDate() {
    return OurUtils.dateToStringAsDate(getDatum());
    public void setXDatumAsDate(String datum) throws ParseException{
    Date d = OurUtils.StringToDateAsDate(datum);
    setDatum(d);
    And the form look like this
    <html:text property="XDatumAsDate" .../>
    <html:text property="nazev"     .../>
    Reading is ok, but attempt to modify date in input field ends with
    "JBO-35009: Setting attribute for XDatumAsDate in object methodRSICollection failed"
    Are we doing something wrong ? We just need to have the date entering under our control and
    be able to enter dates in various formats.
    Thanks in advance for any comments.

    I compared the both old and new data control xml files and found the difference. The previous attribute descriptor has IsUpdateable="true" but the new has IsUpdateable="0".
    Manually changing won't help - data control generation of any class regenerates all data controls and puts back IsUpdateable="0". I'm stuck now.

  • Query - Hibernate to JPA/TopLink Conversion

    Hi,
    I have some problems with a query. My query works fine in Hibernate but I have to work with TopLink.
    I have created the query below.
    int Language = 1;
    String hql = "SELECT DISTINCT g "
    +    "FROM GUI g "
    +    "JOIN FETCH g.gUINameAllocation gna "
    +    "JOIN FETCH g.elementAllocation gea "
    +    "JOIN FETCH gea.elementTextAllocation geta "
    +    "WHERE g.gUIID = " + java.lang.Integer.toString(GUI) + " "
    +    "AND gna.languageAllocation.languageID = " + java.lang.Integer.toString(Language)
    +    "AND geta.languageAllocation.languageID = " + java.lang.Integer.toString(Language);
    Query query = session.createQuery(hql);
    java.util.List<GUI> results = (java.util.List<GUI>)query.list();
    I have tried to translate the query to JPQL but it does not allow alias names for fetch joins. I have tried to translate it to the Criteria API classes but I will not work. I have tried the Criteria API with the join class and the fetch class.
    I can not use the fetch class in crit.where(...) expression. I can only use there the join classes as far as I understood.
    int Language = 1;
    CriteriaBuilder cb = em.getCriteriaBuilder();
    CriteriaQuery<GUI> crit = cb.createQuery(GUI.class);
    crit.distinct(true);
    Root<GUI> c = crit.from(GUI.class);
    Join<GUI, GUIName> guiname = c.join("gUINameAllocation", JoinType.LEFT);
    Join<GUIName, Language> language = guiname.join("languageAllocation");
    Join<GUI, Element> guielement = c.join("elementAllocation", JoinType.LEFT);
    Join<Element, ElementText> guielementtext = guielement.join("elementTextAllocation", JoinType.LEFT);
    Join<ElementText, Language> language1 = guielementtext.join("languageAllocation");
    crit.where(cb.equal(language.get("languageID"), Language));
    crit.where(cb.equal(language1.get("languageID"), Language));
    Has somebody an idea for a solution?
    Thx in advance

    JPA does not allow alias names on fetch joins, I suspect partially because they could then be used in the filtering in the query - which is exactly what you are doing. This could cause potential caching issues, as the entity that is built might end up missing references that don't conform to the conditions in the where clause, as discussed here:
    http://www.coderanch.com/t/486454/ORM/databases/Join-Fetch-EclipseLink
    According to bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=293775 this has been changed and is supported in EclipseLink 2.4 to some degree.
    If you cannot use EclipseLink 2.4 or later, the way to do this in JPQL is to use a separate join for the alias to be used in the query, and one for the fetch join.
    "SELECT DISTINCT g FROM GUI g "
    + "JOIN FETCH g.gUINameAllocation "
    + "JOIN FETCH g.elementAllocation "
    + "JOIN g.gUINameAllocation gna "
    + "JOIN g.elementAllocation gea "
    + "JOIN gea.elementTextAllocation geta "
    + "WHERE g.gUIID = " + java.lang.Integer.toString(GUI) + " "
    + "AND gna.languageAllocation.languageID = " + java.lang.Integer.toString(Language)
    + "AND geta.languageAllocation.languageID = " + java.lang.Integer.toString(Language);
    Unfortunately JPA does not allow nested fetch joins, so the only way to fecth gea.elementTextAllocation is through a query hint:
    query.setHint("eclipselink.join-fetch", "g.elementAllocation.elementTextAllocation");
    EclipseLink/TopLink's join-fetch query hint is described here:
    http://wiki.eclipse.org/EclipseLink/UserGuide/JPA/Basic_JPA_Development/Query_Hints#Join_Fetch
    Best Regards,
    Chris

  • Best way to map CLOB database fields?

    I ran into a problem mapping CLOB fields a couple of months ago and couldn't find an easy answer to the problem. I got sidetracked and now find myself back at the same point...
    What is the best practice for mapping CLOB database fields in the mapping workbench? Do you map them as serialized (as a note I've got here) or can someone point me in the proper direction please? I've got everything else functioning properly, but I left my CLOB fields out of my mapping because they were giving me such trouble. Now, I need to get back to that specific area.
    ~ Tiffani

    Hi Tiffani,
    SerializedObjectMapping is generally used to map a multimedia object (for example image)to a BLOB field. For CLOB, I use simple direct-to-field mapping, and TopLink conversion manager will handle the read/write from the object String/Char[] to CLOB.
    King

  • Conversion from Toplink 9.0.4,5 to 10.1.3.1.0

    Hi
    I'm trying to do the mentioned convertion but during the processing of the mwp file the following error occurs.
    Is there any known bug that causes such behavior?
    oracle.toplink.workbench.framework.OpenException: Wyjątek [TOPLINK-101] (Oracle TopLink - 10g Release 3 (10.1.3.1.0) (Build 061004)): oracle.toplink.exceptions.DescriptorException
    Opis wyjątku: Użyta metoda wyzwoliła wyjątek.
    Wyjątek wewnętrzny: java.lang.reflect.InvocationTargetException
    Wyjątek wywołania celu: java.lang.ClassCastException: java.lang.String
    Odwzorowanie: oracle.toplink.mappings.TransformationMapping[legacySecondaryReferenceHandles]
    Deskryptor: XMLDescriptor(oracle.toplink.workbench.mappingsmodel.descriptor.relational.MWDescriptorMultiTableInfoPolicy --> [DatabaseTable(multi-table-info-policy)])
         at oracle.toplink.workbench.mappingsplugin.MappingsPlugin.open(MappingsPlugin.java:290)
         at oracle.toplink.workbench.framework.internal.FrameworkApplication.open(FrameworkApplication.java:689)
         at oracle.toplink.workbench.framework.internal.FrameworkNodeManager.openCallback(FrameworkNodeManager.java:341)
         at oracle.toplink.workbench.framework.internal.RunnableProjectLoader.run2(RunnableProjectLoader.java:76)
         at oracle.toplink.workbench.framework.internal.RunnableProjectLoader.run(RunnableProjectLoader.java:63)
         at java.lang.Thread.run(Thread.java:595)
    Caused by: Wyjątek [TOPLINK-101] (Oracle TopLink - 10g Release 3 (10.1.3.1.0) (Build 061004)): oracle.toplink.exceptions.DescriptorException
    Opis wyjątku: Użyta metoda wyzwoliła wyjątek.
    Wyjątek wewnętrzny: java.lang.reflect.InvocationTargetException
    Wyjątek wywołania celu: java.lang.ClassCastException: java.lang.String
    Odwzorowanie: oracle.toplink.mappings.TransformationMapping[legacySecondaryReferenceHandles]
    Deskryptor: XMLDescriptor(oracle.toplink.workbench.mappingsmodel.descriptor.relational.MWDescriptorMultiTableInfoPolicy --> [DatabaseTable(multi-table-info-policy)])
         at oracle.toplink.exceptions.DescriptorException.targetInvocationWhileInvokingAttributeMethod(DescriptorException.java:1634)
         at oracle.toplink.mappings.transformers.MethodBasedAttributeTransformer.buildAttributeValue(MethodBasedAttributeTransformer.java:114)
         at oracle.toplink.mappings.foundation.AbstractTransformationMapping.invokeAttributeTransformer(AbstractTransformationMapping.java:678)
         at oracle.toplink.internal.indirection.NoIndirectionPolicy.valueFromMethod(NoIndirectionPolicy.java:252)
         at oracle.toplink.mappings.foundation.AbstractTransformationMapping.readFromRowIntoObject(AbstractTransformationMapping.java:900)
         at oracle.toplink.internal.descriptors.ObjectBuilder.buildAttributesIntoObject(ObjectBuilder.java:244)
         at oracle.toplink.sdk.SDKAggregateObjectMapping.buildCompositeObject(SDKAggregateObjectMapping.java:56)
         at oracle.toplink.mappings.foundation.AbstractCompositeObjectMapping.valueFromRow(AbstractCompositeObjectMapping.java:155)
         at oracle.toplink.mappings.DatabaseMapping.readFromRowIntoObject(DatabaseMapping.java:1021)
         at oracle.toplink.internal.descriptors.ObjectBuilder.buildAttributesIntoObject(ObjectBuilder.java:244)
         at oracle.toplink.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:525)
         at oracle.toplink.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:381)
         at oracle.toplink.queryframework.ObjectLevelReadQuery.buildObject(ObjectLevelReadQuery.java:455)
         at oracle.toplink.queryframework.ReadObjectQuery.executeObjectLevelReadQuery(ReadObjectQuery.java:424)
         at oracle.toplink.queryframework.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:811)
         at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:620)
         at oracle.toplink.queryframework.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:779)
         at oracle.toplink.queryframework.ReadObjectQuery.execute(ReadObjectQuery.java:388)
         at oracle.toplink.publicinterface.Session.internalExecuteQuery(Session.java:2073)
         at oracle.toplink.publicinterface.Session.executeQuery(Session.java:988)
         at oracle.toplink.internal.indirection.NoIndirectionPolicy.valueFromQuery(NoIndirectionPolicy.java:262)
         at oracle.toplink.mappings.ForeignReferenceMapping.valueFromRow(ForeignReferenceMapping.java:1139)
         at oracle.toplink.mappings.OneToOneMapping.valueFromRow(OneToOneMapping.java:1030)
         at oracle.toplink.mappings.DatabaseMapping.readFromRowIntoObject(DatabaseMapping.java:1021)
         at oracle.toplink.internal.descriptors.ObjectBuilder.buildAttributesIntoObject(ObjectBuilder.java:244)
         at oracle.toplink.sdk.SDKAggregateCollectionMapping.buildCompositeObject(SDKAggregateCollectionMapping.java:62)
         at oracle.toplink.mappings.foundation.AbstractCompositeCollectionMapping.valueFromRow(AbstractCompositeCollectionMapping.java:735)
         at oracle.toplink.mappings.DatabaseMapping.readFromRowIntoObject(DatabaseMapping.java:1021)
         at oracle.toplink.internal.descriptors.ObjectBuilder.buildAttributesIntoObject(ObjectBuilder.java:244)
         at oracle.toplink.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:525)
         at oracle.toplink.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:381)
         at oracle.toplink.internal.descriptors.ObjectBuilder.buildObjectsInto(ObjectBuilder.java:677)
         at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.buildObjectsFromRows(DatabaseQueryMechanism.java:142)
         at oracle.toplink.queryframework.ReadAllQuery.executeObjectLevelReadQuery(ReadAllQuery.java:483)
         at oracle.toplink.queryframework.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:811)
         at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:620)
         at oracle.toplink.queryframework.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:779)
         at oracle.toplink.queryframework.ReadAllQuery.execute(ReadAllQuery.java:451)
         at oracle.toplink.publicinterface.Session.internalExecuteQuery(Session.java:2073)
         at oracle.toplink.publicinterface.Session.executeQuery(Session.java:988)
         at oracle.toplink.internal.indirection.NoIndirectionPolicy.valueFromQuery(NoIndirectionPolicy.java:262)
         at oracle.toplink.mappings.ForeignReferenceMapping.valueFromRow(ForeignReferenceMapping.java:1139)
         at oracle.toplink.mappings.DatabaseMapping.readFromRowIntoObject(DatabaseMapping.java:1021)
         at oracle.toplink.internal.descriptors.ObjectBuilder.buildAttributesIntoObject(ObjectBuilder.java:244)
         at oracle.toplink.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:525)
         at oracle.toplink.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:381)
         at oracle.toplink.queryframework.ObjectLevelReadQuery.buildObject(ObjectLevelReadQuery.java:455)
         at oracle.toplink.queryframework.ReadObjectQuery.executeObjectLevelReadQuery(ReadObjectQuery.java:424)
         at oracle.toplink.queryframework.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:811)
         at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:620)
         at oracle.toplink.queryframework.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:779)
         at oracle.toplink.queryframework.ReadObjectQuery.execute(ReadObjectQuery.java:388)
         at oracle.toplink.publicinterface.Session.internalExecuteQuery(Session.java:2073)
         at oracle.toplink.publicinterface.Session.executeQuery(Session.java:988)
         at oracle.toplink.publicinterface.Session.executeQuery(Session.java:945)
         at oracle.toplink.publicinterface.Session.readObject(Session.java:2575)
         at oracle.toplink.workbench.mappingsio.legacy.PersistenceTools50.readMWProjectNamed(PersistenceTools50.java:322)
         at oracle.toplink.workbench.mappingsio.legacy.LegacyIOFacade.read50Project(LegacyIOFacade.java:14)
         at oracle.toplink.workbench.mappingsio.ProjectReader.readLegacyProject(ProjectReader.java:243)
         at oracle.toplink.workbench.mappingsio.ProjectReader.read(ProjectReader.java:102)
         at oracle.toplink.workbench.mappingsio.ProjectIOManager.read(ProjectIOManager.java:59)
         at oracle.toplink.workbench.mappingsplugin.MappingsPlugin.open(MappingsPlugin.java:286)
         ... 5 more
    Caused by: java.lang.reflect.InvocationTargetException
         at sun.reflect.GeneratedMethodAccessor231.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at oracle.toplink.internal.security.PrivilegedAccessController.invokeMethod(PrivilegedAccessController.java:501)
         at oracle.toplink.mappings.transformers.MethodBasedAttributeTransformer.buildAttributeValue(MethodBasedAttributeTransformer.java:108)
         ... 65 more
    Caused by: java.lang.ClassCastException: java.lang.String
         at oracle.toplink.workbench.mappingsmodel.descriptor.relational.MWDescriptorMultiTableInfoPolicy.legacy50GetSecondaryReferenceHandlesFromRecordForTopLink(MWDescriptorMultiTableInfoPolicy.java:264)
         ... 70 more

    It doesn't seem like the xml file is corrupted because toplink 9045 processes it successfully.
    Below is the same stack trace but with english descriptions, maybe this will be more helpful.
    oracle.toplink.workbench.framework.OpenException: Exception [TOPLINK-101] (Oracle TopLink - 10g Release 3 (10.1.3.1.0) (Build 061004)): oracle.toplink.exceptions.DescriptorException
    Exception Description: The underlying method triggered an exception.
    Internal Exception: java.lang.reflect.InvocationTargetException
    Target Invocation Exception: java.lang.ClassCastException: java.lang.String
    Mapping: oracle.toplink.mappings.TransformationMapping[legacySecondaryReferenceHandles]
    Descriptor: XMLDescriptor(oracle.toplink.workbench.mappingsmodel.descriptor.relational.MWDescriptorMultiTableInfoPolicy --> [DatabaseTable(multi-table-info-policy)])
         at oracle.toplink.workbench.mappingsplugin.MappingsPlugin.open(MappingsPlugin.java:290)
         at oracle.toplink.workbench.framework.internal.FrameworkApplication.open(FrameworkApplication.java:689)
         at oracle.toplink.workbench.framework.internal.FrameworkNodeManager.openCallback(FrameworkNodeManager.java:341)
         at oracle.toplink.workbench.framework.internal.RunnableProjectLoader.run2(RunnableProjectLoader.java:76)
         at oracle.toplink.workbench.framework.internal.RunnableProjectLoader.run(RunnableProjectLoader.java:63)
         at java.lang.Thread.run(Thread.java:595)
    Caused by: Exception [TOPLINK-101] (Oracle TopLink - 10g Release 3 (10.1.3.1.0) (Build 061004)): oracle.toplink.exceptions.DescriptorException
    Exception Description: The underlying method triggered an exception.
    Internal Exception: java.lang.reflect.InvocationTargetException
    Target Invocation Exception: java.lang.ClassCastException: java.lang.String
    Mapping: oracle.toplink.mappings.TransformationMapping[legacySecondaryReferenceHandles]
    Descriptor: XMLDescriptor(oracle.toplink.workbench.mappingsmodel.descriptor.relational.MWDescriptorMultiTableInfoPolicy --> [DatabaseTable(multi-table-info-policy)])
         at oracle.toplink.exceptions.DescriptorException.targetInvocationWhileInvokingAttributeMethod(DescriptorException.java:1634)
         at oracle.toplink.mappings.transformers.MethodBasedAttributeTransformer.buildAttributeValue(MethodBasedAttributeTransformer.java:114)
         at oracle.toplink.mappings.foundation.AbstractTransformationMapping.invokeAttributeTransformer(AbstractTransformationMapping.java:678)
         at oracle.toplink.internal.indirection.NoIndirectionPolicy.valueFromMethod(NoIndirectionPolicy.java:252)
         at oracle.toplink.mappings.foundation.AbstractTransformationMapping.readFromRowIntoObject(AbstractTransformationMapping.java:900)
         at oracle.toplink.internal.descriptors.ObjectBuilder.buildAttributesIntoObject(ObjectBuilder.java:244)
         at oracle.toplink.sdk.SDKAggregateObjectMapping.buildCompositeObject(SDKAggregateObjectMapping.java:56)
         at oracle.toplink.mappings.foundation.AbstractCompositeObjectMapping.valueFromRow(AbstractCompositeObjectMapping.java:155)
         at oracle.toplink.mappings.DatabaseMapping.readFromRowIntoObject(DatabaseMapping.java:1021)
         at oracle.toplink.internal.descriptors.ObjectBuilder.buildAttributesIntoObject(ObjectBuilder.java:244)
         at oracle.toplink.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:525)
         at oracle.toplink.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:381)
         at oracle.toplink.queryframework.ObjectLevelReadQuery.buildObject(ObjectLevelReadQuery.java:455)
         at oracle.toplink.queryframework.ReadObjectQuery.executeObjectLevelReadQuery(ReadObjectQuery.java:424)
         at oracle.toplink.queryframework.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:811)
         at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:620)
         at oracle.toplink.queryframework.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:779)
         at oracle.toplink.queryframework.ReadObjectQuery.execute(ReadObjectQuery.java:388)
         at oracle.toplink.publicinterface.Session.internalExecuteQuery(Session.java:2073)
         at oracle.toplink.publicinterface.Session.executeQuery(Session.java:988)
         at oracle.toplink.internal.indirection.NoIndirectionPolicy.valueFromQuery(NoIndirectionPolicy.java:262)
         at oracle.toplink.mappings.ForeignReferenceMapping.valueFromRow(ForeignReferenceMapping.java:1139)
         at oracle.toplink.mappings.OneToOneMapping.valueFromRow(OneToOneMapping.java:1030)
         at oracle.toplink.mappings.DatabaseMapping.readFromRowIntoObject(DatabaseMapping.java:1021)
         at oracle.toplink.internal.descriptors.ObjectBuilder.buildAttributesIntoObject(ObjectBuilder.java:244)
         at oracle.toplink.sdk.SDKAggregateCollectionMapping.buildCompositeObject(SDKAggregateCollectionMapping.java:62)
         at oracle.toplink.mappings.foundation.AbstractCompositeCollectionMapping.valueFromRow(AbstractCompositeCollectionMapping.java:735)
         at oracle.toplink.mappings.DatabaseMapping.readFromRowIntoObject(DatabaseMapping.java:1021)
         at oracle.toplink.internal.descriptors.ObjectBuilder.buildAttributesIntoObject(ObjectBuilder.java:244)
         at oracle.toplink.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:525)
         at oracle.toplink.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:381)
         at oracle.toplink.internal.descriptors.ObjectBuilder.buildObjectsInto(ObjectBuilder.java:677)
         at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.buildObjectsFromRows(DatabaseQueryMechanism.java:142)
         at oracle.toplink.queryframework.ReadAllQuery.executeObjectLevelReadQuery(ReadAllQuery.java:483)
         at oracle.toplink.queryframework.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:811)
         at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:620)
         at oracle.toplink.queryframework.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:779)
         at oracle.toplink.queryframework.ReadAllQuery.execute(ReadAllQuery.java:451)
         at oracle.toplink.publicinterface.Session.internalExecuteQuery(Session.java:2073)
         at oracle.toplink.publicinterface.Session.executeQuery(Session.java:988)
         at oracle.toplink.internal.indirection.NoIndirectionPolicy.valueFromQuery(NoIndirectionPolicy.java:262)
         at oracle.toplink.mappings.ForeignReferenceMapping.valueFromRow(ForeignReferenceMapping.java:1139)
         at oracle.toplink.mappings.DatabaseMapping.readFromRowIntoObject(DatabaseMapping.java:1021)
         at oracle.toplink.internal.descriptors.ObjectBuilder.buildAttributesIntoObject(ObjectBuilder.java:244)
         at oracle.toplink.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:525)
         at oracle.toplink.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:381)
         at oracle.toplink.queryframework.ObjectLevelReadQuery.buildObject(ObjectLevelReadQuery.java:455)
         at oracle.toplink.queryframework.ReadObjectQuery.executeObjectLevelReadQuery(ReadObjectQuery.java:424)
         at oracle.toplink.queryframework.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:811)
         at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:620)
         at oracle.toplink.queryframework.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:779)
         at oracle.toplink.queryframework.ReadObjectQuery.execute(ReadObjectQuery.java:388)
         at oracle.toplink.publicinterface.Session.internalExecuteQuery(Session.java:2073)
         at oracle.toplink.publicinterface.Session.executeQuery(Session.java:988)
         at oracle.toplink.publicinterface.Session.executeQuery(Session.java:945)
         at oracle.toplink.publicinterface.Session.readObject(Session.java:2575)
         at oracle.toplink.workbench.mappingsio.legacy.PersistenceTools50.readMWProjectNamed(PersistenceTools50.java:322)
         at oracle.toplink.workbench.mappingsio.legacy.LegacyIOFacade.read50Project(LegacyIOFacade.java:14)
         at oracle.toplink.workbench.mappingsio.ProjectReader.readLegacyProject(ProjectReader.java:243)
         at oracle.toplink.workbench.mappingsio.ProjectReader.read(ProjectReader.java:102)
         at oracle.toplink.workbench.mappingsio.ProjectIOManager.read(ProjectIOManager.java:59)
         at oracle.toplink.workbench.mappingsplugin.MappingsPlugin.open(MappingsPlugin.java:286)
         ... 5 more
    Caused by: java.lang.reflect.InvocationTargetException
         at sun.reflect.GeneratedMethodAccessor122.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at oracle.toplink.internal.security.PrivilegedAccessController.invokeMethod(PrivilegedAccessController.java:501)
         at oracle.toplink.mappings.transformers.MethodBasedAttributeTransformer.buildAttributeValue(MethodBasedAttributeTransformer.java:108)
         ... 65 more
    Caused by: java.lang.ClassCastException: java.lang.String
         at oracle.toplink.workbench.mappingsmodel.descriptor.relational.MWDescriptorMultiTableInfoPolicy.legacy50GetSecondaryReferenceHandlesFromRecordForTopLink(MWDescriptorMultiTableInfoPolicy.java:264)
         ... 70 more

  • Toplink, DateTime conversion   Urgency!!

    Any one can help me?
    I use the type converter in toplink to convert the datetime string to java.sql.Date to store it to the database.
    That means, in my java entity, this attribute type is String. but in my database table this attribute type is Date.
    for example:
    My datetime strting is: '2006-06-15 16:32:30'. i want the toplink would save this value to the database.
    no exception when toplink do this converter operation.
    but check from the database, this date value is : 2006-06-15', no time portion, seems the time portion was lost by toplink.
    How to resovle this problem? Please give me a hand. thanks.

    Are you using Oracle with an JDBC driver 10.x.x.x ?
    It's not about data types in Java it's about database data types and JDBC drivers.
    In the past the data type DATE was used for storing date AND time. But if you would like to store date and time you should always use TIMESTAMP in Oracle. Since the new driver 10.x.x.x the time part will be always ignored on an INSERT or UPDATE statement for datatypes DATE.
    The solution for you will be:
    - Use an JDBC driver 9.x.x.x (not recommanded)
    - Use TIMESTAMP instead DATE in the database (recommanded)
    Best regards
    Adrian

  • Session broker and custom conversion manager

    I'm having some problem using session broker and a custom conversion manager. I just moved from using single session to using a session broker in the sessions.xml. I'm using a custom conversion manager as shown in this tech. tips URL
    http://www.oracle.com/technology/products/ias/toplink/technical/tips/customconversion/index.html
    Here's my conversion manager set up code -
    public class JpmiConversionManagerSetup extends SessionEventAdapter
    * During the pre-login event the new MyConversionManager must be installed
    * @see oracle.toplink.sessions.SessionEventAdapter#preLogin
    * @param event
    public void preLogin(SessionEvent event) {
    ConversionManager cm= new JpmiConversionManager();
    ConversionManager.setDefaultManager(cm);
    event.getSession().getLogin().getPlatform().setConversionManager(cm);
    My session broker manages 2 sessions. In sessions.xml for one session I have the <event-listener-class> entry where I need some conversion, another session I don't have any such entry as I don't need any conversion.
    Now when I try to run a named query using session broker the conversion part blows up, throws a ConversionException. Any idea? Do I need to configure the session broker instead of session in the preLogin or anything like that?

    I think sessions editor is not available in 10.1.3dp4 yet. So I have to write the sessions.xml by hand. But the parser throwing me an error saying that <session-broker> is not allowed in sessions.xml.
    SessionLoaderExceptions:
    org.xml.sax.SAXParseException: <Line 41, Column 18>: XML-24534: (Error) Element 'session-broker' not expected.
         at oracle.xml.parser.v2.XMLError.flushErrorHandler(XMLError.java:415)
         at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:284)
         at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:302)
         at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:199)
         at oracle.xml.jaxp.JXDocumentBuilder.parse(JXDocumentBuilder.java:155)
         at oracle.xml.jaxp.JXDocumentBuilder.parse(JXDocumentBuilder.java:111)
         at oracle.toplink.platform.xml.xdk.XDKParser.parse(XDKParser.java:160)
         at oracle.toplink.platform.xml.xdk.XDKParser.parse(XDKParser.java:190)
         at oracle.toplink.tools.sessionconfiguration.XMLSessionConfigLoader.loadDocument(XMLSessionConfigLoader.java:191)
         at oracle.toplink.tools.sessionconfiguration.XMLSessionConfigLoader.loadDocument(XMLSessionConfigLoader.java:151)
         at oracle.toplink.tools.sessionconfiguration.XMLSessionConfigLoader.load(XMLSessionConfigLoader.java:88)
         at oracle.toplink.tools.sessionmanagement.SessionManager.getSession(SessionManager.java:364)
         at oracle.toplink.tools.sessionmanagement.SessionManager.getSession(SessionManager.java:331)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
    Any idea how to or where to write sessions broker in sessions.xml for 10.1.3dp4???

  • Is possible to pass array/list as parameter in TopLink StoredProcedureCall?

    Hi, We need to pass an array/List/Vector of values (each value is a 10 character string) into TopLink's StoredProcedureCall. The maximum number of elements on the list is 3,000 (3,000 * 10 = 30,000 characters).
    This exposed two questions:
    1. Is it possible to pass a Vector as a parameter in TopLink's StoredProcedureCall, such as
    StoredProcedureCall call = new StoredProcedureCall();
    call.setProcedureName("STORED_PROCEDURE_NAME");
    call.addNamedArgument("PERSON_CODE");
    Vector strVect = new Vector(3000);
    strVect.add(“ab-gthhjko”);
    strVect.add(“cd-gthhjko”);
    strVect.add(“ef-gthhjko”);
    Vector parameters = new Vector();
    parameters.addElement(strVect);
    session.executeQuery(query,parameters);
    2. If the answer on previous question is yes:
    - How this parameter has to be defined in Oracle’s Stored Procedure?
    - What is the maximum number of elements/bytes that can be passed into the vector?
    The best way that we have found so far was to use single string as a parameter. The individual values would be delimited by comma, such as "ab-gthhjko,cd-gthhjko,ef-gthhjko..."
    However, in this case concern is the size that can be 3,000 * 11 = 33, 000 characters. The maximum size of VARCHAR2 is 4000, so we would need to break calls in chunks (max 9 chunks).
    Is there any other/more optimal way to do this?
    Thanks for your help!
    Zoran

    Hello,
    No, you cannot currently pass a vector of objects as a parameter to a stored procedure. JDBC will not take a vector as an argument unless you want it to serialize it (ie a blob) .
    The Oracle database though does have support for struct types and varray types. So you could define a stored procedure to take a VARRAY of strings/varchar, and use that stored procedure through TopLink. For instance:
    StoredProcedureCall call = new StoredProcedureCall();
    call.setProcedureName("STORED_PROCEDURE_NAME");
    call.addNamedArgument("PERSON_CODE");
    oracle.sql.ArrayDescriptor descriptor = new oracle.sql.ArrayDescriptor("ARRAYTYPE_NAME", dbconnection);
    oracle.sql.ARRAY dbarray = new oracle.sql.ARRAY(descriptor, dbconnection, dataArray);
    Vector parameters = new Vector();
    parameters.addElement(dbarray);
    session.executeQuery(query,parameters);This will work for any values as long as you are not going to pass in null as a value as the driver can determine the type from the object.
    dataArray is an Object array consisting of your String objects.
    For output or inoutput parameters you need to set the type and typename as well:
      sqlcall.addUnamedInOutputArgument("PERSON_CODE", "PERSON_CODE", Types.ARRAY, "ARRAYTYPE_NAME"); which will take a VARRAY and return a VARRAY type object.
    The next major release of TopLink will support taking in a vector of strings and performing the conversion to a VARRAY for you, as well as returning a vector instead of a VARRAY for out arguments.
    Check out thread
    Using VARRAYs as parameters to a Stored Procedure
    showing an example on how to get the conection to create the varray, as well as
    http://www.oracle.com/technology/sample_code/tech/java/codesnippet/jdbc/varray/index.html on using Varrays in Oracle, though I'm sure the database docs might have more information.
    Best Regards,
    Chris

  • Problem migrating Toplink Workbench project from 9.0.4.5 to 10.1.3.1.0

    Hi all,
    I am having problems migrating my Toplink Workbench project from 9.0.4.5 to 10.1.3.1.0! I used the Toplink Workbench to open and convert the existing project. The conversion succeeded, but when I tried to export the mappings I got this:
    java.lang.NullPointerException
         at oracle.toplink.workbench.mappingsmodel.descriptor.relational.MWRelationalPrimaryKeyPolicy.adjustRuntimeDescriptor(MWRelationalPrimaryKeyPolicy.java:174)
         at oracle.toplink.workbench.mappingsmodel.descriptor.relational.MWRelationalTransactionalPolicy.adjustRuntimeDescriptor(MWRelationalTransactionalPolicy.java:85)
         at oracle.toplink.workbench.mappingsmodel.descriptor.MWDescriptor.buildRuntimeDescriptor(MWDescriptor.java:423)
         at oracle.toplink.workbench.mappingsmodel.descriptor.MWMappingDescriptor.buildRuntimeDescriptor(MWMappingDescriptor.java:860)
         at oracle.toplink.workbench.mappingsmodel.descriptor.relational.MWRelationalClassDescriptor.buildRuntimeDescriptor(MWRelationalClassDescriptor.java:791)
         at oracle.toplink.workbench.mappingsmodel.descriptor.relational.MWTableDescriptor.buildRuntimeDescriptor(MWTableDescriptor.java:955)
         at oracle.toplink.workbench.mappingsmodel.project.MWProject.buildRuntimeProject(MWProject.java:932)
         at oracle.toplink.workbench.mappingsmodel.project.MWProject.exportDeploymentXML(MWProject.java:804)
         at oracle.toplink.workbench.mappingsplugin.ProjectDeploymentXmlGenerationCoordinator.exportProjectDeploymentXml(ProjectDeploymentXmlGenerationCoordinator.java:46)
         at oracle.toplink.workbench.mappingsplugin.ExportDeploymentXmlAction.execute(ExportDeploymentXmlAction.java:27)
         at oracle.toplink.workbench.framework.action.AbstractFrameworkAction.actionPerformed(AbstractFrameworkAction.java:134)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
         at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
         at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:231)
         at java.awt.Component.processMouseEvent(Component.java:5100)
         at java.awt.Component.processEvent(Component.java:4897)
         at java.awt.Container.processEvent(Container.java:1569)
         at java.awt.Component.dispatchEventImpl(Component.java:3615)
         at java.awt.Container.dispatchEventImpl(Container.java:1627)
         at java.awt.Component.dispatchEvent(Component.java:3477)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
         at java.awt.Container.dispatchEventImpl(Container.java:1613)
         at java.awt.Window.dispatchEventImpl(Window.java:1606)
         at java.awt.Component.dispatchEvent(Component.java:3477)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:480)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
    Anyone seen this error before? This is very critical for us. Please help. Thanks.
    Regards,
    gkk1969

    I am seeing the same problem when i try to do Export to Java Source
    java.lang.NullPointerException
         at oracle.toplink.workbench.mappingsmodel.descriptor.relational.MWRelationalPrimaryKeyPolicy.adjustRuntimeDescriptor(MWRelationalPrimaryKeyPolicy.java:174)
         at oracle.toplink.workbench.mappingsmodel.descriptor.relational.MWRelationalTransactionalPolicy.adjustRuntimeDescriptor(MWRelationalTransactionalPolicy.java:85)
         at oracle.toplink.workbench.mappingsmodel.descriptor.MWDescriptor.buildRuntimeDescriptor(MWDescriptor.java:423)
         at oracle.toplink.workbench.mappingsmodel.descriptor.MWMappingDescriptor.buildRuntimeDescriptor(MWMappingDescriptor.java:860)
         at oracle.toplink.workbench.mappingsmodel.descriptor.relational.MWRelationalClassDescriptor.buildRuntimeDescriptor(MWRelationalClassDescriptor.java:791)
         at oracle.toplink.workbench.mappingsmodel.descriptor.relational.MWTableDescriptor.buildRuntimeDescriptor(MWTableDescriptor.java:955)
         at oracle.toplink.workbench.mappingsmodel.project.MWProject.buildRuntimeProject(MWProject.java:932)
         at oracle.toplink.workbench.mappingsmodel.project.MWProject.exportProjectSource(MWProject.java:824)
         at oracle.toplink.workbench.mappingsplugin.ProjectSourceGenerationCoordinator.exportProjectSource(ProjectSourceGenerationCoordinator.java:68)
         at oracle.toplink.workbench.mappingsplugin.ExportJavaSourceAction.execute(ExportJavaSourceAction.java:31)
         at oracle.toplink.workbench.framework.action.AbstractFrameworkAction.actionPerformed(AbstractFrameworkAction.java:134)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
         at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
         at javax.swing.AbstractButton.doClick(AbstractButton.java:289)
         at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1113)
         at javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(BasicMenuItemUI.java:943)
         at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:231)
         at java.awt.Component.processMouseEvent(Component.java:5100)
         at java.awt.Component.processEvent(Component.java:4897)
         at java.awt.Container.processEvent(Container.java:1569)
         at java.awt.Component.dispatchEventImpl(Component.java:3615)
         at java.awt.Container.dispatchEventImpl(Container.java:1627)
         at java.awt.Component.dispatchEvent(Component.java:3477)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
         at java.awt.Container.dispatchEventImpl(Container.java:1613)
         at java.awt.Window.dispatchEventImpl(Window.java:1606)
         at java.awt.Component.dispatchEvent(Component.java:3477)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

  • Error using xmlparserv2-904.jar in Reports9i to BI Publisher conversion

    I'm attempting a conversion of an Oracle Reports9i report in XML format to BI Publisher, as described in http://download.oracle.com/docs/cd/E10415_01/doc/bi.1013/e10416/convertrpts.htm.
    I run the following command:
    java.exe -classpath %classpath% oracle.apps.xdo.rdfparser.BIPBatchConversion -source F:\CF_Reports_10g -target F:\CF_Reports_OBI -debug
    This returns the following error:
    java.lang.UnsupportedClassVersionError: /oracle/apps/xdo/rdfparser/BIPBatchConversion (Unsupported major.minor version 49.0)
    The above web page specifies that xmlparserv2-904.jar be used in %classpath%. However, my installation of JDK6 update 14 doesn't contain this library. It only contains xmlparserv2.jar, so I use this in %classpath%.
    I'm assuming that this is causing the error.
    I also installed JDK5 update 17, but got the same error.
    Has anyone had any experience of this?
    Thanks,
    Stephen

    Hi,
    I am unable to locate in xmlparserv2-904.jar under JAVA_TOP/classes in oracle apps. Or in Oracle TopLink Software Downloads. Were you able to download/locate these mandatory files?
    Thanks,
    XRAV

  • Conversion error in Query

    Hi,
    i have an attribute customernumber mapped as Long. My developer now wants to do a query like "select * from xy where customernumber like '567%' ".
    Is it possible to do this with toplink?
    I get conversion errors due to toplink tries to convert 567% to a long value.
    builder.get("customernumber").like("567%")
    -Robert

    The mapping will always try to convert its value passed in to that of the mapped attribute.
    Probably the easiest way to address this is to add another direct query key for the field. If you added one in the mapping editor called customerNumberString to the same database field you could then use:
    builder.get("customerNumberString").like("567%")Doug

  • Exception Description: No conversion value provided for the attribute

    Hi!,
    The following is printed when I try to persist an entity with a an enum attribute in it. It deployted succuessfully and mapped fine a table, my configuration is, Windows2003, SJSAS 9 FCS, Derby DB.
    Exception [TOPLINK-115] (Oracle TopLink Essentials - 2006.4 (Build 060412)): ora
    cle.toplink.essentials.exceptions.DescriptorException
    Exception Description: No conversion value provided for the attribute [NEW].
    Mapping: oracle.toplink.essentials.mappings.DirectToFieldMapping[status-->REPORT
    .STATUS]
    Descriptor: RelationalDescriptor(com.namespace1.reports.persistence.Report --> [
    DatabaseTable(REPORT)])
    The Entity class is the following:
    * Report.java
    * Created on 25 ����� �����, 2006, 06:07 �
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package com.namespace1.reports.persistence;
    import java.io.*;
    import java.util.*;
    import javax.persistence.*;
    * @author Administrator
    @javax.persistence.Entity(name="Report")//name used in EJB-QL.
    public class Report implements Serializable {
    public enum ReportStatus{
    NEW,
    OPEN,
    SUBMITTED,
    ACCEPTED,
    REJECTED
    @javax.persistence.Id
    @javax.persistence.GeneratedValue(strategy = javax.persistence.GenerationType.AUTO)
    private long id;
    @Transient
    private int currentEntryId;
    @Column(length=256)
    private String title;
    private String ownerName;
    @Enumerated(EnumType.ORDINAL)
    @Basic
    private ReportStatus status;
    @OneToMany(mappedBy="report",targetEntity=ReportEntry.class,cascade=CascadeType.ALL)
    private Map<Integer,ReportEntry> reportEntries;
    /** Creates a new instance of Report */
    public Report() {
    public long getId() {
    return id;
    public void setId(long id) {
    this.id = id;
    public int hashCode() {
    int hash = 0;
    hash += (int)getId();
    return hash;
    public boolean equals(Object object) {
    // TODO: Warning - this method won't work in the case the id fields are not set
    if (!(object instanceof Report)) {
    return false;
    Report other = (Report)object;
    if (this.getId() != other.getId()) return false;
    return true;
    public String toString() {
    return "com.namespace1.reports.persistence.Report[id=" + getId() + "]";
    public int getCurrentEntryId() {
    return currentEntryId;
    public void setCurrentEntryId(int currentEntryId) {
    this.currentEntryId = currentEntryId;
    public String getTitle() {
    return title;
    public void setTitle(String title) {
    this.title = title;
    public String getOwnerName() {
    return ownerName;
    public void setOwnerName(String ownerName) {
    this.ownerName = ownerName;
    public ReportStatus getStatus() {
    return status;
    public void setStatus(ReportStatus status) {
    this.status = status;
    public Map<Integer, ReportEntry> getReportEntries() {
    return reportEntries;
    public void setReportEntries(Map<Integer, ReportEntry> reportEntries) {
    this.reportEntries = reportEntries;
    }

    This problem is side effect of issue 193 (https://glassfish.dev.java.net/issues/show_bug.cgi?id=193) and is described in details in issue 634 (https://glassfish.dev.java.net/issues/show_bug.cgi?id=634). Your choices are to use the work around described in the above issue or switch to the GlassFish build with the fix.
    regards,
    -marina

  • Conversion mapping is losing time zone data during daylight saving time

    We have a problem with conversion of Calendars to timestamp with timezone for the last hour of Daylight Saving Time (e.g. 01:00 EDT - 01:59 EDT) where it is being interpreted as Standard Time which is in reality 60 minutes later.
    We've written a JUnit test case that runs directly against TopLink to avoid any issues with WAS and its connection pooling.
    The Calendar theDateTime comes from an object called TimeEntry which is mapped to a TIMESTAMP WITH TIMEZONE field using conversion mapping with Data Type TIMESTAMPTZ (oracle.sql) and Attribute Type Calendar (java.util).
    We are using:
    Oracle TopLink - 10g Release 3 (10.1.3.0.0) (Build Patch for Bugs 5145690 and 5156075)
    Oracle9i Enterprise Edition Release 9.2.0.7.0 - 64bit Production
    Oracle JDBC driver Version: 10.2.0.1.0
    platform=>Oracle9Platform
    Execute this Java:
    SimpleDateFormat format = new SimpleDateFormat("MM/dd/yyyy HH:mm z");
    TimeZone tzEasternRegion = TimeZone.getTimeZone("US/Eastern");
    Calendar theDateTime = Calendar.getInstance(tzEasternRegion);
    theDateTime.setTime(format.parse("10/29/2006 01:00 EDT"));
    Persist to the database and execute this SQL:
    SELECT the_date_time, EXTRACT(TIMEZONE_REGION FROM the_date_time), EXTRACT(TIMEZONE_ABBR FROM the_date_time), EXTRACT(TIMEZONE_HOUR FROM the_date_time)
    FROM time_table WHERE time_table_id=1
    This provides the following results:
    THE_DATE_TIME EXTRACT(TIMEZONE_REGION FROM the_date_time) EXTRACT(TIMEZONE_ABBR FROM the_date_time) EXTRACT(TIMEZONE_HOUR FROM the_date_time)
    29-OCT-06 01.00.00.000000 AM US/EASTERN US/Eastern EST -5
    The wrong time zone is in the database. It should be EDT -4. Let's test the SQL that should be generated by TopLink. It should look like the following.
    Execute this SQL:
    UPDATE time_table SET the_date_time = TO_TIMESTAMP_TZ('10/29/2006 01:00 US/Eastern','mm/dd/yyyy HH24:MI TZR') WHERE (time_table_id=1)
    SELECT the_date_time, EXTRACT(TIMEZONE_REGION FROM the_date_time), EXTRACT(TIMEZONE_ABBR FROM the_date_time), EXTRACT(TIMEZONE_HOUR FROM the_date_time)
    FROM time_table WHERE time_table_id=1
    This provides the same results:
    THE_DATE_TIME EXTRACT(TIMEZONE_REGION FROM the_date_time) EXTRACT(TIMEZONE_ABBR FROM the_date_time) EXTRACT(TIMEZONE_HOUR FROM the_date_time)
    29-OCT-06 01.00.00.000000 AM US/EASTERN US/Eastern EST -5
    Now, execute this SQL:
    UPDATE time_table SET the_date_time = TO_TIMESTAMP_TZ('10/29/2006 01:00 EDT US/Eastern','mm/dd/yyyy HH24:MI TZD TZR') WHERE (time_table_id=1)
    SELECT the_date_time, EXTRACT(TIMEZONE_REGION FROM the_date_time), EXTRACT(TIMEZONE_ABBR FROM the_date_time), EXTRACT(TIMEZONE_HOUR FROM the_date_time)
    FROM time_table WHERE time_table_id=1
    This provides better results:
    THE_DATE_TIME EXTRACT(TIMEZONE_REGION FROM the_date_time) EXTRACT(TIMEZONE_ABBR FROM the_date_time) EXTRACT(TIMEZONE_HOUR FROM the_date_time)
    29-OCT-06 01.00.00.000000 AM US/EASTERN US/Eastern EDT -4
    The correct time zone is now in the database. Let's test reading this with the following Java:
    System.out.println("cal= " + theDateTime);
    System.out.println("date= " + theDateTime.getTime());
    System.out.println("millis= " + theDateTime.getTimeInMillis());
    System.out.println("zone= " + theDateTime.getTimeZone());
    This provides the following results:
    cal= java.util.GregorianCalendar[...]
    date= Sun Oct 29 01:00:00 EST 2006
    millis= 1162101600000
    zone= sun.util.calendar.ZoneInfo[id="US/Eastern",...]
    The TimeZone object is correct since we are using the US/Eastern regional time zone, but the millis are wrong which makes the time EST instead of EDT. The millis should be 1162098000000.
    The conversion from java.util.Calendar to TIMESTAMPTZ loses the actual offset when setting to a regional time zone. It can maintain this info by specifying it explicitly.
    The conversion from TIMSTAMPTZ to java.util.Calendar also loses the actual offset even if the correct offset is in the database.
    Has anyone else encountered this conversion problem? It appears to be a conversion problem in both directions. I know that the Calendar is lenient by default and will assume Standard Time if time is entered during the repeated 1 o'clock hour at the end of Daylight Saving Time, but the Calendars we are using are explicit in their time, so this would be classified as data corruption.
    Nik

    Opened an SR. Looks like there is a problem with conversion either in TopLink or in JDBC.

  • BPEL and conversational services

    For some reason my earlier post failed. It threw up some weird error.
    I am building a BPEL which is composed of synchronous web services. The simplest of these business processes has a single synchronous web service call. The web service returns an array of java beans.
    1. My web service has been deployed on the oc4j. It is not a JAX-RPC service but an oracle J2EE web service. I used the endpoint in the properties for the webservice to create the partner link but it gives me "The downloade of the specified resource has failed" error.
    the endpoint url looks like this http://db2yg41:8888/expenseApp-ExpenseServices-context-root/ItmTypeDBService
    I also tried appending a ?wsdl at the end but that failed too.
    2. how do I assign a XML schema for the input and output variables of the Business process? My schemas are defined in a business services project in JDev.
    3. What is the best practise for modeling such business processes which are composed of such conversational services. I want to have minimum number of transformations.
    Should I have my conversational service accept XML or is it good to stick to java beans? I personally prefer having these web services accept and return java bean instances to avoid another transformation within the webservice.In that case how do I perform the transformation on the business process side?
    4.If I need to expose these business processes to the presentation layer, what is the best approach?
    Thanks,
    Jeevak

    Hi Edwin,
    I hope we are on the same note with what I meant by a conversational service, I meant either async/sync services, nothing more sophisticated than that.
    Here is what I am trying to implement
    1. I have the xml schemas for the input and output messages of the process. Some of these processes are complex involvign user tasks and tasklists which we can deal with later.
    2. The simplest one contains an invoke activity. The web service interacts with the toplink layer. Currently it just extracts the data from the toplink POJOs into java beans and returns an array of these beans. I would prefer returning an array of the POJOs unless it is better returning an xml doc.
    My concerns
    1. If I use xml docs for the synchronous service it would mean performing redundant transformations. What do you suggest is the best way to transform the xml docs into beans and back both in the process as well as in the service. I have read about orajaxb for oracle j2ee web services and xml facade within the BPEL. I want to reduce the number of transformations and the amount of code I need to write since time is an important consideration
    2. I am using the endpoint url provided by the web service properties in jdev. The problem is that the BPEL server is unable to locate this service that has been deployed in the standalone oc4j container. This is an immediate problem that I need to address.
    3. Isnt there a way to expose the business process through a facade layer, or should it always be invoked as a web service?
    Thank you.
    Jeevak

  • How to map an large XML document to the XMLType with TopLink in JDev

    Hello!
    We need to map an XML document in the Java String to an XMLType column. If the XML document has less than 4000 characters, we have no problems by using the DirectToField mapping. However, once the XML document has more than 4000 characters, using the DirectToField mapping, we got the error: Exception [TOPLINK-4002] (Oracle TopLink - 10g Release 3 (10.1.3.0.0) (Build 060118)): oracle.toplink.exceptions.DatabaseException
    Internal Exception: java.sql.BatchUpdateException: ORA-01461: can bind a LONG value only for insert into a LONG column
    Then we have tried to use the "Type Conversion" mapping, to map it to the database type (Clob or NClob --oracle.toplink.oraclespecific). we got:
    Exception [TOPLINK-4002] (Oracle TopLink - 10g Release 3 (10.1.3.0.0) (Build 060118)): oracle.toplink.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: ORA-00932: inconsistent datatypes: expected NUMBER got CLOB
    Error Code: 932
    Any suggestions?
    Thanks in advance!

    Thanks Matt! It works fine by using DirectToXMLTypeMapping.
    However, to get it work is not smooth. In particularly, we use Jdev in our project and Jdev has not included this feature yet. Therefore, I had to use the TopLink Workbench to create the descriptor file and cut&paste to the description file that generated by JDev. And also xdb.jar has to be part of the classpath.
    Then I come to an question -- how can we take some features that only provided by the TopLink Workbench into the Jdev environment without having to hack around?
    Thanks,
    s.c.

Maybe you are looking for