Tpinit and tpterm in multithreaded environment

Hello,
I have a question about the way a Tuxedo WS client allocates and releases connections
to Tuxedo server in a muti threaded environment. I call once tpinit() with the
TPMULTICONTEXTS flags set ( I guess somme system resources are allocated) . I
get the current context 'cc' calling tpgetcontext(), I communicate it to another
thread so that it could talk with tuxedo server through this context. Next I call
tpterm(), the current thread is set into the state TPNULLCONTEXT. But i noticed
that any other new threads are able to REuse the former 'cc'.... does tpterm()
release the system resources that are associated with the connection 'cc' ? it
looks like it doesn't . How can i totally invalidate the former current context
'cc' ?
Thanks..
Cryo

Are you saying that after doing tpterm, your connection stays open, and
threads can still do tpcalls on that context?
Tpterm should be dropping the connection.
Make sure that you are running the latest patch level.
     Scott Orshan
Cryo wrote:
>
Hello,
I have a question about the way a Tuxedo WS client allocates and releases connections
to Tuxedo server in a muti threaded environment. I call once tpinit() with the
TPMULTICONTEXTS flags set ( I guess somme system resources are allocated) . I
get the current context 'cc' calling tpgetcontext(), I communicate it to another
thread so that it could talk with tuxedo server through this context. Next I call
tpterm(), the current thread is set into the state TPNULLCONTEXT. But i noticed
that any other new threads are able to REuse the former 'cc'.... does tpterm()
release the system resources that are associated with the connection 'cc' ? it
looks like it doesn't . How can i totally invalidate the former current context
'cc' ?
Thanks..
Cryo

Similar Messages

  • Best way to generate an incrementing ID in multithreaded environment

    Hi
    I have a "best practice" kind of question.
    I need to insert a record in an Oracle table where primary key is an incrementing numeric ID. In order to insert a new record, first i need to figure out what the maximum ID is and then increment it.
    In a multithreaded environment, this can cause an error when, let's say, there are 2 threads, and each one is simultaneously querying the table for the max ID. Each query will return the same result and hence only 1 query will succeed at inserting the new record. The second insert will cause a primary key conflict when trying to execute.
    Is making the code synchronized the best solution in this situation or is there a better way?
    Thanks in advance.

    Hi,
    using Oracle sequence could be easy and effective, just insert sequence.NEXTVAL into the particular column. Oracle should take care of possible conflicts, it should always provide different (means incremented) value.
    I dont recommend using agregate function MAX(column).
    Good luck,
    Rgds
    Miroslav

  • C++ stringstream in multithreaded environment

    We are using a lot of stringstream objects in multiple locations in our code. The objects are not shared across threads but still program crashes in multithreaded environment. The investigation shows that the program crashes when we use both insertion & extraction operators (stringstream ::operator << and stringstream ::operator >> ). The program crashes at random locations, always pointing to stringstream in our code. We receive SIGBUS, or SIGSEGV or (sometimes) SIGABRT signals.
    We need to know how to use stringstream in Multithreaded environment.
    Any help will be highly appreciated.
    Versions:
    Compiler Version: CC: Sun C++ 5.9 SunOS_sparc Patch 124863-05 2008/06/03
    Machine: SunOS bear 5.10 Generic_127111-11 sun4u sparc SUNW,Sun-Fire-V490
    /usr/lib/sparcv9/libCstd.so.1: Sun SUNWlibC SunOS 5.10 Patch 119963-08 2006/09/20
    Following is the test program (creates 20 threads & does insertion-extraction) & Makefile below it.:
    {color:#0000ff}#include <string>
    #include <sstream>
    #include <pthread.h>
    #include <thread.h>
    #include <vector>
    using namespace std;
    extern "C" void* ThreadFunc( void* p )
    for(int i=0 ; i < 1000000 ; i++){
    string str("dummy");
    stringstream buf;
    buf << "Dummy Data " << i ;
    buf >> str;
    return NULL;
    int main (int argc, char** argv)
    try {
    pthread_t thread;
    vector<pthread_t> threads;
    for(int i=0; i < 20 ; i++) {
    pthread_create(&thread, NULL,ThreadFunc, NULL);
    threads.push_back(thread);
    int rc;
    void* status;
    for(int t=0; t < 10; t++) {
    rc = pthread_join(threads[t], &status);
    if (rc) {
    // cout << "ERROR in joining thread " << threads[t] << endl;
    return (-1);
    //cout << "Completed joining thread " << threads[t] << " with status " << (long)status << endl;
    } catch (...) {
    //cout << "some exception\n";
    return 0;
    {color}
    ////////Makefile/////////////
    {color:#ff00ff}CC=/appl/toolbox/studio12-July08/SUNWspro/bin/CC
    CPP =${CC} -m64 -mt -xarch=sparcvis2 -g
    OFILES = ${SOURCE:.cpp=.o}
    PROG = stringstreamtest
    SOURCE = main.cpp
    {color}
    {color:#ff00ff}${PROG}:${OFILES}
    ${CPP} ${OFILES} -o $@
    %.o:%.cpp
    ${CPP} -c $< -o $@
    {color}
    {color:#ff00ff}clean:
    ${RM} *~
    ${RM} *.o
    ${RM} -r ${PROG}
    ${RM} -f .make.state
    .KEEP_STATE:{color}

    The stringstream class is thread-safe, but you must provide your own guards around string and stream objects that are shared among threads. That is, the library provides internal guards that you could not provide yourself, but if two threads modify the same string object (or any non-atomic object, for that matter) at the same time, the results are unpredictable.
    You have a rather old version of libCstd on your system. Please update to the current SUNWlibC patch
    sparc: 119963-12
    x86 : 119964-12
    You can get the patch from [http://sunsolve.sun.com]
    Some other things to check:
    Be sure that libCrun and libCstd are linked only as shared (.so) libraries, and not as archive (.a) libraries.
    Do not use the linker -Bsymbolic option when creating shared libraries - it can cause program crashes particularly when using the string class.
    Do not use -xarch=v8 or -xtarget=v8 options, since it can cause loss of thread synchronization when running on current architectures. (The v8 architecture dates from before the UltraSPARC was introduced in the mid 1990's.)
    Finally, you should check your code for the usual programming errors that can lead to crashes:
    - using an invalid pointer
      - uninitialized
      - dangling (points to object that no longer exists)
      - incremented or decremented outside object bounds
      - points other than to an object start address
    - deleting an object more than once
    - reading or writing outside object bounds
    - failing to guard shared object in multi-threaded code
    - race condition in multi-threaded codeThe program failure usually occurs far away in space and time from the
    actual error.
    These errors do not always lead to a program crash. An invalid pointer
    might sometimes by accident point to a harmless location. A race
    condition can go millions of cycles without causing a problem. Access to
    a deleted object can succeed by accident if the memory was not re-used.
    Any change in program code or compiler options can turn one of these
    programming errors into an actual failure, or the other way around.
    Try running the program under dbx with Run-Time Checking enabled. RTC
    will find many of these errors. In Sun Studio 12, the Thread Analyzer
    tool will find race conditions.

  • Question about security context in multithreading environment

    I have a need to make concurrent calls to multiple EJBs in parallel threads. Let's
    say I establish the security context once by creating an InitialContext with given
    security principal and credential. With the security context active, I spawn multiple
    threads from the current thread and in each of those threads I make a call to
    a secure EJB method, which my security principal is allowed to access. My question
    is, will the same security context be established in each of the spawned thread
    so that my EJB calls succeed? For various reasons it's not feasible to login in
    each of the spawned threads, only to login once from the main thread.
    I tried this with WebLogic 6.1sp3 and it seems to work as expected. However, I
    have not been able to find any documentation on how security contexts are propagated
    to spawned threads. All I could find was a statement that when an InitialContext
    is created, the corresponding security context becomes associated with the current
    thread.
    My concern is that even though it works in WebLogic 6.1, it may no longer work
    the same way in WebLogic 7.0 or later. And will it work when the JNDI login mechanism
    is replaced by JAAS? If any WebLogic/security guru out there could give me some
    info on how WebLogic security contexts work in a multithreaded environment, I
    would be much obliged.
    Thanks in advance!
    Minh-Tue Vo

    "Minh-Tue Vo" <[email protected]> wrote in message
    news:[email protected]..
    >
    \> My concern is that even though it works in WebLogic 6.1, it may no longer
    work
    the same way in WebLogic 7.0 or later. And will it work when the JNDIlogin mechanism
    is replaced by JAAS? If any WebLogic/security guru out there could give mesome
    info on how WebLogic security contexts work in a multithreadedenvironment, I
    would be much obliged.
    With the JAAS model, you should be able to get a subject once and then do a
    runas in the spawned threads.

  • Using directory session in a multithreaded environment

    Hi,
    We are trying to use a directorySession object of PAPI for creating participants dynamically but it fails if we use it in a multithreading environment. Is there any limitation on using the directory session in a multithreading enviroment?

    Did you figure out how to do this? We ended up having to track the number of sessions using the service and close it only when there were none. However, this did not solve the problem completely. There seems to be a conflict when running our servlet app (which uses PAPI) on different machines talking to the same BPM. A thread on one machine opens, uses, closes a session and service while a thread on another machine opens a session and in the middle of using it, it dies.

  • Activating javacorba client on Multithreaded environment

    Hi,
    I have a java corba client communicating C++ corba server. This java corba client gets activated in multithreaded environment (i.e. multiple threads try to communicate with C++ corba server using this java corba client simultaniously).
    This java client starts the transaction using TransactionCurrent object before sending data corba server.
    I am getting an error for the mentioned code below code:
    tran_curr_oref =
    bootstrap.resolve_initial_references("TransactionCurrent");
    org.omg.CORBA.NO_PERMISSION: vmcid: 0x54555000 minor code: 1019 completed: Maybe
    at com.beasys.Tobj_BootstrapRemote.resolve_initial_references(Tobj_BootstrapRemote.java:615)
    at com.beasys.Tobj_Bootstrap.resolve_initial_references(Tobj_Bootstrap.java:243)
    at com.dhl.emea.javacorbaclient.PEVWrapperClient.TuxSend(PEVWrapperClient.java:188)
    at com.dhl.emea.javacorbaclient.CreateThread.run(CreateThread.java:78)
    at java.lang.Thread.run(Unknown Source)
    Now My question is
    1) Can i have multithreaded java clients with each thread activating seperate transactions?
    2) Is there any work around so that i instantiate TransactionCurrent object once and the remaining threads use the same object to start and stop the transaction?
    Any help on this appreciated.
    Thanks and Regards
    Prashanth

    Hi Prashanth,
    Assuming you are using a remote CORBA/Java client to communicate with Tuxedo, then you are most likely using IIOP to communicate with the Tuxedo ISL/ISH. In this environment, you only have a single connection to Tuxedo and the ISL only allocates a single client context for your connection. As a result, even though your client may be multi-threaded, all threads are going to share the same connection and the same context including transaction and security context. The reason for this is that Tuxedo uses a delegation model and delegates security and transaction contexts to the ISL.
    If you use another Java ORB other than the Tuxedo Java ORB, you might be able to get it to open a separate connection to Tuxedo for each thread and thus each thread could have it's own Tuxedo security and transaction context in the server. But this would be at the cost of a connection per client thread which may create way to many connections to Tuxedo.
    If your code is running inside WLS and you are using WTC, then you can have a unique transactions and security context per thread.
    Regards,
    Todd Litle
    BEA Tuxedo Engineering

  • What is the procedure to stop and restart the Hyerion Environment

    Hi All,
    Can you kindly let me know whether the procedure that i am following below is correct to stop and restart the Hyperion Environment.
    To Stop:
    1) Essbase.
    2) Shared Services.
    3) BI+ (Financial Reporting)
    4) Planning.
    5) DB2
    To Start:
    1) DB2
    2) Shared Services.
    3) BI+ (Financial Reporting)
    4) Hyperion Planning.
    5) Essbase.
    Is the above procedure correct or do i need to do any changes to it.
    Regards,
    Krishna.

    Hi,
    I guess restarting database is not required during the process of restarting Hyperion Environment. Below order is preferable.
    Stop:
    1) Essbase Administration Services
    2) Planning
    3) BI Plus Web Apps (Workspace, Web Analysis,..)
    4) BI Plus (core)
    5) Foundation Services (License services, shared services)
    Start:
    1) Foundation Services (License services, shared services)
    2) BI Plus (core)
    3) BI Plus Web Apps (Workspace, Web Analysis,..)
    4) Essbase Administration Services
    5) Planning
    Regards,
    Sreemani

  • Difference between Reboot and Shutdown in WinPE environment ???

    Hi,
    Whats are the difference's between Reboot and Shutdown in winpe environment ? and how it affects drivers mainly the drivers which needs to flush buffers on persistent media ? do they get chance to flush things and close gracefully ??
    Thanks 
    Anant

    Hello,
    The Windows Desktop Perfmon and Diagnostic tools forum is to discuss performance monitor (perfmon), resource monitor (resmon), and task manager, focusing on HOW-TO, Errors/Problems, and usage scenarios.
    Since your post is off-topic, I am moving it to the
    off topic forum.
    Karl
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book:
    Windows PowerShell 2.0 Bible
    My E-mail: -join ('6F6C646B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

  • How to configure ENV and DB for multithreaded application?

    Hi,
    From document, I know DB_THREAD must be checked for both ENV and DB, but , I don't know which one is best choice for multithreaded application while facing DB_INIT_LOCK and DB_INIT_CDB. In my application, there maybe multi readers and writers at the same time, should I use DB_INIT_LOCK instead of DB_INIT_CDB? what other flags should I use?
    DB_INIT_CDB provides multiple reader/single writer access while DB_INIT_LOCK should be used when multiple processes or threads are going to be reading and writing a Berkeley DB database.
    Thanks for your seggestions and answers.

    Thanks for the explanation,
    The Berkeley DB Concurrent Data Store product
    allows for multiple reader/single writer access
    to a database. This means that at any point in time,
    there may be either multiple readers accessing a
    database or a single writer updating the database.
    Berkeley DB Concurrent Data Store is intended for
    applications that need support for concurrent updates
    to a database that is largely used for reading.
    If you are looking to support multiple readers and
    multiple writers then take a look at the Transactional
    Data Store product
    (http://download.oracle.com/docs/cd/E17076_02/html/programmer_reference/transapp.html)
    In this case the Environment is typically opened with:
    DB_INIT_MPOOL, DB_INIT_LOCK, DB_INIT_LOG, and DB_INIT_TXN.
    Let me know if I missed any of your question.
    Thanks,
    Sandra

  • Building the mod_jk between apche and jboss in solaris environment

    hi there,
    i have installed apache2 and running on one zone and jboss installed and running on another zone
    now when i connecting of them using the tomcat connector by building the mod_jk i am getting the error where i have followed the procedure in the following link:
    http://blogs.sun.com/shanti/entry/building_mod_jk
    from the above link i have downloaded the source and set the path and then when i am running the file which i have saved then i am getting the below error:
    ./configure --with-apxs=/usr/local/apache2/bin/apxs
    checking build system type... i386-pc-solaris2.10
    checking host system type... i386-pc-solaris2.10
    checking target system type... i386-pc-solaris2.10
    checking for a BSD-compatible install... scripts/build/unix/install-sh -c
    checking whether build environment is sane... yes
    checking for gawk... no
    checking for mawk... no
    checking for nawk... nawk
    checking whether make sets $(MAKE)... yes
    checking for test... /usr/bin/test
    checking for rm... /usr/bin/rm
    checking for grep... /usr/bin/grep
    checking for echo... /usr/bin/echo
    checking for sed... /usr/bin/sed
    checking for cp... /usr/bin/cp
    checking for mkdir... /usr/bin/mkdir
    need to check for Perl first, apxs depends on it...
    checking for perl... /usr/bin/perl
    could not find /usr/local/apache2/bin/apxs
    configure: error: You must specify a valid --with-apxs path
    if any body has encountered such a problem please give me the reply
    thank you for all

    hi o.bogosavljevic
    yes i am using that package only
    what might be the path of the aspx

  • How to change DB name and SID in RAC environment?

    I have 2 node RAC on Red Hat Linux, EL 4, upd. 4. It's using ASM
    and it is working great. However, after 2 years of faithful service
    I was asked to change DB name and SID. In non-RAC environment, that is
    easy. Rename a few files, change init.ora and re-create control file.
    I've done that many times. With 10g RAC, however, situation is different. There is also RAC registry which has the database under the certain name and, I believe, it also has SID registered. Can you, please, point me to a document describing how to do that? It's a production DB and I can't test it anywhere.

    It's in the manual:
    http://download.oracle.com/docs/cd/E11882_01/server.112/e17023/dbresource.htm#i1029540
    Larry

  • How to create odbc (dsn) connection for OBIEE AND INFOR in unix environment

    Hi,
    we are establishing OBIA in Unix environment we set all the things fine but we are getting problem how to create ODBC connection
    for INFORMATICA AND OBIEE. I searched some blogs thats telling there is a ODBC.INI file we need to configure.
    but i am not getting clear idea to give parameters and it will not showing any TNSNAME ..........etc
    please any body give clear idea about how to create ODBC connection and LOCATION of that file AND parameter which i need to give.
    Thanks,
    charan....

    Hi Dpka,
    yah i already checked that one but i have not find out any parameter for TNS NAME information.
    is OBIEE connected to ORACLE DATA BASE without giving TNS information?............in UNIX OPERATING SYSTEM.
    pls give me the clear idea abt how to connect OBIEE, INFORMATICA to ORACLE DATA BASE IN UNIX ENVRNMENT
    thanks,
    charan.

  • Installation and deployment of operating system, applications and patches in Unix environment

    Is it possible to use Configuration Manager 2012 (or 2012 R2) to perform remote installation of operating system, applications and patching in a Unix environment?
    Balaji Kundalam

    ConfigMgr does not support Operating System Deployment for non-Windows OS flavors.
    You can use the ConfigMgr client on a Unix device to install applications and to instruct the device to install patches. Basically, the client will download files and run a script against them.  If there is a patch manager in your flavor of *nix, you
    can run a script to install the patches.
    See the supported operating systems here:
    http://technet.microsoft.com/en-us/library/gg682077.aspx#BKMK_SupConfigLnUClientReq
    I hope that helps,
    Nash
    Nash Pherson, Senior Systems Consultant
    Now Micro -
    My Blog Posts
    If you've found a bug or want the product worked differently,
    share your feedback.
    <-- If this post was helpful, please click "Vote as Helpful".

  • Is it possible to export user settings and import into same environment?

    Hi guys,
    I exported a user profile settings into a file and triedd to import saved file into same environment where I exported, but I am getting following error
    "Login name already in use"
    I followed the same process for restoring groups.Exported groups into a file and imported saved file into same environment, I was successfully restored thr groups.But I am failing to restore the user settings.
    Any help or suggestions on this issue is greately appreciated.
    Thanks in advance!

    Importing into the same environment is not supported.
    Instead, you could create all the test users in production with all the roles and then deactivate the user, so they are not usable.
    After you overwrite the non-production DBs with the production DB, you could then run a script (you will have to create it first) to activate all the users.
    Will this work for you?
    Segal

  • How to Determine BHCA and ACH in UCCX Environment v8.5.1

    Hi,
    I need to calculate the busy hour call attempts and average call handle time in a UCCX environment.
    I know for a UCCE you can simply run a SQL query, but I am having trouble with the UCCX.
    UCCX version is 8.5.1
    Thank you, 

    "The Traffic Analysis Report shows information related to any call that hits Unified CCX. In that sense, it is an accurate reflection of BHCA (Busy Hour Call Attempts).
    To get the BHCC (Busy Hour Call Completion) from Unified CCX perspective, we need to calculate BHCA - (all aborted calls + all rejected calls). The Aborted and Rejected Call Detail Report can help retrieve that information."
    http://docwiki.cisco.com/wiki/Which_reports_should_be_used_to_determine_BHCA_and_BHCC%3F

Maybe you are looking for

  • Sales order credit block - No credit master data maintain

    Hi , I have a sales order blocked for credit check. But i have not maintain any credit master data for this customer. Customer and payer is same. I want to know why credit check is carried out for this customer and what basis system carry out credit

  • Require Help on using Roll Up in Query

    I have a list of records like: COL1 COL2 COL3 COL4 COL5 COL6 COL7 ABCGENCY GBP 670 123 6/20/2008 7/21/2008 0162101 BBAGENCY USD 108 347 9/26/2008 5/11/2008 0722102 BBAGENCY EUR 630 999 1/14/2008 2/27/2008 0763104 ABCGENCY THB 400 697 4/12/2008 7/14/2

  • Need a solution in E Recruitment

    Dear All,      I am using the two different stand alone system for the E recruitment and HR system. When i am raising the Requisition the object is getting created in the E recruitment instance without any problem(Extended Requisition Request). There

  • Screen size for existing recorded captivate

    How do I find out what the screensize is set to be on an existing captivate session?  I have Captivate 5.

  • Hi. Quick question I am working with Panasonic GH3 footage and it is playing back in slow motion?

    Hi. Quick question I am working with Panasonic GH3 footage shot using .MOV wrapper with their IPB 50mbps and All-Intra 72MBPS codecs and they are playing back in slow motion in Sg CC. The footage works fine in PP CC and I have no clue on how to fix i