Set Timeout in TopLink JPA

Hi
I am using a standalone JPA application with Toplink
I need to implement a timeout feature
But I do not find any options for setting the timeout in any of
javax.persistence.EntityManager;
javax.persistence.Query etc
nor do i find any property that I can add in the persistence.xml
My persistence.xml is as below
<persistence-unit name="CHN" transaction-type="RESOURCE_LOCAL">
<provider>
     oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider
</provider>
<class>com.TestJPA</class>          
<properties>
     <property name="toplink.jdbc.driver"
value="oracle.jdbc.driver.OracleDriver" />
     <property name="toplink.jdbc.url"
     value="jdbc:oracle:thin:@localhost:1521:XE" />
     <property name="toplink.jdbc.user" value="JEN" />
     <property name="toplink.jdbc.password" value="JEN" />
</properties>
</persistence-unit>
Thanks
lad

Unfortunately, the eclipselink.jdbc.timeout hint is only in EclipseLink. If you are using TopLink Essentials, the only query hints available are in the oracle.toplink.essentials.config.TopLinkQueryHints class and does not include the jdbc timeout. If you cannot upgrade/migrate to EclipseLink, you can set it directly using the DatabaseQuery.setQueryTimeout() method. You will need to cast the EJBQuery and get the underlying TLE query:
((oracle.toplink.essentials.ejb.cmp3.EJBQuery)jpaQuery).getDatabaseQuery().setQueryTimeout(yourIntValue);
jpaQuery.getResultList();
Best Regards,
Chris

Similar Messages

  • 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

  • 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 - trailing spaces on Char column

    Gurus,
    In JDBC you use the following to ignore trailing spaces when querying on Char column:
    OracleConnection conn = (OracleConnection) c;
    conn.setDefaultFixedString(true);
    How to achieve this using TopLink JPA?
    Thanks much,
    Nicky

    Nicky,
    I believe you would need to do this in API. Ideally setting these configurations on the properties of the JDBC connection pool is easier but if you wish to do it with TopLink Essentials I would use a session event listener's postAcquireConnection to customize it.
    In the persistence.xml you will need to configure your persistence unit to use a session customer like:
            <property name="toplink.session.customizer" value = "mypackage.JDBCConnectionConfig"/>Then you will need to implement this customizer and include it on the classpath of your application:
    public class JDBCConnectionConfig implements SessionCustomizer {
        public void customize(Session session) {
            session.getEventManager().addListener(new JDBCConfigEventListener());   
        class JDBCConfigEventListener extends SessionEventAdapter {
            public void postAcquireConnection(SessionEvent event) {
                Connection conn = ((DatabaseAccessor) event.getResult()).getConnection();
                OracleConnection oconn = (OracleConnection) conn;
                oconn.setDefaultFixedString(true);
    Note: I did not see setDefaultFixedString in the most recent version of the Oracle JDBC driver
    I would definitely look into configuring your data source's connection pool with this property enabled before adding this event listener.
    Doug

  • New Toplink JPA release?

    In another thread a fix was made to the Toplink JPA codebase.
    Toplink comes to a halt in the merge
    The question is how to get to the fix. The latest build on the website is 2b41 from March 2007! I cannot find a source access.
    How to get the latest Toplink JPA implementation?

    There are no converter related enhancements for TopLink Essentials. If you want advanced support in this area you'll need to move to either Oracle TopLink or EclipseLink. It's pretty easy to do.
    In TopLink Essentials you have the option to customize a basic mapping with your own converter. You declare the customizer in the persistence.xml, e.g.:
    <property name="toplink.descriptor.customizer.Book "value="example.toplink.BookCustomizer"/>And in your customizer you can plug in a Converter, e.g.:
    public class BookCustomizer implements DescriptorCustomizer {
        public void customize(ClassDescriptor descriptor) throws Exception {
            DirectToFieldMapping categoryMapping = (DirectToFieldMapping)
                      descriptor.getMappingForAttributeName("category");
            categoryMapping.setConverter(new BookCategoryConverter());
        }The converter you set on the DirectToFieldMapping (i.e., Basic) has to implement oracle.toplink.essentials.mappings.converters.Converter. In the converter you can do pretty much whatever you like including Integer/Boolean conversion.
    --Shaun                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Need help with Java SE TopLink JPA project

    I'd like to ultimately run an Oracle stored procedure (connecting to Oracle 10g DB) in my Java SE program. I want to use TopLink JPA (11g) and if possible, use sessions to manage things - i.e. I want to run a stored procedure (that doesn't return anything), then run a native query. Does anyone have a good example of this type of configuration?
    I've been able to get it working with plain ol' JPA via TopLink - i.e. my persistence.xml is fine. Obviously, JPA doesn't define stored procedures, so I need to set it up to use stored procedures. I tried setting up my sessions.xml file - I think it's OK. However, I think my project.xml file is incorrect - and I don't think I even really understand it. But I want a project.xml that is very simple - does anyone have a simple, bare-bones project.xml example. All I plan to do is run the occasional stored procedure and run native queries (for now).

    If all you want to do is create extra stored procedure queries then you might want to consider just creating a customizer and adding some queries there. Then you won't actually need to create a project at all.
    Use the toplink.session.customizer property described at:
    http://www.oracle.com/technology/products/ias/toplink/JPA/essentials/toplink-jpa-extensions.html
    and then add some queries to your session. To make it even easier, then just define your queries in JPA, and override the call in your customizer. For example, if you defined a JPA named query called "Employee.executeStoredProc" then in your customizer method you could have something like:
    public void customize(Session session) {
    DatabaseQuery query = session.getQuery(“Employee.executeStoredProc”);
    StoredProcedureCall call = new StoredProcedureCall();
    call.setProcedureName("employee_stored_proc");
    query.setCall(call);
    Then when you call your JPA query the stored proc will run.

  • Setting timeout for all the web test scripts in the solution

    Hello,
    I have around 16 web test scripts (using VSTS 2010 ultimate version) in my project (in a solution). By default the timeout set for each request is 60 sec. I need to increase the timeout to 180 sec. Currently, I am clicking on each request and modifying
    the timeout parameter from the Properties window.
    Is there any common setting for timeout available which would be acting across all the scripts?
    Thanks.

    Hello,
    We only can set Timeouts for a separate request in Visual Studio Web Test. There is no way to set Timeout for all requests in VS IDE. But you can write you own logic code using
    Timeout Property in a web test plugin to set Timeout for all requests in a web test.
    About how to write a web test plugin, please see:
    How to: Create a Web Performance Test Plug-In
    Best regards,
    Amanda Zhu <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support
    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

  • Setting timeout for webservice

    hello all,
    I have made client program to connect to a webservice using dynamic url, my problem is i am unable to set the timeout of the webservice if anybody knows please let me know. my code is as follows.
    WebServiceClient ann = testpackage.TestClassService.class.getAnnotation(WebServiceClient.class);
    try {
    testpackage.TestClassService service = new testpackage.TestClassService(new URL("MY URL"), new QName(ann.targetNamespace(), ann.name()));
    testpackage.TestClass port = service.getTestClassPort();
    String result = port.getUserTask("HELLO");
    System.out.println(result);
    } catch (MalformedURLException ex) {
    using this code how can i set timeout at client side
    thanks in advance

    hi there thanks for your reply but your solution didn't worked for me. may be because of mistake in my question explanation i will explain it again
    WebServiceClient ann = testpackage.TestClassService.class.getAnnotation(WebServiceClient.class);
    try {
    testpackage.TestClassService service = new testpackage.TestClassService(new URL("MY URL"), new QName(ann.targetNamespace(), ann.name()));
    testpackage.TestClass port = service.getTestClassPort();
    String result = port.getUserTask("HELLO");
    System.out.println(result);
    } catch (MalformedURLException ex) {
    using this code i am calling my webservice and the function "getUserTask" which give me some output in return.
    now, what situation i am facing is whenever i make a call to the above function and if RTO occurs after the call of the function then my application comes in to a hang mode situation. and i am unable to do anything untill the reconnection of the network occurs.Either i have to wait for the reconnection or i have to terminate my applicartion.
    My desire is, i should be able to set my timeout period of a web service request. if no reply comes in the given time period then i should be able to raise any message to the user.
    I think ihave made myself a bit more clear.
    thanks for your reply once again.

  • Setting timeout for SOAP requests in a webservice client

    I am trying to set the timeout for a synchronous SOAP request sent to a Web Service deployed on weblogic 8.1 SP2. I tried setting timeout thru bindinginfo setTimeout() and also javax.xml.rpc.Stub _setProperty(). Both of them seem to be not working. I set the value to as low as 1 sec but i still donot get a timeout. Other properties/method from these two classes work fine though (like endpointaddress property in javax.xml.rpc.Stub and setVerbose flag to true in BindingInfo).
    Can someone please help.
    Thanks in Advance
    srini

    Our application calls the webservice provided by another company over the internet using the ssl. We use the wsdl url of the webservice on the destination while creating the port. If the destination is not available statement which creates the port blocks for around 4 minutes.
    I think the first network call gets the wsdl from the remote server. Thus we encounter delays before getting the stub created. How can I timeout such a calls.
    try {
    port = (new ServiceName_Impl(remoteWsdlURL)).getServiceNameSoap();
    } catch (IOException e) {                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • 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

  • How to get remaining time for baton after setting timeOut property

    Hello,
    Is it possible to get the remaining time for baton after setting timeOut, or do I have to maintain a separate Timer for that?
    Been following this excellent tutorial here http://tv.adobe.com/watch/adc-presents/create-shared-forms-in-livecycle-collaboration-serv ice/

    Thanks Nigel, before reading your reply, I came up with something like this, but it seems extending the Baton class is not enough, as I would need my own BatonProperty as well that uses this extended Baton class...
    Also attempted to get some help here http://stackoverflow.com/questions/7116814/actionscript3-lccs-how-to-access-property-paren t-class-protected-var/7116882#7116882
    Could this be made into a feature request for Baton and BatonProperty, se we could easily get the remaining time please?   I guess I can wait for a future release.
    /custom as file /
    package com.mysite.BatonExtender
         import com.adobe.rtc.sharedModel.Baton;
         import flash.events.TimerEvent;
         public class BatonExtender extends Baton
              public function BatonExtender()
              super();
              _autoPutDownTimer.addEventListener(TimerEvent.TIMER,countDown);    
              trace("CURRENT TIMER:"+_autoPutDownTimer.currentCount);
              trace("BATONEXTENDER added");
              public function countDown(p_evt:TimerEvent):void {
                   trace("TRACING START countDown....");
                   if (_autoPutDownTimer.running) {
                        trace(_autoPutDownTimer.currentCount);
                        //sharedTimer.value = String(90 - _autoPutDownTimer.currentCount);
                   trace("TRACING END....");

  • Set timeout in JSP?

    Hi, is possible to set timeout in a JSP?? For instance, when the user clicks on the a hyperlink it will open a page and after a time interval, the page will auto close and call the same JSP function to open the same page but with different values in it...

    Hmm.. do u think it will work whereby the user will just need to click on a hyperlink once, then it will pass different value to a Javascript function each time. Coz the hyperlink that the user clicks will get the values from a text file (all the values retrieved are stored in a Vector.) which is passed to the Javascript function for loading an applet. As the applet will load some data out, hence, i need to wait till the applet finish loading, then i can call the same Javascript function again, but a different value...

Maybe you are looking for

  • Help!! System Failed.

    Hi, This happen when i boot up my comp this morning. Everything is fine until I click on Firefox. Error messages appear on the left hand side of the screen(very long code) and the fan went bonkers... Everything freezes. I reset the system by holding

  • Printing PS3 on Brother DCP6690CW

    Hi all! Thanks for reading this! Am really not sure whether this is the right forum for such a query... Getting straight to the point, my issue is the following: I am part of an organisation where we use an operating system called Advantage Windows (

  • Trying to move the Media Cache Folder

    I have the current version of Premiere Pro CC on OSX 10.9.4. I want to move my media cache files and media cache database folder from the default, USERS/LIBRARY/APPLICATION SUPPORT/ADOBE/COMMON to my external media scratch drive. I have changed this

  • Issue with the String return from com.sap.aii.af.mp.module.ModuleData

    Hi Friends, We are developing Adapter for XI using java, XI is giving String in the form of ModuleData, we r getting the String from ModuleData but in the logic we need to split the String in parts based on character '…', but I observed that in the c

  • How to continue the screen in Screen -painter?

    Hi friends can anybody help me out in knowing how to continue the fields in screen painter. For clear explanation i have got 20 fields to be entered in my form, but when i am going to layout of screen painter i have been able to accomadate only 12 th