Toplink JPA + Postgis

Hello,
Does TopLink JPA supports PostgreSQL together with Postgis extensions? As far as I know, for Hibernate, there is the Hibernate spatial plugin that handles geometric features. Does TopLink provide support for Postgis by default? In Google, there is not much information related to using Postgis together with Toplink.
br, Christoph

Christoph,
there is support for PostgreSQL but no explicit support for Postgis . The mapping and querying frameworks are extensible to allow you to map custom types and SQL operators. Based on customer demand we added support for Oracle DB's spatial capabilities. A similar extension could be added for Postgis. I would recommend opening an enhancement request against EclipseLink (we now develop TopLink in this open source project).
Doug

Similar Messages

  • Couldn't persist OneToMany JoinColumn/JoinTable (Unidir) using TopLink JPA

    Hi All,
    I am having a lot of difficulty deploying a OneToMany Unidirectional (Zipcode) record which consist of multiple Zipnames using TopLink on Glassfish v2r2, JDK1.6.0_06, MySQL 5.0, Netbeans 6.1 and Windows XP platform.
    Below are the relevant EJBs snippets:
    Zipcode class
    @Entity
    @Table(name="ZIPCODE")
    public class Zipcode implements Serializable {
    @OneToMany(cascade={CascadeType.ALL}, fetch=FetchType.EAGER)
    @JoinColumn(name="ZIPCODE_ID")    
                 or
        @JoinTable(name="ZIPCODE_ZIPNAME",          
                   joinColumns={@JoinColumn(name="ZIPCODE_ID")},
                   inverseJoinColumns={@JoinColumn(name="ZIPNAME_ID")})
        private Collection<Zipname> zipnames = new ArrayList<Zipname>();
        public Collection<Zipname> getNames()
         return zipnames;
        public void setZipnames(Collection<Zipname> zipnames)
         this.zipnames = zipnames;
    Zipname class does not maintain relationship back to Zipcode.
    public class ZipcodeApplicationClient {
    @PersistenceContext(unitName="GeographicalDB-PU")
    private static EntityManager manager;
        public ZipcodeApplicationClient() {
        public static void main(String[] args) {
            try {
                Zipcode zipcode_1 = new Zipcode();
                zipcode_1.setcode(9001);
                Zipname zipname_1 = new Zipname();
                zipname_1.setName("Harbour Cove");
                zipcode_1.getNames().add(zipname_1);
                // Can add one Zipname record with JoinTable but not JoinColumn
                Zipname zipname_2 = new Zipname();
                zipname_2.setName("Wonderland");
                zipcode_1.getNames().add(zipname_2);
                manager.persist(zipcode_1);   // line 45
    The same deployment error message below was generated from both JoinColumn and JoinTable methods:
    run-deploy:
    run-display-browser:
    run-ac:
    Copying 1 file to C:\Documents and Settings\Jack\GeographicalBean\dist
    Caught an unexpected exception!
    java.lang.NullPointerException
            at client.ZipcodeApplicationClient.main(ZipcodeApplicationClient.java:45)
            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:597)
            at com.sun.enterprise.util.Utility.invokeApplicationMain(Utility.java:266)
            at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:449)
            at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:259)
            at com.sun.enterprise.appclient.Main.main(Main.java:200)
    run-InvestmentBean-app-client:The JoinColumn method would not work for one Zipname record. On the other hand, JoinTable approach would allow us to add a single Zipname record without error out.
    Q1. Can you confirm whether TopLink JPA 1.0 (Glassfish v2r2) support OneToMany JoinColumn Unidirectional at all?
    Q2. Does TopLink JPA 1.0 (Glassfish v2r2) support OneToMany JoinTable Unidirectional? If so, what is the cause of this issue? Otherwise, please make appropriate recommendation steps to take.
    This question has been posted on http://forums.sun.com/thread.jspa?threadID=5330670&tstart=0 and http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=78&t=004489&p=1 earlier in the hope a quicker response.
    Your guidance would be very much appreciated.
    Many thanks,
    Jack

    Hi,
    Below are some more error output from the OneToMany JoinTable Unidirectional approach:
    pre-run-deploy:
    Initial deploying InvestmentBean to C:\Documents and Settings\abc\InvestmentBean\dist\gfdeploy
    Completed initial distribution of InvestmentBean
    Start registering the project's server resources
    Finished registering server resources
    moduleID=InvestmentBean
    deployment started : 0%
    deployment finished : 100%
    Deploying application in domain completed successfully
    Trying to create reference for application in target server completed successfully
    Trying to start application in target server completed successfully
    WARNING:
    JDO76614: Deployment encountered SQL Exceptions:
    JDO76609: Got SQLException executing statement "CREATE TABLE ZIPCODE (ID INTEGER NOT NULL, DIALING_CODE VARCHAR(255), TIME_ZONE VARCHAR(255), CODE INTEGER, NEAREST_AIRPORT VARCHAR(255), LONGITUDE VARCHAR(255), NEAREST_TRAIN_STATION VARCHAR(255), NEAREST_URBAN_CENTRE VARCHAR(255), HOTELS VARCHAR(255), LATITUDE VARCHAR(255), NEARBY_FEATURES VARCHAR(255), COUNCIL VARCHAR(255), LOCALITY VARCHAR(255), PRIMARY KEY (ID))": com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'zipcode' already exists
    JDO76609: Got SQLException executing statement "CREATE TABLE ZIPCODE_ZIPNAME (ZIPCODE_ID INTEGER NOT NULL, ZIPNAME_ID INTEGER NOT NULL, PRIMARY KEY (ZIPCODE_ID, ZIPNAME_ID))": com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'zipcode_zipname' already exists
    JDO76609: Got SQLException executing statement "CREATE TABLE ZIPNAME (ID INTEGER NOT NULL, NAME VARCHAR(255), PRIMARY KEY (ID))": com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'zipname' already exists
    JDO76609: Got SQLException executing statement "ALTER TABLE ZIPCODE_ZIPNAME ADD CONSTRAINT FK_ZIPCODE_ZIPNAME_ZIPCODE_ID FOREIGN KEY (ZIPCODE_ID) REFERENCES ZIPCODE (ID)": java.sql.SQLException: Can't create table '.\geographicaldb\#sql-434_4.frm' (errno: 121)
    JDO76609: Got SQLException executing statement "ALTER TABLE ZIPCODE_ZIPNAME ADD CONSTRAINT FK_ZIPCODE_ZIPNAME_ZIPNAME_ID FOREIGN KEY (ZIPNAME_ID) REFERENCES ZIPNAME (ID)": java.sql.SQLException: Can't create table '.\geographicaldb\#sql-434_4.frm' (errno: 121)Enable of InvestmentBean in target server completed successfully
    Enable of application in all targets completed successfully
    All operations completed successfully
    post-run-deploy:
    run-deploy:
    run-display-browser:
    run-ac:
    Copying 1 file to C:\Documents and Settings\Jack\GeographicalBean\dist
    Caught an unexpected exception!
    java.lang.NullPointerException
    at client.ZipcodeApplicationClient.main(ZipcodeApplicationClient.java:45)
    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:597)
    at com.sun.enterprise.util.Utility.invokeApplicationMain(Utility.java:266)
    at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:449)
    at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:259)
    at com.sun.enterprise.appclient.Main.main(Main.java:200)
    run-GeographicalBean-app-client:
    run:
    I would like to correct an earleir comment where I stated that this method did work when adding a single Zipname record. This is no true.
    Thanks,
    Jack

  • Toplink JPA with Coherence deployment to Weblogic 10.3

    Hi,
    I have created an EJB application using Toplink JPA and Coherence. I would like to deploy this application to Weblogic 10.3.
    During the startup of Weblogic I have specified the Java option as
    -Dtangosol.coherence.cacheconfig=D:/JDEV_11g/jdeveloper/jdev/mywork/CoherenceApp/CoherenceProject/src/META-INF/coherence-cache-config.xml.
    Persistence.xml and coherence-cache-config.xml are palced inside the jar file.
    When I execute the ejb client program, during the method call, I can see that coherence is started but it uses the cache-config from the coherence.jar file instaed of the value I have set during startup. How can I make weblogic use my cache-config.xml? I have included the log file entries from server:
    [EL Finest]: 2009.04.17 05:33:48.625--UnitOfWork(1777337)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Execute query ReadObjectQuery(coherenceproject.MetadataType)
    2009-04-17 05:33:54.547/258.954 Oracle Coherence 3.4.2/411 <Info> (thread=[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Loaded operational configuration from resource "zip:D:/JDEV_11g/jdeveloper/jdev/mywork/CoherenceApp/lib/coherence.jar!/tangosol-coherence.xml"
    2009-04-17 05:33:54.562/258.969 Oracle Coherence 3.4.2/411 <Info> (thread=[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Loaded operational overrides from resource "zip:D:/JDEV_11g/jdeveloper/jdev/mywork/CoherenceApp/lib/coherence.jar!/tangosol-coherence-override-dev.xml"
    2009-04-17 05:33:54.562/258.969 Oracle Coherence 3.4.2/411 <D5> (thread=[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Optional configuration override "/tangosol-coherence-override.xml" is not specified
    2009-04-17 05:33:54.578/258.985 Oracle Coherence 3.4.2/411 <D5> (thread=[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Optional configuration override "/custom-mbeans.xml" is not specified
    Oracle Coherence Version 3.4.2/411
    Grid Edition: Development mode
    Copyright (c) 2000-2009 Oracle. All rights reserved.
    *2009-04-17 05:33:55.750/260.157 Oracle Coherence GE 3.4.2/411 <Info> (thread=[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Loaded cache configuration from resource "zip:D:/JDEV_11g/jdeveloper/jdev/mywork/CoherenceApp/lib/coherence.jar!/coherence-cache-config.xml"*
    2009-04-17 05:34:17.390/281.797 Oracle Coherence GE 3.4.2/411 <D5> (thread=Cluster, member=n/a): Service Cluster joined the cluster with senior service member n/a
    2009-04-17 05:34:21.890/286.297 Oracle Coherence GE 3.4.2/411 <Info> (thread=Cluster, member=n/a): Created a new cluster "cluster:0x2FFB" with Member(Id=1, Timestamp=2009-04-17 05:34:09.203, Address=141.144.90.113:8088, MachineId=18289, Location=site:sg.oracle.com,machine:rajerama-sg,process:3816, Role=WeblogicServer, Edition=Grid Edition, Mode=Development, CpuCount=2, SocketCount=1) UID=0x8D905A7100000120B0D9DD3347711F98
    2009-04-17 05:34:27.000/291.407 Oracle Coherence GE 3.4.2/411 <D5> (thread=DistributedCache, member=1): Service DistributedCache joined the cluster with senior service member 1
    [EL Finer]: 2009.04.17 05:34:28.343--ServerSession(32927169)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Coherence(MetadataType)::Get: 2
    [EL Fine]: 2009.04.17 05:34:28.703--ServerSession(32927169)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Coherence(MetadataType)::Get: 2 result: null
    [EL Finer]: 2009.04.17 05:34:28.703--ServerSession(32927169)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Coherence(MetadataType)::Get: 2
    *[EL Fine]: 2009.04.17 05:34:28.703--ServerSession(32927169)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Coherence(MetadataType)::Get: 2 result: null*
    null
    Eventhough the method is called correctly, it does not return the value. Is there any other setup that has to be done?
    Regards
    Raji

    Hi Raji,
    You mentioned:
    >
    -Dtangosol.coherence.cacheconfig=D:/JDEV_11g/jdeveloper/jdev/mywork/CoherenceApp/CoherenceProject/src/META-INF/coherence-cache-config.xml
    >
    and
    >
    Persistence.xml and coherence-cache-config.xml are palced inside the jar file.
    >
    It appears that these are conflicting; as the system property indicates that the config should be read from a file, whereas the file is actually deployed in a jar.
    That being said, I would suggest double checking that the system property is actually being set in the JVM. In my testing, if I specify a cache config that does not exist, an exception will be thrown:
    java -Dtangosol.coherence.cacheconfig=foo.xml  com.tangosol.net.CacheFactory
    Oracle Coherence Version 3.4.2/411p3
    Grid Edition: Development mode
    Copyright (c) 2000-2009 Oracle. All rights reserved.
    Map (?): cache test
    2009-04-22 15:33:15.310/6.917 Oracle Coherence GE 3.4.2/411p3 <Error> (thread=main, member=1):
    (Wrapped: Failed to load the factory) java.lang.reflect.InvocationTargetException
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
            at com.tangosol.util.ClassHelper.newInstance(ClassHelper.java:662)
            at com.tangosol.net.CacheFactory.getConfigurableCacheFactory(CacheFactory.java:602)
            at com.tangosol.coherence.component.application.console.Coherence.doCache(Coherence.CDB:9)
            at com.tangosol.coherence.component.application.console.Coherence.processCommand(Coherence.CDB:209)
            at com.tangosol.coherence.component.application.console.Coherence.run(Coherence.CDB:39)
            at com.tangosol.coherence.component.application.console.Coherence.main(Coherence.CDB:3)
            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:585)
            at com.tangosol.net.CacheFactory.main(CacheFactory.java:1308)
    Caused by: (Wrapped: Failed to load configuration resource: foo.xml) java.io.IOException: Configuration is missing: "foo.xml", loader=null
            at com.tangosol.net.DefaultConfigurableCacheFactory.loadConfigAsResource(DefaultConfigurableCacheFactory.java:386)
            at com.tangosol.net.DefaultConfigurableCacheFactory.loadConfig(DefaultConfigurableCacheFactory.java:337)
            at com.tangosol.net.DefaultConfigurableCacheFactory.loadConfig(DefaultConfigurableCacheFactory.java:309)
            at com.tangosol.net.DefaultConfigurableCacheFactory.<init>(DefaultConfigurableCacheFactory.java:137)
            ... 15 moreThanks,
    Patrick

  • TopLink - JPA - Jdeveloper 11g

    Hi All,
    I am having a TopLink - JPA example. I am executing a InsertExample.java which will insert record. But as I run InsertExample.java I keep getting following error.
    I am using Jdeveloper 11 g (and NOT Eclipse). How to get rid of following error ?
    "C:\Program Files\Java\jdk1.6.0_22\bin\javaw.exe" -client -classpath C:\MyJdevUserHomeEnv\mywork\TopLinkDesign\.adf;C:\MyJdevUserHomeEnv\mywork\TopLinkDesign\TopLink\classes;C:\Oracle\MiddlewarePS3\modules\com.oracle.toplink_1.0.0.0_11-1-1-4-0.jar;C:\Oracle\MiddlewarePS3\modules\org.eclipse.persistence_1.0.0.0_2-1.jar;C:\Oracle\MiddlewarePS3\modules\com.bea.core.antlr.runtime_2.7.7.jar;C:\Oracle\MiddlewarePS3\oracle_common\modules\oracle.toplink_11.1.1\javax.persistence_2.0_preview.jar;C:\Oracle\MiddlewarePS3\oracle_common\modules\oracle.xdk_11.1.0\xmlparserv2.jar;C:\Oracle\MiddlewarePS3\oracle_common\modules\oracle.xdk_11.1.0\xml.jar;C:\downloads\toplink_111130_en.zip;C:\downloads\coherence-java-3.6.0.0b17229.zip;C:\downloads\coherence-java-3.6.0.0b17229\coherence\lib\coherence.jar;C:\downloads\eclipselink-2.1.1.v20100817-r8050\eclipselink\jlib\eclipselink.jar;C:\downloads\toplink_111130_en\jlib\toplink-grid.jar;C:\Oracle\MiddlewarePS3\jdeveloper\ide\macros\..\..\..\wlserver_10.3\server\lib\ojdbc6.jar;C:\Oracle\MiddlewarePS3\jdeveloper\ide\macros\..\..\..\oracle_common\modules\oracle.nlsrtl_11.1.0\orai18n.jar;C:\Oracle\MiddlewarePS3\oracle_common\modules\oracle.odl_11.1.1\ojdl.jar;C:\Oracle\MiddlewarePS3\oracle_common\modules\oracle.dms_11.1.1\dms.jar -Djavax.net.ssl.trustStore=C:\Oracle\MiddlewarePS3\wlserver_10.3\server\lib\DemoTrust.jks gridcache.example.InsertExample
    [EL Info]: 2010-11-20 19:58:59.418--ServerSession(30936685)--EclipseLink, version: Eclipse Persistence Services - 2.1.2.v20101006-r8316
    [EL Warning]: 2010-11-20 19:58:59.425--java.lang.ClassNotFoundException: weblogic.version
    [EL Info]: 2010-11-20 19:58:59.855--ServerSession(30936685)--file:/C:/MyJdevUserHomeEnv/mywork/TopLinkDesign/TopLink/classes/_employee-pu login successful
    [EL Info]: 2010-11-20 19:58:59.855--JMX MBeanServer instance found: [com.sun.jmx.mbeanserver.JmxMBeanServer@146c1d4], # of beans: [20], domain: [DefaultDomain] at index: [0].
    [EL Warning]: 2010-11-20 19:58:59.861--Failed to initialize MBean threadPoolRuntime: javax.management.InstanceNotFoundException: com.bea:Name=RuntimeService,Type=weblogic.management.mbeanservers.runtime.RuntimeServiceMBean
    [EL Warning]: 2010-11-20 19:58:59.862--Failed to initialize MBean threadPoolRuntime: javax.management.InstanceNotFoundException: com.bea:Name=RuntimeService,Type=weblogic.management.mbeanservers.runtime.RuntimeServiceMBean
    Exception in thread "main" java.lang.IllegalArgumentException: Object: Employee(0: Smith, Bob) is not a known entity type.
    *     at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.registerNewObjectForPersist(UnitOfWorkImpl.java:4198)*
    *     at org.eclipse.persistence.internal.jpa.EntityManagerImpl.persist(EntityManagerImpl.java:403)*
    *     at gridcache.example.InsertExample.main(InsertExample.java:29)*
    Process exited with exit code 1.

    It seems this is not a Java EE deployment so is the Employee class listed in the persistence.xml file? Or have you set <exclude-unlisted-classes>false</exclude-unlisted-classes> ? Alternatively you could package the classes into a Jar referenced through the <jar-file></jar-file> element.
    --Gordon                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Toplink JPA: jdbc connection access required

    I have a strong reason why direct access to the connections used by Toplink JPA is required: for each connection I need to execute
    - a "set role" to grant permissions,
    - "set lock mode" to prevent hangups,
    - "set isolation" to get the correct transaction type,
    - possibly a "set explain on" to get query costs info,
    - and a "set constraints all deferred" to have constraints checked at commit time, not earlier.
    Can the Toplink pooling mechanism be replaced?

    You can use either an external data source from your container or an JDBC data source for that matter but you cannot replace the internal connection pool. Although one option may be to use a wrapped connection pool of your own I would first recommend looking at the SessionEventListener callbacks. Implementing this interface and registering it using a SessionCustomizer (persistence unit property) would allow you to be notified and get access to the JDBC connection when acquired and released from either pooling mechanism.
    Here is an example:
    public class JDBCConnectionListener extends SessionEventAdapter implements SessionCustomizer {
         * This method is used when this class is configured as the session customizer
         * in the persistence unit properties.
        public void customize(Session session) {
            session.getEventManager().addListener(this);
         * This event is raised after a connection is acquired from a connection pool.
        public void postAcquireConnection(SessionEvent event) {
            DatabaseAccessor da = (DatabaseAccessor)event.getResult();
            Connection con = da.getConnection();
            PreparedStatement statement;
            try {
                event.getSession().log(SessionLog.FINE, SessionLog.SQL, "POST-ACQUIRE> SELECT SYSDATE FROM DUAL");
                statement = con.prepareStatement("SELECT SYSDATE FROM DUAL");
                ResultSet rs = statement.executeQuery();
                rs.close();
            } catch (SQLException e) {
                // TODO
         * This event is raised before a connection is released into a connection pool.
        public void preReleaseConnection(SessionEvent event) {
    }Doug

  • TopLink JPA doesn't persist Clob field when useStringBinding

    I'm using Toplink JPA on a JSF application deploying on Tomcat.
    Everything works fine except the table with Clob field.
    When insert data with size larger than 4KB, the error will occur.
    I did some searching and I fixed this by using SessionCustomizer.
    In my persistence.xml I put this
    <property name="toplink.session.customizer" value="com.my.sessions.MySessionCustomizer"/>
    and MySessionCustomizer is like this
    public class MySessionCustomizer implements SessionCustomizer {
         public void customize(Session session) throws Exception {
              DatabaseLogin login = session.getLogin();
              login.useStringBinding();
              login.setShouldBindAllParameters(false);
              login.dontCacheAllStatements();
    Things seem to work fine now but I found that Toplink does not persist the field that useStringBinding in database (Oracle 9i)
    eg. when I update an object into a table which has 1 clob field and some other field like VARCHAR2, all the data in non-clob fields are stored perfectly in Oracle but the data in Clob field just gone blank. It just gone blank in the database but in my application, it's still there. I mean as long as my session is still alive, everything seems to work fine from the application side. But when I start a new session, the data in the Clob is lost because it's not in the database.
    Why is this happening? Do I need to do anything extra when useStringBinding?
    It seems to me that the field with StringBinding just don't get into the database.
    Could somebody help me with this?

    This is an issue with the Oracle thin JDBC driver in that it has a 4k limit for LOBS. The best workaround is to use the Oracle OCI JDBC driver, which does not have this limitation (I think this limitation was also improved in the Oracle 10.2 thin JDBC driver).
    If you are using TopLink 10.1.3 a workaround to the JDBC issue is provided by using the Oracle9Platform and configuring the mapping for the CLOB to have a field-classification of java.sql.Clob.class.
    If you are using TopLink Essentials unfortunately this support is not currently available. I believe there is already an issue logged for this in Glassfish. If you cannot use the OCI driver you may need to insert the CLOB data using direct JDBC code.

  • TopLink JPA  coherence

    we are using Toplink, JPA and coherence.
    can anyone point me to java code that depicts "How to warm up the coherence cache and then run queries against the cache. and then what happens if the at some point object is not in cache " ?
    thx
    D

    Warming the cache for a TopLink Grid enabled entity can be done by issuing a query for the objects you want to load into the cache along with the hint:
    query.setHint(QueryHints.QUERY_REDIRECTOR, new IgnoreDefaultRedirector());
    Which is discussed here: http://download.oracle.com/docs/cd/E14571_01/doc.1111/e16596/tlcgd003.htm#CHDGFCAI.
    You can also use JOIN and BATCH hints on the query if you want to load a graph of objects into the grid.
    With Grid Read and Grid Entity configurations all queries will be executed on the grid. Primary key queries on the grid for objects not present in the grid will result in a primary key select on the database if you've configured a CacheStore for a given entity's cache.
    Non-PK queries will only return what is in the grid. With Grid Read and Grid Entity is it your responsibility to ensure the grid is warmed up.
    --Shaun                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Toplink JPA forces database table and column names to UPPERCASE! Why?

    I have recently experienced using Toplink JPA while using glassfish ... migrating an existing application to EJB 3.0 persistence. Toplink JPA, as implemented in glassfish, forces tablenames and column names from my code to be uppercase in select statements, etc. as then submitted to the database. Why? I cannot find anything in the EJB 3.0 specs on persistence that even suggests this.
    This created a serious problem for me, in my application. For my code to work I had to change the names of the database tables to all uppercase, even though that meant other of my applications, already written using the original mixed case names of the databases, will no longer work unless I revise the code in those applications! (I am using mySQL as my database.)
    In both Unix/Linux and Java, which are both case sensitive, If I wanted names of files or other items to be uppercase, I would have written them that way. I do not expect some middleware piece of software to muck around with the case of text I have put into my code.
    I am hopeful this 'feature' of the reference implementation of the EJB Persistence API will be corrected in a subsequent version. [Maybe you can tell I am not happy!]
    Thanks for listening to my rant.

    Robert,
    I found that the name I specify in all of my @Table, @Column, ... annotations is used with the case as it is provided.
    If TopLink determines the schema information through defaults then the names it comes up with are definitely upper cased by default.
    Are you specifying the schema information that you want in annotations or XML?
    Doug

  • Toplink-jpa and/or jdev11 problem

    Hi,
    How should I configure a toplink/jpa application in oc4j 11? Mine doesn't seem to be able to be able to connect... But I guess I didn't configure correctly.
    Anyway, it works in the jdevelopper 11 (technical preview) embedded oc4j. I can deploy it ok from jdeveloper, and even connect to the session beans on the server from another application (swing client, independant).
    But whenever my beans try to make a request, I get this exception:
    exception occurred during method invocation:
    javax.ejb.EJBTransactionRolledbackException: Exception [TOPLINK-4002] (Oracle
    TopLink - 11g Release 1 (11.1.1.0.0) (Build 070428)):
    oracle.toplink.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: Io exception: The Network Adapter could not establish
    the connectionError Code: 17002; nested exception is: Exception [TOPLINK-4002]
    (Oracle TopLink - 11g Release 1 (11.1.1.0.0) (Build 070428)):
    I made a sample jdbc connection from the session bean, to the database it should connect to: no problem.
    Is there a checklist of what I should make sure? There are a lot of wizards, configuration files, etc. and I'm a little bit confused about the cause of the problem and how to fix it. My question has been on metalink for 48 hours, but without luck yet.
    Here is a more complete part of the stack trace:
    Caused by: java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
    at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:72)
    at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:105)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:168)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:224)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:495)
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:429)
    at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:650)
    at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:200)
    at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:34)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:413)
    at oracle.jdbc.pool.OracleDataSource.getPhysicalConnection(OracleDataSource.java:388)
    at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:278)
    at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:203)
    at oracle.oc4j.sql.DataSourceConnectionPoolDataSource.getPooledConnection(DataSourceConnectionPoolDataSource.jav
    a:57)
    at oracle.oc4j.sql.xa.EmulatedXADataSource.getXAConnection(EmulatedXADataSource.java:94)
    at oracle.oc4j.sql.spi.ManagedConnectionFactoryImpl.createXAConnection(ManagedConnectionFactoryImpl.java:251)
    at oracle.oc4j.sql.spi.ManagedConnectionFactoryImpl.createManagedConnection(ManagedConnectionFactoryImpl.java:21
    2)
    at com.evermind.server.connector.ApplicationConnectionManager.createManagedConnection(ApplicationConnectionManager.java:1354)
    at oracle.oc4j.sql.OracleConnectionFactoryAdapter.createConnection(OracleConnectionFactoryAdapter.java:110)
    at oracle.ucp.common.CollectionConnectionPoolImpl.createOnePooledConnection(Coll
    ectionConnectionPoolImpl.java:513)
    at oracle.ucp.common.CollectionConnectionPoolImpl.borrowConnectionWithoutCountingRequests(CollectionConnectionPoolImpl.java:
    419)
    at oracle.ucp.common.CollectionConnectionPoolImpl.borrowConnection(CollectionConnectionPoolImpl.java:295)
    at oracle.oc4j.sql.OracleCommonConnectionPool.borrowConnection(OracleCommonConnectionPool.java:79)
    at oracle.oc4j.sql.OracleCommonConnectionPool.getManagedConnection(OracleCommonConnectionPool.java:61)
    at oracle.j2ee.connector.OC4JConnectionPoolAdapter.getManagedConnection(OC4JConnect
    ionPoolAdapter.java:543)
    at com.evermind.server.connector.ApplicationConnectionManager.getManagedConnectionContext(ApplicationConnectionManager.java:1568)
    at com.evermind.server.connector.ApplicationConnectionManager.getConnectionFromPool
    (ApplicationConnectionManager.java:1553)
    at com.evermind.server.connector.ApplicationConnectionManager.acquireConnectionContext(ApplicationConnectionManager.ja
    va:1499)
    at com.evermind.server.connector.ApplicationConnectionManager.allocateConnection(ApplicationConnectionManager.java:1444)
    at oracle.j2ee.connector.OracleConnectionManager.unprivileged_allocateConnection(OracleConnectionManager.jav
    a:238)
    at oracle.j2ee.connector.OracleConnectionManager.allocateConnection(OracleConnectionManager.java:192)
    at oracle.oc4j.sql.ManagedDataSource.getConnection(ManagedDataSource.java:217)
    at oracle.oc4j.sql.ManagedDataSource.getConnection(ManagedDataSource.java:147)
    at oracle.toplink.jndi.JNDIConnector.connect(JNDIConnector.java:123)
    ... 69 more

    HI
    can you reply the feedback of metalink? because I'm having similar problem.
    I debug in junit and embebbed at the jdev and it works well, but when I deploy in a standalone oc4j it gives me the same error of Excepção de E/S: The Network Adapter could not establish the connection
    And I'm not using 11g, I'm still in 10g but the problem might be the same.
    cumps
    DnlCY
    null

  • Toplink JPA 2.0  migration in JDeveloper 11.1.1.2.0

    I would like to used Toplink JPA 2.0 in JDeveloper 11g, how to update toplink_111120_en.zip in JDeveloper IDE.? Even I added eclipselink and JPA 2.0 spec lib into classpath, I am still getting compile time error on orphanRemoval attribute in OneToMany annotation.

    Hi,
    I am not clear on the requirement.Let me know if my understanding is correct.
    You have a created a JPA project in Toplink Workbench and want to reuse the work in JDeveloper.
    If the above is correct,open the JDeveloper(PS3 release) and use the File-import-TopLinkworkbenchProject and select the application workspce created in TWB.
    Regards,
    Vinay

  • Toplink JPA Deployment problem  in OC4J

    Hi all ,
    we are having problem in deployment for an toplink JPA program in OC4J 10.1.3 .. We are using toplink essesntial and our deployed EAR structure is
    aaplication.xml
    rmwtoplink.war
    the content of application.xml is as
    <display-name>rmwtoplink</display-name>
    <module>
    <web>
    <web-uri>rmwtoplink.war</web-uri>
    <context-root>rmwapplist</context-root>
    </web>
    </module>
    the content of war file as below :
    web-inf\web.xml
    web-inf\classes\META-INF\persistence.xml
    web-inf\classes\<classes>
    web-inf\gnf\<jsp pages>
    when ever a pages are called those do not use entity manager / jpa call are loading perfectly , but the pages which have used jpa are nt diplayed , we check the error messages , it just halts after following codes :
    EntityManagerFactory emf =
    Persistence.createEntityManagerFactory(jpaSource);
    It seems there is no exception that is even thrown in page or opmn log .
    The same program is running fine in Jdveloper 10.1.3 /
    Is there any way where we can get the actual error message ?
    we are using toplink.jdbc.url for connecting the database .

    Here is little more insight for the problem , further check reveals that :
    start connecting rmwtest
    exception occured for connection test , Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: Listener refused the connection with the following error:
    ORA-12514, TNS:listener does not currently know of service requested in connect descriptor
    The Connection descriptor used by the client was:
    //localhost:1521/ORCL
    we do not have any idea how is localhost:1521/ORCL picked up , in our persistence.xml we have
    where as rmwtest defined in persistence.xml as
    <persistence-unit name="rmwtest" transaction-type="RESOURCE_LOCAL">
    <provider>oracle.toplink.essentials.PersistenceProvider</provider>
    <class>rmw.gnf.entity.ServSesnUser</class>
    <class>rmw.gnf.entity.RmwData</class>
    <class>rmw.gnf.entity.GnfData</class>
    <properties>
    <property name="toplink.logging.level" value="FINEST"/>
    <property name="toplink.jdbc.driver" value="oracle.jdbc.driver.OracleDriver"/>
    <property name="toplink.jdbc.url" value="jdbc:oracle:thin:@middb.1dc.com:1621:ukdbins"/>
    <property name="toplink.jdbc.user" value="****"/>
    <property name="toplink.jdbc.password" value="********"/>
    </properties>
    </persistence-unit>

  • Toplink JPA LAZY loading in Java SE works without javaagent?

    hi there,
    I tought that mappings like
    @JoinColumn(name = "join_col_name")
    @ManyToOne(cascade=CascadeType.ALL, fetch=FetchType.LAZY)
    private RelatedObject relObj;
    with TopLink JPA in Java SE environment works ONLY with the
    -javaagent:toplink-essentials-agent.jar
    JVM parameter?
    the strange thing is: I did 2 test runs, with and without the java agent parameter. I also could see that in the first case the weaver is working, in the second the property "toplink.weaving=false" is printed to the console BUT if I access the LAZY mapped attribute of the object instance it works in both cases - I expected a NullPointerEx. in the case without the javaagent.
    Is there anything I missed?
    Hans

    Chris,
    thank for for the tip about verifying lazy or eager fetching. The results are interesting - or better: confusing - to me:
    I have built a test project with 3 entities:
    Entity A hast @OneToMany to Entity B and
    Entity B has ManyToONe to Entity C
    A <-- B --> C
    ALL relations are marked with FetchType.LAZY in all directions.
    When I simply run the test project via main()-method out of eclipse, WITHTOUT specifycing a -javaagent parameter in the run dialog, I can confirm using your test case that the realtion IS LAZILY FETCHED.
    So, I do not really know how this should work without the javaagent.
    You mentioned statically weaved classed - is this the default case when no agent is present, how is it done? Toplink logging says that weaving is NOT active:
    ServerSession(16821027)--Thread(Thread[main,5,main])--property=toplink.weaving; value=false
    so how can the lazy loading work then?
    regards,
    Hans

  • How can we maintain External cache in TopLink JPA

    Hi,
    JPA maintains shared session cache for the purpose of multiple users .Individual user can not use this shared session cache . How can we maintain that individual user cache in TopLink JPA . In our application we are using container managed transactions.
    Regards
    Sucharitha.

    I'm not sure I understand, perhaps you could clarify your question?
    Do you want to access an object from the shared cache? There is a TopLink JPA query hint "return-shared" to allow for read-only shared objects to be returned on a query.
    If you do not wish to have a shared cache, you can set the cache to be isolated (see @Cache annotation, or persistence property "eclipselink.cache.shared.<class>").
    You can also access the shared cache directly using getServerSession().getIdentityMapAccessor().

  • Automatic connection "ping" / health check in TopLink JPA ?

    Some days ago we experienced problems with our underlying Oracle database, so the DB server hat to be shut down and rebootet. The application server machine (running Apache Tomcat 5.5 on a Linux OS) which provides several web-applications that are using Toplink JPA were not restarted after the DB was up again.
    We encountered several subsequent "connection reset" errors within the webapps which where produced by TopLink JPA. I'd assume that this comes from the underlying restart of the DB, which invalidated/closed TopLink's JPA connection.
    is there any option e.g. to be set in persistence.xml to enable a Connection-"ping" or "health check" before TopLink JPA is using the connection?
    e.g.
    toplink.jpa.connection.ping = "select 1 from dual";
    regards,
    Hans

    Hans,
    There is nothing built in but you can use an ExceptionHandler to handle failures and re-connect connection. This is typically only an issue when using TopLink's internal connection pooling. It is more common in a container to use its data sources and rely on them to handle connection management.
    Doug

  • Toplink JPA and handle to a sequence

    Hi All,
    I am trying to figure out a way to get a handle to an Oracle sequence and use it from the java application i.e. run operations like currval/nextval.
    The reason I need this flexibility is to refer 2 sequences from the java app and apply it on a single table. Currently the table i am trying to insert already has a sequence which is a primary key generator. We do refer it in our JPA annotations and this works fine.
    But there was a need where another column (not part of Primary key) also needs its values from a different sequence.
    When we try to refer it from Toplink JPA it does not allow and errors stating cannot have 2 sequences mapping for a single table entity.
    Let me know your thoughts.
    Thanks

    You could use a native SQL query to get the nextval or curval from the Sequence.
    TopLink/EclipseLink should support an API for this, or allow multiple sequences per object, please vote for these bugs,
    https://bugs.eclipse.org/bugs/show_bug.cgi?id=267701
    https://bugs.eclipse.org/bugs/show_bug.cgi?id=320456
    James : http://www.eclipselink.org

Maybe you are looking for

  • Download Creative suite apps on 2 computers, got rid of one and need to download on new computer

    help I got a new computer and I got rid of my old one that I had downloaded some of the creative suite on now I need to download it on my new computer and I can't because I have downloaded it on 2 computers, but I no longer have one of them and I uni

  • Excel File to Internal Table

    Hi, I need to export the content of a excel file to an internal table. I looked for it and I found some samples. But they opened the excel file. My excel file comes from upload and I have it in a xstring variable. The functions for excel expect for a

  • How to install Adobe Illustrator 7.0?

    Could you tell me please? I purchased one old Adobe Illustrator 7.0.  I tried to install it on Mac mini, but it did not.  I clicked to start the install, but one window cam out on moniter as follow: "You can't open the application "Install Adobe Illu

  • Win 7 32 bit Adobe PDF preview handler issues (NOT 64 bit issue)

    No previews available in Outlook or Explorer (for documents in folders). Investigation shows the Vista preview handler installed.  repeated reinstall of Reader changes nothing. Attempts to use the registry hack provided on several sites for W7 64 do

  • Proper cable for using Target Disk Mode

    I want to use TD mode to see whether I can get any access to the internal hard drive on my early 2009 iMac, using a 600 Mhz G3 iMac (CRT) as the host. The newer machine, the target, has a Firewire 800 port, and the old G3 has a Firewire 800 port - wh