Hanging on Multi-threaded DB Partition to Oracle -cnt'd

Hi All,
Thanks for everyones replies to my plaintive calls for help.
Our problem was a hang of the "OpenCursor" call during dynamic
sql execution from Forte 3.0.M.0 to Oracle on NT.
The most useful suggestions included:
* Check for Errors in the SQL
- no errors found. SQL works fine from other clients
* Transaction around the entire piece of code
- already there.
* Ensure that the following line is used:
self.Session.RemoveStatement(statementHandle=dynStatement);
- it was already there.
* Try turning on log flags
Useful Log flags that might be helpful are
trc:db:1 - Cursor operations
trc:db:1:100 - Vendor specific cursor operation tracing
trc:db:1:200 - Checking cursor queues, fetching rows, cursor count
- we still get stuck in the OpenCursor, with no useful
information shown to see where the thread is stuck.
* Increase Cursor Count in Oracle - this was shown
not to be a problem. We did a separate test opening cursors
without closing them, and indeed hit the Oracle cursor limit,
but with this code we did not get back such an exception.
* We also set up tracing within Oracle, and the application proved to
be hanging inside Forte - before it had apparently reached Oracle.
* And a dumpstatus on the partition showed us stuck in the OpenCursor.
* It seems that indeed this problem is one with Forte and its
multithreaded DB Libraries, so our only soution was to revert back
to the traditional partition-based replication of single threaded
DB partitions. It only took a minute to revert back, but this was
disappointing from a hardware resources point of view. We have
not seen the problem again since making this change.
* One other question that came up - indeed 3.0.M.0 is a beta release,
and we are looking to move to 3.0.M.2 shortly. We had to move to M
quickly to resolve an ISAPI problem in L, but plan to move to M.2
as soon as possible.
Thanks again for all the replies!
Ben Macdonald
Xpedior, Inc

@Sybrand - Funny you should mention Larry's boat - it happens to be moored about 200 metres from where I'm sitting here in Cape Town :-)
And yes, I will get in touch with sales for more clarity...
Thanks,
Andreas
*** Update
I called our 'Senior License Management Service Consultant' at Oracle and she confirms that Oracle do NOT take processor multithreading into consideration for licensing purposes.
So, our single quad core, multithreaded processor will be licensed as 4 cores, so will require 4 x 0.5 = 2 CPU licenses.
I guess Larry will have to drink cheaper champagne ;-)
Edited by: Andreas Hess on May 20, 2010 2:41 PM

Similar Messages

  • "Inconsistent cursor cache. Out of range cursor" error on dual processor multi thread

    I have a C++ with Pro*C++ COM object running on a Win2000 OS on
    a dual processor Middleware. The program is being called by a
    service in a multi threaded way. An oracle error like ORA-2103
    and SQL-02103 will be generated after running the program. We've
    tried putting mutex on every SQL statement in Pro*C and it works
    but the systems became very very slow. We concluded that the
    error might be cause by a collision of threads accessing the
    same Table or different tables having foreign constraints. This
    is so because the error keeps coming from a statement accessing
    Table A and following errors comes from a Table B having a
    foreign key on Table A.
    Our only solution now is to put Mutex on Statements accessing
    same tables or tables with foreign constraints but this will
    make our system run very very slow. I dont know if the problem
    is in our Oracle Database because we already upgraded our system
    from 8.1.6 to 8.1.7. The wierd thing on this is that the system
    is running smoothly without oracle errors on a SINGLE PROCESSOR
    Middleware. Hope you can give me any insights on this problem.

    I have a C++ with Pro*C++ COM object running on a Win2000 OS on
    a dual processor Middleware. The program is being called by a
    service in a multi threaded way. An oracle error like ORA-2103
    and SQL-02103 will be generated after running the program. We've
    tried putting mutex on every SQL statement in Pro*C and it works
    but the systems became very very slow. We concluded that the
    error might be cause by a collision of threads accessing the
    same Table or different tables having foreign constraints. This
    is so because the error keeps coming from a statement accessing
    Table A and following errors comes from a Table B having a
    foreign key on Table A.
    Our only solution now is to put Mutex on Statements accessing
    same tables or tables with foreign constraints but this will
    make our system run very very slow. I dont know if the problem
    is in our Oracle Database because we already upgraded our system
    from 8.1.6 to 8.1.7. The wierd thing on this is that the system
    is running smoothly without oracle errors on a SINGLE PROCESSOR
    Middleware. Hope you can give me any insights on this problem.

  • "SQL-02103: Inconsistent cursor cache." error on a dual processor multi threaded apps

    I have a C++ with Pro*C++ COM object running on a Win2000 OS on
    a dual processor Middleware. The program is being called by a
    service in a multi threaded way. An oracle error like ORA-2103
    and SQL-02103 will be generated after running the program. We've
    tried putting mutex on every SQL statement in Pro*C and it works
    but the systems became very very slow. We concluded that the
    error might be cause by a collision of threads accessing the
    same Table or different tables having foreign constraints. This
    is so because the error keeps coming from a statement accessing
    Table A and following errors comes from a Table B having a
    foreign key on Table A.
    Our only solution now is to put Mutex on Statements accessing
    same tables or tables with foreign constraints but this will
    make our system run very very slow. I dont know if the problem
    is in our Oracle Database because we already upgraded our system
    from 8.1.6 to 8.1.7. The wierd thing on this is that the system
    is running smoothly without oracle errors on a SINGLE PROCESSOR
    Middleware. Hope you can give me any insights on this problem.

    I have a C++ with Pro*C++ COM object running on a Win2000 OS on
    a dual processor Middleware. The program is being called by a
    service in a multi threaded way. An oracle error like ORA-2103
    and SQL-02103 will be generated after running the program. We've
    tried putting mutex on every SQL statement in Pro*C and it works
    but the systems became very very slow. We concluded that the
    error might be cause by a collision of threads accessing the
    same Table or different tables having foreign constraints. This
    is so because the error keeps coming from a statement accessing
    Table A and following errors comes from a Table B having a
    foreign key on Table A.
    Our only solution now is to put Mutex on Statements accessing
    same tables or tables with foreign constraints but this will
    make our system run very very slow. I dont know if the problem
    is in our Oracle Database because we already upgraded our system
    from 8.1.6 to 8.1.7. The wierd thing on this is that the system
    is running smoothly without oracle errors on a SINGLE PROCESSOR
    Middleware. Hope you can give me any insights on this problem.

  • "SQL-02103 Inconsistent cursor cache." error on dual processor multi threaded system

    I have a C++ with Pro*C++ COM object running on a Win2000 OS on
    a dual processor Middleware. The program is being called by a
    service in a multi threaded way. An oracle error like ORA-2103
    and SQL-02103 will be generated after running the program. We've
    tried putting mutex on every SQL statement in Pro*C and it works
    but the systems became very very slow. We concluded that the
    error might be cause by a collision of threads accessing the
    same Table or different tables having foreign constraints. This
    is so because the error keeps coming from a statement accessing
    Table A and following errors comes from a Table B having a
    foreign key on Table A.
    Our only solution now is to put Mutex on Statements accessing
    same tables or tables with foreign constraints but this will
    make our system run very very slow. I dont know if the problem
    is in our Oracle Database because we already upgraded our system
    from 8.1.6 to 8.1.7. The wierd thing on this is that the system
    is running smoothly without oracle errors on a SINGLE PROCESSOR
    Middleware. Hope you can give me any insights on this problem.

    I have a C++ with Pro*C++ COM object running on a Win2000 OS on
    a dual processor Middleware. The program is being called by a
    service in a multi threaded way. An oracle error like ORA-2103
    and SQL-02103 will be generated after running the program. We've
    tried putting mutex on every SQL statement in Pro*C and it works
    but the systems became very very slow. We concluded that the
    error might be cause by a collision of threads accessing the
    same Table or different tables having foreign constraints. This
    is so because the error keeps coming from a statement accessing
    Table A and following errors comes from a Table B having a
    foreign key on Table A.
    Our only solution now is to put Mutex on Statements accessing
    same tables or tables with foreign constraints but this will
    make our system run very very slow. I dont know if the problem
    is in our Oracle Database because we already upgraded our system
    from 8.1.6 to 8.1.7. The wierd thing on this is that the system
    is running smoothly without oracle errors on a SINGLE PROCESSOR
    Middleware. Hope you can give me any insights on this problem.

  • "SQL-02103: Inconsistent cursor cache." error on dual processor multi thread apps

    I have a C++ with Pro*C++ COM object running on a Win2000 OS on
    a dual processor Middleware. The program is being called by a
    service in a multi threaded way. An oracle error like ORA-2103
    and SQL-02103 will be generated after running the program. We've
    tried putting mutex on every SQL statement in Pro*C and it works
    but the systems became very very slow. We concluded that the
    error might be cause by a collision of threads accessing the
    same Table or different tables having foreign constraints. This
    is so because the error keeps coming from a statement accessing
    Table A and following errors comes from a Table B having a
    foreign key on Table A.
    Our only solution now is to put Mutex on Statements accessing
    same tables or tables with foreign constraints but this will
    make our system run very very slow. I dont know if the problem
    is in our Oracle Database because we already upgraded our system
    from 8.1.6 to 8.1.7. The wierd thing on this is that the system
    is running smoothly without oracle errors on a SINGLE PROCESSOR
    Middleware. Hope you can give me any insights on this problem.

    I have a C++ with Pro*C++ COM object running on a Win2000 OS on
    a dual processor Middleware. The program is being called by a
    service in a multi threaded way. An oracle error like ORA-2103
    and SQL-02103 will be generated after running the program. We've
    tried putting mutex on every SQL statement in Pro*C and it works
    but the systems became very very slow. We concluded that the
    error might be cause by a collision of threads accessing the
    same Table or different tables having foreign constraints. This
    is so because the error keeps coming from a statement accessing
    Table A and following errors comes from a Table B having a
    foreign key on Table A.
    Our only solution now is to put Mutex on Statements accessing
    same tables or tables with foreign constraints but this will
    make our system run very very slow. I dont know if the problem
    is in our Oracle Database because we already upgraded our system
    from 8.1.6 to 8.1.7. The wierd thing on this is that the system
    is running smoothly without oracle errors on a SINGLE PROCESSOR
    Middleware. Hope you can give me any insights on this problem.

  • Oracle 8 on Linux in Multi-Thread mode

    I installed Oracle 8.0.5.0.0 on Linux RedHat 5.1
    But I cann't startup database in multi-threaed mode.
    When I try to startup DB the errors follow
    SVRMGR> startup;
    ORA-00101: invalid specification for system parameter
    MTS_DISPATCHERS
    ORA-00102: network protocol
    (ADDRESS=(PARTIAL=YES)(PROTOCOL=tcp)) cannot be used by
    dispatchers
    My configuration files are:
    listener.ora
    LISTENER =
    (ADDRESS_LIST =
    (ADDRESS= (PROTOCOL= IPC)(KEY= orcl))
    (ADDRESS= (PROTOCOL= IPC)(KEY= PNPKEY))
    (ADDRESS= (PROTOCOL= TCP)(Host=
    pcstar.kharkov.ua)(Port= 1521))
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (GLOBAL_DBNAME= pcstar.kharkov.ua)
    (ORACLE_HOME= /usr/oracle)
    (SID_NAME = orcl)
    (SID_DESC =
    (SID_NAME = extproc)
    (ORACLE_HOME = /usr/oracle)
    (PROGRAM = extproc)
    STARTUP_WAIT_TIME_LISTENER = 0
    CONNECT_TIMEOUT_LISTENER = 10
    TRACE_LEVEL_LISTENER = OFF
    tnslistener working normally
    tnsnames.ora
    extproc_connection_data =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = orcl))
    (CONNECT_DATA = (SID = extproc))
    orcl =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL= TCP)(Host=
    pcstar.pcstar.kharkov.ua)(Port= 1521))
    (CONNECT_DATA = (SID = orcl))
    orcl_BEQ =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = BEQ)(PROGRAM = /usr/oracle)
    (argv0 = oracleorcl)
    (args = '(DESCRIPTION =
    (LOCAL=YES)(ADDRESS=(PROTOCOL=BEQ)))')
    (envs =
    'ORACLE_HOME=/usr/oracle,ORACLE_SID=orcl')
    initorcl.ora
    mts_dispatchers="tcp,1"
    mts_max_dispatchers=3
    mts_servers=1
    mts_max_servers=5
    mts_service=orcl
    mts_listener_address="(ADDRESS=(PROTOCOL=tcp)(Host=pcstar)(Por
    t=1521))"
    If anybody started server in Multi-Thread mode, mail me
    [email protected]
    Best Regards!
    Gennady Saldiga
    null

    Yes, the MTS for TCP protocol does not work. A patch will be
    released soon for the production release with the fix for
    the MTS problem.
    Maturi
    Satoshi Hirai (guest) wrote:
    : Gennady Saldiga (guest) wrote:
    : : I installed Oracle 8.0.5.0.0 on Linux RedHat 5.1
    : : But I cann't startup database in multi-threaed mode.
    : : When I try to startup DB the errors follow
    : : SVRMGR> startup;
    : : ORA-00101: invalid specification for system parameter
    : : MTS_DISPATCHERS
    : : ORA-00102: network protocol
    : : (ADDRESS=(PARTIAL=YES)(PROTOCOL=tcp)) cannot be used by
    : : dispatchers
    : : My configuration files are:
    : : listener.ora
    : : LISTENER =
    : : (ADDRESS_LIST =
    : : (ADDRESS= (PROTOCOL= IPC)(KEY= orcl))
    : : (ADDRESS= (PROTOCOL= IPC)(KEY= PNPKEY))
    : : (ADDRESS= (PROTOCOL= TCP)(Host=
    : : pcstar.kharkov.ua)(Port= 1521))
    : : SID_LIST_LISTENER =
    : : (SID_LIST =
    : : (SID_DESC =
    : : (GLOBAL_DBNAME= pcstar.kharkov.ua)
    : : (ORACLE_HOME= /usr/oracle)
    : : (SID_NAME = orcl)
    : : (SID_DESC =
    : : (SID_NAME = extproc)
    : : (ORACLE_HOME = /usr/oracle)
    : : (PROGRAM = extproc)
    : : STARTUP_WAIT_TIME_LISTENER = 0
    : : CONNECT_TIMEOUT_LISTENER = 10
    : : TRACE_LEVEL_LISTENER = OFF
    : : tnslistener working normally
    : : tnsnames.ora
    : : extproc_connection_data =
    : : (DESCRIPTION =
    : : (ADDRESS = (PROTOCOL = IPC)(KEY = orcl))
    : : (CONNECT_DATA = (SID = extproc))
    : : orcl =
    : : (DESCRIPTION =
    : : (ADDRESS = (PROTOCOL= TCP)(Host=
    : : pcstar.pcstar.kharkov.ua)(Port= 1521))
    : : (CONNECT_DATA = (SID = orcl))
    : : orcl_BEQ =
    : : (DESCRIPTION =
    : : (ADDRESS = (PROTOCOL = BEQ)(PROGRAM = /usr/oracle)
    : : (argv0 = oracleorcl)
    : : (args = '(DESCRIPTION =
    : : (LOCAL=YES)(ADDRESS=(PROTOCOL=BEQ)))')
    : : (envs =
    : : 'ORACLE_HOME=/usr/oracle,ORACLE_SID=orcl')
    : : initorcl.ora
    : : mts_dispatchers="tcp,1"
    : : mts_max_dispatchers=3
    : : mts_servers=1
    : : mts_max_servers=5
    : : mts_service=orcl
    mts_listener_address="(ADDRESS=(PROTOCOL=tcp)(Host=pcstar)(Por
    : : t=1521))"
    : : If anybody started server in Multi-Thread mode, mail me
    : : [email protected]
    : : Best Regards!
    : : Gennady Saldiga
    : Hi!
    : Same problem occured on my environment (Debian GNU/Linux 2.0).
    : But I succeeded to start Multi-thread server on ipc protocol.
    : My current configuration file (mts_* in init.ora) as follows:
    : mts_dispatchers="ipc,1"
    : mts_max_dispatchers=10
    : mts_servers=1
    : mts_max_servers=10
    : mts_service=orcl
    : # I confirmed mts_listener_address syntax by manual and
    : # v$parameter.
    : # Net8 Admn man says: If you have multiple MTS_LISTENER_ADDRESS
    : # parameters, they must be adjacent to each other in your
    : # initialization file.
    mts_listener_address="(ADDRESS=(PROTOCOL=TCP)(host=j-00872)(port=
    : 1521))"
    : mts_listener_address="(ADDRESS=(PROTOCOL=IPC)(KEY=orcl))"
    : So I tested MTS_DISPATCHERS parameter's other syntax.
    : The test results are:
    : # mts_dispatchers="ipc,1"
    : # OK
    : # mts_dispatchers="tcp,1"
    : # ORA-00101,ORA-00102 occured
    : # mts_dispatchers="TCP,1"
    : # ORA-00101,ORA-00102 occured
    : # mts_dispatchers="ipc,1","tcp,1"
    : # ORA-00101,ORA-00102 occured
    : # mts_dispatchers="(ADDRESS=(PARTIAL=YES)(PROTOCOL=tcp))"
    : # ORA-00101,ORA-00102 occured
    : # mts_dispatchers="(ADDRESS=(PARTIAL=NO)(PROTOCOL=tcp))"
    : # ORA-00101,ORA-00102 occured
    : # mts_dispatchers="(ADDRESS=(PARTIAL=YES)(PROTOCOL=ipc))"
    : # OK
    : # mts_dispatchers="(PROTOCOL=IPC) (DISPATCHERS=3)"
    : # OK
    : # mts_dispatchers="(PROTOCOL=TCP) (DISPATCHERS=3)"
    : # ORA-00101,ORA-00102 occured
    : # mts_dispatchers="(ADDRESS=(PROTOCOL=IPC)(KEY=orcl))
    : (dispatchers=3)"
    : # OK
    mts_dispatchers="(ADDRESS=(PROTOCOL=TCP)(host=j-00872)(port=1521)
    : ) (dispatcher
    : s=3)"
    : # ORA-00101,ORA-00102 occured
    mts_dispatchers="(description=(ADDRESS=(PROTOCOL=IPC)(KEY=orcl))(
    : connect_data=
    : (sid=orcl))) (dispatchers=3)"
    : # OK
    mts_dispatchers="(description=(ADDRESS=(PROTOCOL=TCP)(host=j-0087
    : 2)(port=1521)
    : )(connect_data=(sid=orcl))) (dispatchers=3)"
    : # ORA-00101,ORA-00102 occured
    : ### While the test, sometimes ORA-00472 (ORA-00472: PMON
    process
    : ### terminated with error) occured when instance shutdown.
    : ### I think the error reported in another message
    : ### on the same thread.
    : It seems dispatcher is not binded to tcp protocol adapter.
    : Does anybody have more information about Multi-thread server
    : using TCP protocol.
    : ### Please forgive my bad english.
    : Thank you.
    : Satoshi Hirai
    null

  • XA & Oracle - Multi-threaded

    Hi All,
    The Oracle XA documentation says that multi threaded
    applications are
    possible. But when i tried to open a connection to the DB using
    XA_OPEN in
    thread session with the same string it is giving an error in the
    second
    thread saying "XA_ERRPROTO: DB Name not unique", however sucess
    in the first
    thread. So multi-thread means multiple connections to diff DB.
    So i opened one connection in the main thread, and i did a
    XA_START with
    diff. XID in both the threads. Again here in the second thered
    the error is
    "XA_ERRPROTO: Thread already associated".
    So if these are standard ones how to write a mult threaded
    application using
    XA which uses only one DB.
    -prabha
    null

    要好好看,楼主为啥不解释一下呢,或者简单翻译一下思想呢。 
    为了到单位不忘记该连接,故发此贴,希望不要认为是灌水。

  • Oracle Multi-threaded libraries and Forte R3

    Hello all,
    I heard through the grapevine that it would be possible
    to use Oracle 7.3 multi-threaded support with Forte 3.0G.
    (thus making Load-Balancing obsolete in this case)
    Has anyone given a try at this assumption ?
    If yes, on what platform and what versions ?
    Thanks,
    Vincent Figari
    You don't need to buy Internet access to use free Internet e-mail.
    Get completely free e-mail from Juno at http://www.juno.com
    Or call Juno at (800) 654-JUNO [654-5866]
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    Hi,
    It is available In R3.0.F.2 also. I tested it this release and it works
    very well. But, you need to make a design pattern on it : A Oracle
    Session can not be shared between several transactions throught threads.
    So You need to manage a pool of DBSessions.
    Hope this Helps,
    Daniel Nguyen
    Freelance Forte Consultant
    Vincent R Figari wrote:
    >
    Hello all,
    I heard through the grapevine that it would be possible
    to use Oracle 7.3 multi-threaded support with Forte 3.0G.
    (thus making Load-Balancing obsolete in this case)
    Has anyone given a try at this assumption ?
    If yes, on what platform and what versions ?
    Thanks,
    Vincent Figari
    You don't need to buy Internet access to use free Internet e-mail.
    Get completely free e-mail from Juno at http://www.juno.com
    Or call Juno at (800) 654-JUNO [654-5866]
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>-
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

  • Multi-threaded program hangs in Linux with green thread when doing I/O

    Hi,
    I am using green thread(jdk1.3.1) on Linux. My program is in multi-threaded model and has some I/O operations. I am runing one java program using Runtime.exec("java <program>"). Actually the <program> prompts user with some question like "enter location" and waits for the input. Now in my code I am constantly reading the input stream of the process. Once I get the string like "enter location", immediately I send the location through Process o/p stream. But the process is not able to read this and hangs there for ever.
    Please help, what could be the problem? If you need the source code, pls let me know.
    Thanks in advance,
    Sisir

    I had a similar issue few weeks back... If I could see the source I would have a better understanding of the problem and think I could help out. If you want to send it, send it to [email protected]
    thanks,
    JP

  • Memory leaks and multi threading issues in managed client.

    In our company we use a lot of Oracle, and after the release of the managed provider we migrated all applications to it. First the  things were very impressive : the new client was faster, but after some days applications that uses 100MB with old client goes to 1GB and up. The memory is not the only issue, we use a lot of multi threading, and we experience connection drops and not disposal, after 1 days working one of the application had over 100 sessions on the server. I think there is something wrong with connection pool and multi threading.
    Is someone experience same problems.
    Yesterday we went back with unmanaged provider. Now things are back to normal.

    connection drops: did you try to use "Validate Connection=true" parameter in your connection string?
    the new client was faster: are you sure with this statement? Even in 64bit environment? I got quite serious performance problems when running application under 64bit process: https://forums.oracle.com/thread/2595323

  • How to write a multi threaded Cache Event Listener

    I have a distributed data cache called tokenCache for my application. I have also added a mapListener to this cache to listen to a particular kind of events.
    tokenCache.addMapListener((MapListener) new TokenCacheListenerBean(), new MapEventFilter(tokenFilter), false);
    So bascially everytime a token (The domain object of this cache) is updated the entryUpdated() method in my EJB TokenCacheListenerBean is invoked.
    The issue I have though is that, from what I observe on running my code is that the Cache Listener is single threaded. So if two Token Objects on my tokenCache are updated,
    lets say Token Object A and Token Object B one after the other,  the entryUpdated() method in my EJB is invoked for Token Object A and  once the invocation is complete
    then the entryUpdated() method is invoked again for Token Object B(). At a given point of time there is only one instance of TokenCacheListenerBean EJB.  Is there a way to
    make this happen in multi-threaded manner ?
    Is there a configuration setting somewhere which allows multiple CacheListeners to be instantiated at a given point of time ?
    TokenCacheListenerBean  EJB_
    package oracle.communications.activation.asap.ace;
    import java.util.Iterator;
    import java.util.Set;
    import java.util.logging.Logger;
    import javax.ejb.Stateless;
    import com.tangosol.net.NamedCache;
    import com.tangosol.util.MapEvent;
    import com.tangosol.util.MapListener;
    import com.tangosol.util.ValueUpdater;
    import com.tangosol.util.extractor.PofExtractor;
    import com.tangosol.util.extractor.PofUpdater;
    import com.tangosol.util.filter.EqualsFilter;
    import com.tangosol.util.filter.LikeFilter;
    import com.tangosol.util.filter.LimitFilter;
    import com.tangosol.util.processor.UpdaterProcessor;
    * Session Bean implementation class TokenCacheListenerBean
    @Stateless
    public class TokenCacheListenerBean implements TokenCacheListenerBeanRemote, TokenCacheListenerBeanLocal, MapListener {
    NamedCache asdlCache;
    NamedCache tokenCache;
    private final int PAGE_SIZE = 1;
    private static Logger logger = Logger.getLogger(ConnectionManager.class.getName());;
    * An instance of the JCAModeler EJB, represents the JCA-JNEP
    JCAModeler jcaBean;
    * Default constructor.
    public TokenCacheListenerBean() {
    // TODO Auto-generated constructor stub
    public void entryDeleted(MapEvent Event) {
    public void entryInserted(MapEvent Event) {
    public void entryUpdated(MapEvent Event) {
    Token newToken = (Token) Event.getNewValue();
    Token oldToken = (Token) Event.getOldValue();
    if ((oldToken.getState() == Token.TOKEN_RESERVED)
    && (newToken.getState()== Token.TOKEN_AVAILABLE)) {
    String networkID = newToken.getNeID();
    asdlCache = AceCacheFactory.getCache("asdlCache");
    tokenCache = AceCacheFactory.getCache("tokenCache");
    EqualsFilter filterNE = new EqualsFilter(new PofExtractor(String.class,Asdl.NETWORKID), networkID);
    LimitFilter limitFilter = new LimitFilter(filterNE, PAGE_SIZE);
    Set removeASDL = asdlCache.keySet(limitFilter);
    Iterator asdlIterator = removeASDL.iterator();
    if (asdlIterator.hasNext()) {
    logger.info(printASDLCache());
    ValueUpdater updater = new PofUpdater(Token.STATE);
    System.out.println("Token ID:" + newToken.getTokenID());
    UpdaterProcessor updaterProcessor = new UpdaterProcessor(updater, Integer.toString(Token.TOKEN_RESERVED));
    tokenCache.invoke(newToken.getTokenID(), updaterProcessor);
    jcaBean = new JCAModeler(tokenCache);
    Object asdlID = asdlIterator.next();
    Asdl provisionAsdl = (Asdl) asdlCache.get(asdlID);
    asdlCache.remove(asdlID);
    jcaBean.provision(provisionAsdl, newToken.getTokenID());
    logger.info(ConnectionManager.printTokenCache());
    logger.info(printASDLCache());
    }

    Here is what I am asking!
    I have added 2 listeners (Listener A and Listener B) which each listen on for changes made to 2 different token Cache Objects (Token A and Token B).
    for (i = 0; i < 2 ; i++) {
    Token tokenAdded = new Token(UUID.randomUUID().toString(),TOKEN_AVAILABLE, networkID);
    tokenCache.put(tokenAdded.getTokenID(), tokenAdded);
         tokenCache.addMapListener((MapListener) new TokenCacheListener(), tokenAdded.getTokenID(), false);
    Now assume that updates are made to Token A and Token B simuntaneosly.
    Why do i observe in my diagnostic messages that only one Listener is invoked at a given point of time.
    Which means I see Listener A getting invoked and then once invocation of Listener A is complete I see Listener B bieng invoked.
    Ideally I would want both listeners to be invoked simultaneously rather than in a one off fashion.
    Here is the code for my token cache Listener
    package oracle.communications.activation.asap.ace;
    import java.util.Iterator;
    import java.util.Map;
    import java.util.Set;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import com.tangosol.net.CacheFactory;
    import com.tangosol.net.NamedCache;
    import com.tangosol.util.AbstractMapListener;
    import com.tangosol.util.Filter;
    import com.tangosol.util.MapEvent;
    import com.tangosol.util.MapListener;
    import com.tangosol.util.ObservableMap;
    import com.tangosol.util.ValueUpdater;
    import com.tangosol.util.extractor.PofExtractor;
    import com.tangosol.util.extractor.PofUpdater;
    import com.tangosol.util.filter.AndFilter;
    import com.tangosol.util.filter.EqualsFilter;
    import com.tangosol.util.filter.LikeFilter;
    import com.tangosol.util.filter.LimitFilter;
    import com.tangosol.util.processor.UpdaterProcessor;
    public class TokenCacheListener extends AbstractMapListener {
         NamedCache asdlCache;
         NamedCache tokenCache;
         AceCacheFactory cacheFactoryBean = new AceCacheFactory();
         private final int PAGE_SIZE = 1;
         private static Logger logger = Logger.getLogger(ConnectionManager.class
                   .getName());;
         * An instance of the JCAModeler EJB, represents the JCA-JNEP
         JCAModeler jcaBean;
         * This is a utility method and prints the tokens cache.
         public String printTokenCache() {
              NamedCache tokenCache = cacheFactoryBean.getCache("tokenCache");
              LikeFilter tokenList = new LikeFilter(new PofExtractor(String.class,
                        Token.STATE), "%", (char) 0, false);
              Set keySet = tokenCache.keySet(tokenList);
              StringBuffer cachedTokenList = new StringBuffer("\n################################## Token(s) Cache ##################################");
              int counter = 1;
              for (Object tokenInCache: keySet) {
                   Token tokenObject = (Token) tokenCache.get(tokenInCache.toString());
                   cachedTokenList.append("\nS.NO:" + (counter++)
                             + "\t ID:" + tokenInCache.toString()
                             + "\t State:" + Token.tokenToString(tokenObject.getState()));
              cachedTokenList.append("\n####################################################################################");
              return cachedTokenList.toString();     
         * This method is a utility method and it prints all the ASDL(s) currently present on the
         * asdlCache.
         private String printASDLCache() {
              NamedCache asdlCache = cacheFactoryBean.getCache("asdlCache");
              LikeFilter asdlList = new LikeFilter(new PofExtractor(String.class,
                                  Asdl.NETWORKID), "%", (char) 0, false);
              Set keySet = asdlCache.keySet(asdlList);
              StringBuffer cachedASDLList = new StringBuffer("\n################ ASDL Cache ######## ########");
              int counter = 1;
              for (Object asdlInCache: keySet) {
                   cachedASDLList.append("\nS.NO:" + (counter++) + "\t ID:" + asdlInCache.toString());
              cachedASDLList.append("\n################ ASDL Cache ######## ########\n");
              return cachedASDLList.toString();     
         public TokenCacheListener() {
         public void checkASDLCache(MapEvent Event) {
         // Not currently used
         public void entryUpdated(MapEvent Event) {
              Token newToken = (Token) Event.getNewValue();
              Token oldToken = (Token) Event.getOldValue();
              logger.info("\n=============================================================================================="
                        + "\nTOKEN CACHE LISTENER"
                        + "\n=============================================================================================="
                        + printTokenCache()
                        + "\n==============================================================================================");
              if ((oldToken.getState() == Token.TOKEN_RESERVED)
                        && (newToken.getState()== Token.TOKEN_AVAILABLE)) {
              String networkID = newToken.getNeID();
              asdlCache = cacheFactoryBean.getCache("asdlCache");
              tokenCache = cacheFactoryBean.getCache("tokenCache");
              EqualsFilter filterNE = new EqualsFilter(new PofExtractor(String.class,Asdl.NETWORKID), networkID);
              LimitFilter limitFilter = new LimitFilter(filterNE, PAGE_SIZE);
              Set removeASDL = asdlCache.keySet(limitFilter);
              Iterator asdlIterator = removeASDL.iterator();
              if (asdlIterator.hasNext()) {
              logger.info(printASDLCache());
              ValueUpdater updater = new PofUpdater(Token.STATE);
              System.out.println("Token ID:" + newToken.getTokenID());
              UpdaterProcessor updaterProcessor = new UpdaterProcessor(updater, Integer.toString(Token.TOKEN_RESERVED));
              tokenCache.invoke(newToken.getTokenID(), updaterProcessor);
              jcaBean = new JCAModeler(tokenCache);
              Object asdlID = asdlIterator.next();
              Asdl provisionAsdl = (Asdl) asdlCache.get(asdlID);
              asdlCache.remove(asdlID);
              jcaBean.provision(provisionAsdl, newToken.getTokenID());
              logger.info(printTokenCache());
              logger.info(printASDLCache());
    I only see one instance of this listener alive at any given point of time.
    Edited by: 807103 on Nov 3, 2011 1:00 PM
    Edited by: 807103 on Nov 3, 2011 1:12 PM

  • Multi Thread Server over TCP/IP

    Multi Thread Server over TCP/IP. Does it work?
    In my box it works only over IPC protocol.
    null

    S C Maturi (guest) wrote:
    : Mark Malakanov (guest) wrote:
    : : Multi Thread Server over TCP/IP. Does it work?
    : : In my box it works only over IPC protocol.
    : Mark,
    : Multi threaded server over TCP/IP will not work with
    : the current distribution of Oracle 8.0.5 on Linux.
    : This is corrected and a patch would be released soon.
    : Maturi
    tcp 0 0 bock.nettek-ll:listener bock.nettek-
    llc.co:4196 ESTABLISHED
    tcp 0 0 bock.nettek-llc.co:4196 bock.nettek-
    ll:listener ESTABLISHED
    (I have serveral of these)
    TNS Ping Utility for Linux: Version 8.0.5.0.0 - Production on 07-
    JAN-99 18:45:52
    (c) Copyright 1997 Oracle Corporation. All rights reserved.
    Attempting to contact (ADDRESS=(PROTOCOL=TCP)(HOST=localhost)
    (PORT=1521))
    OK (440 msec)
    ...and from my install log you see that I selected MTS:
    -[ YESNO
    Q> Would you like MTS (Multi-Threaded Server) configured
    and the SQL*Net$
    A> TRUE
    Please explain? Will TCP/IP MTS work via the loopback adapter
    only? So far I have not tried a remote TCP/IP connection.
    -STEVEl
    null

  • Running a Java Multi Thread Program in database

    I have created a multi threaded program in Java and it runs successfully from the command prompt. I want to create a DBMS Job which will wake up at regular intervals and runs the java program(Java stored procedure). Is this possible in 9.2/10G ?? If Yes, will there be any impact on the DB performance/increase memory etc.,
    The database (9.2...) resides on a RH 2.3 AS box.
    Any ideas...
    Thanks,
    Purush

    Purush,
    Java stored procedures cannot be multi-threaded. Well, they can, but the threads will not run in parallel. You may be able to find some more information in the Oracle documentation, which is available from:
    http://tahiti.oracle.com
    Good Luck,
    Avi.

  • Multi-thread failure - Error in assignment

    Hello
    I have a c++ program processor running under Windows XP with Oracle 9i. My program access to oracle by an ODBC driver version 9.2.0.4.0. It could be launched in multi-thread to increase performance. When I launch it with one thread everything is fine. When I use several threads I have problems. ODBC driver returns to me a "error in assignment ... General error" message and my updates queries failed. Under SQl server it works without problems. It seems to be a kind of deadlock. When I disable check box in my odbc driver of "enable query timeout" my program encounter a problem and freezes...
    Could someone help me ?

    user13335017 wrote:
    I have thought of the above solutions as workable, however, it is not. Some exhibited errors are:
    A. "Attempt to use database while environment is closed." This error applies to 2, 3 and 4 all the way;
    B. "Attempt to read / write database while database is closed." This error applies to 3 in particular;
    C. "Attempt to close environment while some database is still open." This error applies to 5.
    Please help me with designing a better strategy to solve the concurrent issue. Many thanks in advance.All these are expected errors. You should design the application so that you do not close an environment handle while database handles are still open, keep database handles open for as long as operations need to be performed on the underlying databases, open the database handles after opening the database handles, and close database handles before closing the environment handle.
    In short, in pseudo-code, you should have something like this:
    - open environment handle,
    - open database handles,
    - perform whatever operations are needed on the databases,
    - close database handles,
    - close environment handle.
    You can refer to the Getting Started with Data Storage and the Getting Started with Transaction Processing guides appropriate for the API you are using, from the Berkeley DB documentation page.
    Regards,
    Andrei

  • Connection Pooling in OCCI Vs Multi-Threading.

    Hi,
    I am working on an application in which I am using OCCI( Oracle C++ Call Interface)  and multi-threading concepts.
    My application is having different clients( Ex: Client-A, Client-B) and I am offering a set of operations( functions that trigger the Stored Procedures of DataBase ) which are common to all the clients.Each Client can send asynchronous requests of any number.So, is there any chance of using single connection( not connection pooling) to the Data Base for all the clients to manage their requests ?
    Note: Multi-threaded requests are also allowed from each client.
    How can I co-relate multithreading and Connection Pooling in OCCI?
    Can I you multi-threading without Connection Pooling? If so how?
    Will the connection pooling is needed if there is no multi threading concept in my application?
    Please help me on this. Very urgent.
    Thanks in Advance..:)

    Connections are resources that the application uses and a fewer connections can be used by multiple threads if the threads are not always busy with the database activity only, and are doing other work too. This sharing (pooling) can be implemented by the application or the application can leverage the connection pooling features offered by OCI/OCCI (recommended).
    Be aware of connections vs sessions and sharing them (refer to :
    OCI Programming Advanced Topics
    OCCIConnectionPool is to pool connections and OCCIStatelessConnectionPool is to pool sessions. Please see the differences in the above link and apply as appropriate.

Maybe you are looking for

  • My apple tv is finally working

    Well folks, either the book wasn't totally clear or I miss read but I got it working. I found out to manually setup your wireless. Do not let it do it automatically. I stream mine so you have to leave your wireless up along with itunes. Connect to th

  • Determine Image Position within it's containing graphic frame.

    Hi,<br /><br />I am trying to obtain the offset of an image item within it's containing frame. i.e. if I set the top left co-ordiante to be x:10pt , y:10pt<br />I need to obtain this programatically.<br /><br />I have tried using Both the ITransformS

  • I have iPad new 3rd gen with OS 7.0.4.  I cannot open SEARCH window by using maneuvers noted in manual.  how can I open SEARCH?

    I have iPad new 3rd gen with OS 7.0.4.  I cannot open SEARCH window by using maneuvers noted in manual.  how can I open SEARCH?

  • OS X 10.5.8 to 10.6.1?

    Ive a mac that meets the requirements for the upgrade but when I run the snow leopard installer it says OS X can't be installed on this computer. Any help is wanted. The spec are below 2.4 ghz intel core 2 duo 2gb 1067 MHz ddr3 L2 cache 3mb Macbook 5

  • Mountain Lion Running Very slow

    I am running ML on a Mac Mini, 2011, i7, 8Gb RAM.  Clean Install recently after similar problems with upgrade from Lion.  Etrecheck report below.  Any help would be very appreciated. Hardware Information:     Mac mini - model: Macmini5,2     1 2.7 GH