how to set connection timeout for a non accessable webservice - weblogic.developer.interest.webservices.general(Archived)

Hi,
I call a webservice from my code and I encountered a problem when the webservice I call is not accessable (e.g. wrong configuration/firewall problem ...).
Currently I get a exception after a 'long time' (about 3 minutes).
But after this time MY CLIENT already got ITS timeout (30 seconds).
The idea was to decrease the 3-minute timeout.
I found
http://e-docs.bea.com/wls/docs100/webserv/client.html#wp228628
with the property "weblogic.wsee.transport.connection.timeout".
But I have a problem to set the property.
Basically I do three steps:
line 1: PgiServiceActionService_Impl service =
new PgiServiceActionService_Impl(ATOS_PGI_WEBSERVICE_URL);
line 2: PgiServiceAction service_action = service.getPgiService();
line 3: service_action.pgiServiceRequest(req);
I already get the the timeout in line 1. How can I avoid to wait 3 minutes until I get the exception ? 

I found the solution to my problem. I do now:
     System.setProperty("weblogic.webservice.UseWebLogicURLStreamHandler","true");
     PgiServiceActionService_Impl service = new PgiServiceActionService_Impl();
     PgiServiceAction service_action = service.getPgiService();
     
     ((Stub)service_action)._setProperty("weblogic.wsee.transport.read.timeout",     MY_READ_TIMEOUT);
     ((Stub)service_action)._setProperty("weblogic.wsee.transport.connection.timeout", MY_CONNECT_TIMEOUT);
     ((Stub)service_action)._setProperty("javax.xml.rpc.service.endpoint.address", MY_PGI_WEBSERVICE_URL);

Related

ORA-02048: attempt to begin distributed transaction without logging on

Hello,
I've got the error:
ORA-02048: attempt to begin distributed transaction without logging on
When calling OCITransStart
(The XID of the transaction to start is:
formatID = 11101, gtrid = 123, bqual = 1
I've already run several queries before trying to call
OCITransStart and the queries are successfull.
Could anyone help please ?
I'm running Oracle 10g on Linux.
Thanks a lot
Laurent Marzullo 
I believe this is the error you see if the client database name is not set prior to calling OCISessionBegin. To set the client database name, use OCIAttrSet on the server handle with the OCI_ATTR_EXTERNAL_NAME and OCI_ATTR_INTERNAL_NAME attributes.
These attributes are discussed in chapter 8 of the OCI Programmer's Guide in the section "OCI Support for Transactions".

Query Documents (cards) or Folders- Token timeout

I am writing an utility to get details of all the card in portal (30000+ cards). this utility is run as a job for External Operation.
I am passing the security_token from the job to connect using server API Session.Reconnect.
However, after some time (30-40 minutes) of utility run, API to open a card property throws an error
com.plumtree.server.marshalers.PTException: -2147205120 - Error in function PTBaseObjectManager.Open (nObjectID == 0, bLockInitially == false): -2147205120 - Error: object with ID 0 and class id 36 does not exist.
However this piece had worked for other cards whose details have already been collected.
Is this a session timeout problem? Is the <security_token> from job comes a life time span of say 40-50 minutes and can be increased programatically ?
Please help
The security token used in external operation does expire after 5 seconds, however I don't think that's the problem. The message "object with ID 0 and class id 36" indicates that a card property(class id 36) does not exist. What looks really suspicious is that it's object id is 0. I think the problem might be with the particular query that's being executed - a card id is not set.

Logon Request X was abandoned after XXXX ms. (SBL-JCA-00303)

We are intermittently (but happening very often) getting this exception when trying to Update a table through Siebel Data Bean. This is occurring only in Production environment and is not happening in any other environment.
<Major No.>256</Major No.><Minor No.>8716591</Minor No.><Message>Logon Request 10 was abandoned after 9751 ms. Connection: 60a03ebf due to connection shutdown request Connection reset(SBL-JCA-00303)</Message><DetailedMessage>Unknown<DetailedMessage>
</Exception>
at com.siebel.data.SiebelDataBean.login(SiebelDataBean.java:224)
The siebel.properties file has the following values:
siebel.conmgr.sesstimeout = 3600
siebel.conmgr.poolsize = 15 (tried with 20, 30 , 50 also, but was of no help)
We cross checked the firewall rules and found that every thing is fine.
Could you please help us in resolving this issue?

EAIObjMgr misconfigured generates client timeout

Sometimes on my production system, the EAI OM is spending too much time in the process "SessHello" (01min 46sec in the following exemple).
At the client side, on the sweapp, this delay it is too long, it causes a socket timeout :
SisnTcpIp SisnSockError 1 000001ec4ef420ec:0 2011-12-23 10:39:47 5920: [TCPIP-client] recv() failed for sd=2596 (err=10060 | Connection timeout.)
When the EAI OM is ready to process, it detects that the client has timeout, so the connection closes prematurely.
MessageFlow MsgFlowDetail 4 0002e7764ef420ec:0 2011-12-23 10:38:01 21892: ProcessSessHello(1) Sent Session Hello Acknowledge for task 20972415, pConn = 0x132c40c0, pErrStack = 0x0d5a1d40
MessageFlow MsgFlowDetail 4 0002e7764ef420ec:0 2011-12-23 10:39:47 21892: ProcessMessage() worker will process 0x1492d948, pErrStack = 0x0d5a1d40
TaskEvents SessionClose 3 0002e7764ef420ec:0 2011-12-23 10:39:47 Client closed session (taskId = 20972415)
The two redundant EAI OM are configured with the following parameters :
MaxTasks: 800
MinMTServers: 2
MaxMTServers: 5
SessPerSisnConn: 5
ConnIdleTime: -1
Thanks for any help you can. 
I have set theses parameters :
- MinMTServers = 8
- MaxMTServers = 8
But the problem is not resolved.
Now, I have changed ConnIdleTime parameter on OMs to 1080 and the eapps.cfg SessionTimeout parameter to 960, the timeout parameter of the Alteon (load balancer) is 1200... 
There are various problems causing timeout of the client "[TCPIP-client] recv() failed", so I made a mistake :
- The first one : delay when opening a new task on EAI OM causing client timeout was resolved with MTServers parameters.
- The second one : client timeout after load balancing delay was resolved by setting corrects timeouts on OM/SWSE/Alteon.
Now I have a third problem with Sisnapi open session timeout (SBL-SSM-00005) but the original problem is solved.
Thank you!

DRCP with cx_Oracle doesn't appear to work as expected

I'm trying to use DRCP in Oracle 11.2 with a Python client using cx_Oracle 5.1.2. If I create the connection by calling cx_Oracle.connect and adding a cclass argument and a purity argument, then the record in sys.v_$cpool_cc_stats with cclass_name set to my cclass will show an increase in num_requests and num_misses corresponding to the number of calls I make, with num_hits staying at 0. connection = cx_Oracle.connect(user=db['USER'], password=db['PASSWORD'], dsn=db['NAME'], cclass=db['OPTIONS']['CCLASS'], purity=cx_Oracle.ATTR_PURITY_SELF) If however I create an instance of a cx_Oracle.SessionPool, then pass that instance into the same cx_Oracle.connect call as an extra 'pool' argument, then num_misses goes up by 1, and num_hits goes up by num_requests - 1 (I assume this means the first request is a new connection, all the rest are using that connection). pool = cx_Oracle.SessionPool(user=db['USER'], password=db['PASSWORD'], dsn=db['NAME'], min=1, max=2, increment=1)connection = cx_Oracle.connect(user=db['USER'], password=db['PASSWORD'], dsn=db['NAME'], pool=pool, cclass=db['OPTIONS']['CCLASS'], purity=cx_Oracle.ATTR_PURITY_SELF)Is this correct?  Do I need to be creating a SessionPool client side, then using that to acquire and release connections? This article doesn't mention SessionPool at all.  I came across SessionPool in this post, but that isn't official documentation. FWIW, when I run select * from dba_cpool_info, I get the following: "CONNECTION_POOL""STATUS""MINSIZE""MAXSIZE""INCRSIZE""SESSION_CACHED_CURSORS""INACTIVITY_TIMEOUT""MAX_THINK_TIME""MAX_USE_SESSION""MAX_LIFETIME_SESSION""SYS_DEFAULT_CONNECTION_POOL""ACTIVE"44022030012050000086400
I believe you will need to create a session pool.Can you post a complete code snippet using cx_Oracle.SessionPool that exhibits the behavior you see?
I've written the following script to help demonstrate.  It requires python 3.  If you only have python 2, then it must be at least 2.5 (as it uses contextlib.contextmanager) and you will have to change all the print function calls to print statements (if you have python 2.6, you can add from future import print_function as print, although I haven't tested this). When running the script, once with the SessionPool, and once without, I have the following records in sys.v_$cpool_cc_stats:"CCLASS_NAME""NUM_REQUESTS""NUM_HITS""NUM_MISSES""NUM_WAITS""WAIT_TIME""CLIENT_REQ_TIMEOUTS""NUM_AUTHENTICATIONS""DEV_DRCP.WITHOUT_POOL"10001006200100"DEV_DRCP.WITH_POOL"1008812000100 The script requires 2 arguments, the DSN and USER, and has an optional argument --pool which if included will use a SessionPool.  Example usage (assuming code is saved to file test_drcp.py, my_drcp_db is the TNS entry referring to an Oracle database with DRCP started, and some_user is a user with read access in that database: ./test_drcp.py my_drcp_db some_user./test_drcp.py --pool my_drcp_db some_user Copy the following code to a file, modify the #! to point to the python interpreter in an environment with cx_Oracle, and make sure it's executable. #! /home/john/envs/drcptest/bin/python import osimport timeimport argparsefrom getpass import getpassfrom contextlib import contextmanager import cx_Oracle  #contextmanagerdef oracle_db(use_pool, dsn, user, password):    if use_pool:        pool = cx_Oracle.SessionPool(            user=user, password=password, dsn=dsn, min=1, max=2, increment=1)        connection = cx_Oracle.connect(            user=user, password=password, dsn=dsn, pool=pool,            cclass="WITH_POOL", purity=cx_Oracle.ATTR_PURITY_SELF)    else:        connection = cx_Oracle.connect(            user=user, password=password, dsn=dsn, cclass="WITHOUT_POOL",            purity=cx_Oracle.ATTR_PURITY_SELF)    cursor = connection.cursor()    try:        yield cursor        connection.commit()    except cx_Oracle.OracleError:        connection.rollback()    finally:        cursor.close()        if use_pool:            pool.release(connection)        else:            connection.close()  def run_query_and_sleep(use_pool, dsn, user, password):    print('> Starting {}'.format(os.getpid()))    with oracle_db(use_pool, dsn=dsn, user=user, password=password) as cursor:        print('> Querying {}'.format(os.getpid()))        cursor.execute("select to_char(systimestamp) from dual")        print(cursor.fetchall())    print('> Sleeping {}'.format(os.getpid()))    time.sleep(10)    print('> Finished {}'.format(os.getpid()))  def main(*args, **kwargs):    for x in range(100):        pid = os.fork()        if not pid:            run_query_and_sleep(**kwargs)            os._exit(0)  if __name__ == '__main__':    parser = argparse.ArgumentParser('Test connection pooling with Oracle DRCP')    parser.add_argument('dsn', help='TNS entry to use')    parser.add_argument('user', help='Username to use for the connection')    parser.add_argument('--pool', action='store_true', help='Use session pool')    args = parser.parse_args()    password = getpass('Enter password for {}> '.format(args.user))    main(use_pool=args.pool, dsn=args.dsn, user=args.user, password=password)
The first way of connecting to drcp has a bug and fix will be added soon.The second connection using SessionPool is showing expected results. In both the cases the behaviour should be the same. NUM_HITS should go up and NUM_MISSES should not increase if purity self and connection class are used to connect to the DB.
Thank you for taking the time to read this thread.  Is it a bug in cx_Oracle?  Do you have a link to the ticket associated with the bug you can share?  
Yes, it is a bug in cx_Oracle and a fix is in progress.It has been reported in a different context (fix is the same) here: https://bitbucket.org/anthony_tuininga/cx_oracle/issue/2/use-of-cclass-causes-connection-leaks
Anthony just merged Avinash's first fix: https://bitbucket.org/anthony_tuininga/cx_oracle/commits/58eec36e9c1d108eff784d31aa64f9d345c08190Avinash is continuing to look at some edge cases/leaks.
To followup, the leak appears to be in the Oracle 12.1.0.1 client library.  It was not seen with 11.2 or 12.1.0.2 client libraries.

Categories

Resources