OCCI  Question.

I have a OCCI error :
"/space/oracle/rdbms/demo/occiControl.h", line 527: Error: Identifier expected .
1 Error(s) detected.
*** Error code 1
make: Fatal error: Command failed for target `database_oper.o'
Current working directory /space/yyp/software/server
*** Error code 1
make: Fatal error: Command failed for target `database_oper'
what is mean about the error ?
where `database_oper.o' is my demo programmmer.
thanks .

You have what appears to be a makefile problem.
Check to make sure that your makefile syntax is correct.
target : dependencies
<TAB> actions

Similar Messages

  • Migrating LONG RAW to BLOB and optimizing extent size

    Hi all,
    I got a quite fragmented table with a LONG RAW column I want to migrate to BLOB and defragment.
    DB version is Oracle9i Release 9.2.0.4.0 and this is a production environment.
    I know MOVE and/or CTAS are not possible with LONG RAW columns
    So, how can I do that? Is ALTER TABLE MODIFY the only possibility to migrate from LOING RAW to BLOB?
    Since ALTER TABLE MODIFY will lock the whole table preventing any DML operation, I need at least a rough estimate of the time needed for this operation. How can I do that?
    Since this table is quite fragmented, I also want to rebuilt it using a different extent size.
    I think I should issue a ALTER TABLE MOVE... after having performed the "ALTER TABLE MODIFY".
    Can I do something better to minimize unavailability to DML operations?
    thanks,
    andrea

    Hi,
    Is this an OCCI question?
    I don't see that "to_blob" is documented anywhere. The "to_lob" function can be used to convert long raw columns, but its use is pretty specific and certainly not for general query use.
    Regards,
    Mark
    EDIT1: Well, my local documentation set does not have "to_blob" in it at all. However, it is in the 11.1 SQL Language Reference on OTN:
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/functions186.htm#sthref2358
    Despite the fact that the documentation mentions "long raw" the function appears to only work with "raw" data in my 11.1 tests.
    What's your goal here?
    Edited by: Mark Williams on Jun 8, 2009 7:15 PM

  • Global Connection Pool?

    Hello,
    Maybe this is not a specific OCCI question, sorry if this is not the best place to post this.
    Well, the point is I wanted please an opinion on witch is the best way to optimize (ie, limit the number of) the connections to the server in the following scenario: we have one database, multiple (in the order of hundreds) of clients that use many different applications and keep them open for most of the time (and in fact this is the problem, there are too many connections...);
    Most of the applications use the same business-logic component, that makes the connection to the database. I wanted to implement something like a timeout for the idle connections, but Ithink that disconnecting/reconnecting all the time would be slow. Then I came to the topic of a connection pool, but from what I understood a connection pool applies to only one process, right? What I wanted to achieve is something like a "global" connection pool, since all applications use the same component to access the data it just this component needs to be altered.
    My idea was then this: create another component (exe) that maintains a connection pool that is shared by many applictions (sure, I would write this in COM/ATL and it has to be a free threaded component); Then when some application needs to query for some data it simply instantiates a connection, uses it and releases it. The only real "operations" we need is query and update/insert of data, so it wouldn't be so difficult to implement a connection and a resultset objetct. Sure, we in this case there would be a constant communication between both applications (via COM), maybe it would slow it down a bit but since our applications are not so "real-time" and the bottleneck resides more in the server I thnk this wouldn't be an issue...
    My question is: is this a good idea, is it insane, or there exists another easier-better way to optimize our scenario, ie, reduce the number of connections used by multiple processes?
    Thanks,
    Tiago Gehring

    Hi everbright,
    I prefer NOT to make a JDBC connection pool a global resource. After all, if you have several applications on the same Tomcat instance you might not want them all to hit the same database. Better to make it a context-specific thing.
    I don't edit the server.xml - ever. I create the context XML in a separate file and deploy it with my WAR file. Tomcat picks it up automatically. Now my apps are nice and self-contained, and I don't have to ask a server admin to modify anything.
    Got the DBCP JAR in your WEB-INF/lib?
    This URL looks incorrect to me if you're using the Oracle JDBC driver:
    jdbc:oracle:thin:[email protected]:1521:DEVI think it should be:
    jdbc:oracle:thin:@127.0.0.1:1521:DEVLooks like you're trying to do this in a JSP. Have you tried moving the database code out of the JSP and into a JavaBean, where it belongs? You can test the database connection offline that way. Get it working and then worry about Tomcat.
    When I do a JNDI lookup, the Java code looks like this:
        /** Default JNDI lookup name for all data sources */
        public static final String DEFAULT_LOOKUP    = "java:comp/env/jdbc/APIPrototype";
         * Create a DatabaseBroker
         * @param lookup for data source
         * @throws NamingException if the lookup fails
         * @throws SQLException if the connection fails
        public DatabaseBroker(String lookup) throws NamingException, SQLException
            Context context = new InitialContext();
            DataSource ds   = (DataSource)context.lookup(lookup);
            this.connection = ds.getConnection();
            context.close();
        }I know this works, because it's been running in production under Tomcat 4.1.30 connecting to Oracle 9i for over a year.
    You can do this.
    %

  • Occi PORTABILITY QUESTION

    hi all
    We are developing an application to access oracle 8i database from C++ code. I have three questions in this regard
    1. Can we develop the application using OCCI on WIndows platform and use the same applciation without any modifiaitons on UNIX environment ? If there are any modifiations required what are they?
    2. Can we acess Oracle 8i database using the OCCI libraries ? or can we just copy the OCCI libraries and use it with Oracle 8i client? What is the compatibility here? The server is Oracl 8i and is fixed. That cannot be changed.
    3. We have used Roguewave for accessing the oracle database for developing the portabile applciation. But that seems to be working slower ( database access and some processign using Roguewave classes) than corresponding Java application ( data acess and processing). By using the OCCI can I get my program to run much faster than JAVA ? at the same time maintaining the portability of my application ?
    We have not decided on using any of these tools yet. But your feedback / answers would certainly help me in decidinga good tool or platform for my applcation. Please get back to me as early as possible
    Murthy

    I don't do any development with OCCI but do use OCI. However I believe the principles are the same.
    1: You should be able to develop the application in OCCI on windows and port it to a UNIX Platform. However it is highely likely this will require some changes to your code on the UNIX platform. Porting is rarely a matter of re-compiling on a different platform (even for Java).
    2: You should not have to copy the OCCI libraries if your application compiles to an EXE or a DLL. You also should not require the Oracle 8i client for this as your app should contain all the functionality required to connect to an 8i database.
    3: I have used various methods to connect to Oracle databases. I have yet to find anything quicker than OCI. I would be surprised if either Roguewave or Java would be faster than OCCI. I have come across many developers that complain about java performance and apps that suffer from it's poor performance for DB connectivity.
    This is purely my own opinion and no doubt others will have theirs and different experiences.
    Martin

  • OCCI commong questions

    There are some common questions when we use OCCI,I just list them here,
    it anyone have resolve them ,I appreciate your help if you can post your method.
    1&#12289;ResultSet getString error
    2&#12289;ResultSet can just use index,but how to bind column name
    3&#12289; whether gcc3.4.3 must used with oracle10.2.x.x, how to compile program with oracle10.1.x.x?Must upgrade to oracle10.2.x.x?
    4&#12289;anyone can add his question

    (1) and (3) are related to gcc versions to use with OCCI. OCCI 10.1 and 10.2 support gcc 3.2.3 (and gcc 2.96). In addition, OCCI 10.2 supports gcc 3.4.3 (libraries are available on OTN).
    2) For retreiving the column names in a ResutSet, you need to use the ResultSet::getColumnListMetaData() interface. You can implement your own solution to call ResultSet::getXXX methods by column name e.g :-
    vector<MetaData> md = rs->getColumnListMetaData();
    map<string, int> columns;//column names to number mapping
    for (int i = 0; i < md.size(); i++) columns[md[i].getString(MetaData::ATTR_NAME)] = i;
    //now "use" column names!
    string ename = rs->getString(columns["ENAME"));
    -Shankar

  • Occi win & what to install - newbie question

    i have an working oracle on linux now all i have to do is write an occi app under windows which will work with it - so i have a question what do i have to have installed under windows to write this app, and what parts of oracle do i have to install to run them - it's important to me that it would be the minimal set of oracle stuff installed on win clients.

    At a minimum you need to install the Oracle Client and the OCCI libaries. I think these are included in the "Programmer" install option for the Oracle Windows client.

  • To ask OCCI demo's  question

    Hi,
    I am trying to compile OCCI demo file ($ORACLE_HOME/rdbms/demo/occiproc.cpp) and run it in Aix, but ORA-01008 error.
    Thank you for any replies...
    ===================================================
    printing information:
    new occiproc successfull.
    callproc - invoking a PL/SQL procedure having IN, OUT and IN/OUT parameters
    Executing the block :"BEGIN demo_proc(:1, :2, :3); END; "
    1008: ORA-01008: not all variables bound
    ===================================================
    #include <iostream>
    #include <occi.h>
    using namespace oracle::occi;
    using namespace std;
    class occiproc
    private:
         Environment *env;
         Connection *con;
    public :
         occiproc (string user, string passwd, string db) throw (SQLException)
              env = Environment::createEnvironment (Environment::DEFAULT);
              con = env->createConnection (user, passwd, db);
         ~occiproc () throw (SQLException)
              env->terminateConnection (con);
              Environment::terminateEnvironment (env);
         void callproc ()
              cout << "callproc - invoking a PL/SQL procedure having IN, OUT and IN/OUT ";
              cout << "parameters" << endl;
              Statement *stmt = con->createStatement("BEGIN demo_proc(:1, :2, :3); END; ");
              cout << "Executing the block :" << "\"" << stmt->getSQL() << "\"" << endl;
              stmt->setInt (1, 10);
              stmt->setString (2, "IN");
              stmt->registerOutParam (2, OCCISTRING, 30, "");
              stmt->registerOutParam (3, OCCISTRING, 30, "");
              try {
                   int updateCount = stmt->executeUpdate ();
                   cout << "Update Count:" << updateCount << endl;
              } catch (SQLException &sqlExcp)
                   cerr <<sqlExcp.getErrorCode() << ": " << sqlExcp.getMessage() << endl;
                   exit(0);
              string c1 = stmt->getString (2);
              string c2 = stmt->getString (3);
              cout << "Printing the INOUT & OUT parameters:" << endl;
              cout << "Col2:" << c1 << " Col3:" << c2 << endl;
              con->terminateStatement (stmt);
              cout << "occiproc - done" << endl;
    int main (void)
         string user = "HR";
         string passwd = "HR";
         string db = "tmp";
         occiproc *demo = new occiproc (user, passwd, db);
         cout << "new occiproc successfull." << endl;
         demo->callproc();
         delete demo;

    thanks.
    I still can't resolve the problem according to your advice and I find an interesting thing.
    when I change the binding of parameters code and only use a OUT paramter in demo_proc store procedure,
    it still tell me 'ORA-01008: not all variables bound'; but when i change all parameters to IN paramters,
    it works well.
    In addition, my oracle version is 9.2.0.5.0 and AIX OS version is 5.2 .
    Regards,
    tenkoo

  • What is the diffrence between OCI and OCCI?

    What is the diffrence between OCI and OCCI?

    Will Lee wrote:
    What is the diffrence between OCI and OCCI?Beside the other answers, there are a few additional points to consider:
    1) OCI is the "gold" standard API. New stuff is always available in OCI first, and only later trickles down to other APIs, like OCCI.
    2) OCI is a low-level API, harder to get started with, than OCCI. APIs in OCI are often "untyped", taking a void*, which opens the door for errors.
    3) In OCCI you set values, while in OCI you bind them. So OCCI takes a copy of your values, while OCI takes an address at which to later read the value. This opens the door to subtle bugs where you pass the address of a temporary in OCI, which later crashes in some mysterious ways. So OCCI is way safer in this regard.
    4) OCI is C code, which is very portable. Because OCCI is C++ code, and on Windows you can't easily mix and match libraries compiled with different versions of Visual C++ (VC6, 7, 8, 9), you have to wait for Oracle to make a new build with the latest MS compiler. Just see the number of questions on this OCI forum and the OCCI one.
    5) OCI is used internally by Oracle to write many of their own tools, it's the lingua franca between the Core DB group and the other groups. Since they use it themselves, it's much more stable that OCCI, which is mostly only used by outside customers.
    6) The way SQL objects are dealt with in OCI and OCCI is fundamentally different, to the point where you can't mix and match OCCI and OCI object calls.
    #1 above is one reason we had to abandon using OCCI, lacked support for the new in 11g BinaryXML, but that's just one example.
    IMHO OCI is the way to go, if you want the latest and greatest. Yes, it's more difficult to code against, so the learning curve is steeper, but once you've reached critical mass it's just fine. If you write code in C++ as opposed to C, you can easily make it a lot safer with a thin C++ layer on top which, unlike OCCI, still allows you access any OCI raw handle to do stuff the wrappers don't expose. My $0.02 ;-) --DD                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • OCCI: Problem with CreateConnection() method

    I am using OCCI sdk for Oracle 10g database with VS2005. I am continuously getting an exception
    "An unhandled exception of type 'System.Runtime.InteropServices.SEHException' occurred in OCCITest.exe
    Additional information: External component has thrown an exception."
    I get this exception at line:
    user = "SYSTEM";
    pass = "abc123";
    db = "//127.0.0.1:1521/orcl";
         ->     con = env->createConnection(user, pass, db);
    I have seen lots of posts with people asking this question... i tried almost all the alternatives specified in those posts. Even my Sqlplus works with this connection string. In sql plus, i can connect using these credentials, can create a table, insert data... etc. But I just can't connect from VC++...
    For reference, I am pasting the entry in my tnsnames.ora file below:
    ORCL =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = orcl)
    I am using Vista machine. I have installed oracle 10g for vista. Can my OS be a problem? I will really appreciate the help...
    Regards,
    Jwalant

    This may be obvious, but please verify that you have first created the environment before calling CreateConnection...
    Environment *env = Environment::createEnvironment (Environment::DEFAULT);
    Connection *con = env->createConnection (<user>, <password>, <connStr>);                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Proper use of ConnectionPool in occi

    Hi,
    I am developing a client server application using Windows server 2003 x64, Oracle 11.1.0.6.0 client connecting to oracle 10.1.0.2.0 database, Visual studio 2008, visual c++ 9.
    The scenario is something like this,
    upon receiving the client request, the server executes a stored procedure as per the request. I have a number of classes thru which the stored procedure gets called. Currently, in every method of these classes, I am creating new connection to the database as follows..
    +Environment *env = Environment::createEnvironment(Environment::OBJECT);+
    +Connection *conn = env->createConnection( USERID, PASSWORD, ORACLESID );+
    But now I want to use a ConnectionPool to improve performance of the application.
    My question is, where do I create the ConnectionPool object so that it is accessible from all the methods of the classes?

    Got it!!
    I did the following..
    Declare the Environment and StatelessConnectionPool objects above main function.
    +oracle::occi::Environment *env;+
    +oracle::occi::StatelessConnectionPool *connPool;+
    +int tmain(int argc, TCHAR* argv[])+
    +{+
    +......+
    +}+
    Then declare these objects as EXTERN from wherever you want to access them.
    +extern oracle::occi::Environment *env;+
    +extern oracle::occi::StatelessConnectionPool *connPool;+
    +//Method that uses these objects+
    The objects can directly be used in the methods where the they are declared as 'extern'.
    Enjoy!

  • Instant Client SQL*Plus License Question

    Can anyone shed some light on a license question for me? (I know that most license questions are for Oracle Sales to handle, but this involves a supposedly free product.)
    I want to use SQL*Plus with the Instant Client in a production environment, but I am not sure whether I am entitled to. Does Instant Client "support" SQL*Plus only in the sense that if I already own a license for SQL*Plus I can use it with the Instant Client, or is the Instant Client SQL*Plus package also truly free to deploy and use?
    The download page has links to download a basic Instant Client, plus several optional packages, one of which is SQL*Plus. However, the FAQ does not tell me whether the optional packages (specifically SQL*Plus) is also free to deploy and use in a production environment, and I could not find any other helpful document.
    The FAQ says that "Instant Client is FREE for anyone to use in a development or production environment." It also says immediately following that "Instant Client can be used to run your OCI, OCCI, Pro*C, JDBC, and ODBC applications without installing a full Oracle Client. In addition, Instant Client supports SQL*Plus." [emphasis mine]
    I would appreciate any help on this.
    Thanks in advance,
    Anthony

    Why don't you call Oracle sales? I guess they'll be happy to answer your question.
    Yours,
    Laurenz Albe

  • Occi AQ callback not called

    I have written code for dequeing messages with blocking calls (Consumer::recieve), which works fine. Now I try to register a callback function, which should be called when a message is in the queue.
    Some code:
    void aq_connection::create_callback() {
    payload = new Bytes(env); //?
    Subscription newSubscription(env);
    newSubscription.setSubscriptionNamespace(oracle::occi::aq::Subscription::NS_AQ);
    newSubscription.setProtocol(oracle::occi::aq::Subscription::PROTO_CBK);
    newSubscription.setPayload(*payload);
    newSubscription.setCallbackContext((void *)this);
    newSubscription.setSubscriptionName(quename + ":" + config->subscribername);
    newSubscription.setPresentation(oracle::occi::aq::Subscription::PRES_DEFAULT);
    newSubscription.setNotifyCallback(&aq_connection::event_message);
    mye callback method is defined like this:
    static unsigned int event_message(oracle::occi::aq::Subscription &sub ,oracle::occi::aq::NotifyResult *not) {
    std::cout << "got message\n";
    return 0;
    The problem is, the event_message function is never called... I send in messages into the queue with this stored procedure:
    message := OURMSG_TYP(p_id, p_msg_type_id, p_msg, p_operation, p_data);
    enqueue_options.visibility := DBMS_AQ.ON_COMMIT;
         enqueue_options.relative_msgid := NULL;
         enqueue_options.sequence_deviation := NULL;
         enqueue_options.transformation := NULL;
         message_properties.priority := 1;
         message_properties.delay :=     DBMS_AQ.NO_DELAY;
         message_properties.expiration := p_expiration;
         message_properties.correlation := NULL;
         --message_properties.recipient_list :=
         message_properties.exception_queue := vcp_exception_queue_name;
         --message_properties.sender_id :=
         message_properties.original_msgid := NULL;
         message_properties.transaction_group := NULL;
         message_properties.user_property :=     NULL;
         DBMS_AQ.ENQUEUE(
         queue_name => our_queue_name,
    enqueue_options => enqueue_options,
    message_properties => message_properties,
    payload => message,
    msgid => message_handle
    Any obvious reason why my callback is never called?
    regards,
    Sverre

    Thanks, once again. Sorry for my naive questions, but I'm unable to find a good example for this...
    After registering the Subscriber, and creating the environment in EVENT mode, it seems like it is picking up the message. Once I send a AQ message, I get an error from visual studio, telling me the variable ESP was not properly saved across a function call. At least it reacts now :)
    Could it be that I'm doing something wrong when defining or hooking my callback function? The breakpoint in the callback function is never called....
    my registering routine now looks like this:
    void aq_connection::create_callback() {
    payload = new Bytes(env); //is this the correct way?
    Subscription sub(env);
    sub.setSubscriptionNamespace(oracle::occi::aq::Subscription::NS_AQ);
    sub.setProtocol(oracle::occi::aq::Subscription::PROTO_CBK);
    sub.setPayload(*payload);
    sub.setCallbackContext((void *)this);
    sub.setSubscriptionName(quename + ":" + config->subscribername);
    sub.setPresentation(oracle::occi::aq::Subscription::PRES_DEFAULT);
    sub.setNotifyCallback(&aq_connection::event_message);
    subs.push_back(sub);
    conn->registerSubscriptions(subs);
    I thought it was ok to create a local Subscription instance, as I put it into the global subs-vector.
    Thanks in advance,
    Sverre

  • OCCI AQ Subscription: callback not called

    When data changed in table, I want my application to know immediately. So I use the Subsription class. The implements as follows. When I insert row to table set_tab_info, the triggers acts, but the callback not called. What's wrong?
    --create multi consumer queue table
    BEGIN
    dbms_aqadm.create_queue_table (
                                       queue_table => 'hr.table06',
                                       queue_payload_type => 'RAW',
                                       comment => 'multi-consumer',
                                       multiple_consumers => TRUE,
                                       compatible => '8.1.0'
    END;
    --create multi consumer queue
    BEGIN
    dbms_aqadm.create_queue (
                                  queue_name => 'queue06',
                                  queue_table=> 'hr.table06'
    END;
    BEGIN
    dbms_aqadm.start_queue(queue_name => 'queue06');
    END;
    --create table
    CREATE TABLE set_tab_info(
         flag NUMBER
    --create trigger, as a test, the payload is a byte
    CREATE OR REPLACE TRIGGER tablechangeNew
         AFTER UPDATE OR INSERT OR DELETE
         ON set_tab_info
         FOR EACH ROW
    DECLARE
         enqopt dbms_aq.enqueue_options_t;
         mprop dbms_aq.message_properties_t;
         enq_msgid RAW(16);
         rcpt_list dbms_aq.aq$_recipient_list_t;
    BEGIN
         rcpt_list(0) := sys.aq$_agent('RECEIVER06', null, null);
         mprop.recipient_list := rcpt_list;
         dbms_aq.enqueue(
                        queue_name => 'hr.queue06',
                        enqueue_options => enqopt,
                        message_properties => mprop,
                        payload => HEXTORAW('61'),
                        msgid => enq_msgid);
    END;
    #include <iostream>
    #include <iomanip>
    #include <string>
    #include <cstdlib>
    #include <vector>
    using namespace std;
    #include "occi.h"
    using namespace oracle::occi;
    #include "occiAQ.h"
    using namespace oracle::occi::aq;
    string username("HR");
    string password("HR");
    string connstr("192.168.8.22:1521/study");
    Environment* p_env = NULL;
    Subscription* p_sub = NULL;
    Connection* p_conn = NULL;
    vector<Subscription> sub_vec;
    class NotifyRegister
    public:
         static unsigned int callback(Subscription& sub, NotifyResult* nr)
              //nr->getPayload();
              //Message msg = nr->getMessage();
              //Bytes bt =nr->getMessageId();
              cout << "callback was called!" << endl;
              return 0;
         void notifyTest()
              p_env = Environment::createEnvironment(Environment::EVENTS);
              p_sub = new Subscription(p_env);
              p_sub->setSubscriptionNamespace(Subscription::NS_AQ);
              //SCHEMA.QUEUE:CONSUMER_NAME
              p_sub->setSubscriptionName("HR.QUEUE06:RECEIVER06");
              p_sub->setPresentation(Subscription::PRES_DEFAULT);
              p_sub->setProtocol(Subscription::PROTO_CBK);
              p_sub->setNotifyCallback(&NotifyRegister::callback);
              //what's the context mean, how to set?
              p_sub->setCallbackContext((void*)this);
              p_env->enableSubscription(*p_sub);
              p_conn = p_env->createConnection(username, password, connstr);
              sub_vec.push_back(*p_sub);
              p_conn->registerSubscriptions(sub_vec);
    int main()
         NotifyRegister nr;
         nr.notifyTest();
         pause();
         return EXIT_SUCCESS;
    I don't know how to set the callback context. so just use this statement:
    p_sub->setCallbackContext((void*)this);

    Thanks, once again. Sorry for my naive questions, but I'm unable to find a good example for this...
    After registering the Subscriber, and creating the environment in EVENT mode, it seems like it is picking up the message. Once I send a AQ message, I get an error from visual studio, telling me the variable ESP was not properly saved across a function call. At least it reacts now :)
    Could it be that I'm doing something wrong when defining or hooking my callback function? The breakpoint in the callback function is never called....
    my registering routine now looks like this:
    void aq_connection::create_callback() {
    payload = new Bytes(env); //is this the correct way?
    Subscription sub(env);
    sub.setSubscriptionNamespace(oracle::occi::aq::Subscription::NS_AQ);
    sub.setProtocol(oracle::occi::aq::Subscription::PROTO_CBK);
    sub.setPayload(*payload);
    sub.setCallbackContext((void *)this);
    sub.setSubscriptionName(quename + ":" + config->subscribername);
    sub.setPresentation(oracle::occi::aq::Subscription::PRES_DEFAULT);
    sub.setNotifyCallback(&aq_connection::event_message);
    subs.push_back(sub);
    conn->registerSubscriptions(subs);
    I thought it was ok to create a local Subscription instance, as I put it into the global subs-vector.
    Thanks in advance,
    Sverre

  • Dequeue with OCCI does not remove the message from the queue

    Hey there,
    I have this problem where no matter what dequeue option I try the messages never seem to be removed from the queue... I tried looking around and found only a similar un-answered question...
    Thanks in advance...
    void TryAnydataDequeue(oracle::occi::Connection * conn)
         try
              std::cout << "Dequeue Commence..." << std::endl;
              Consumer cons(conn);
              //Settings de dequeue
              cons.setCorrelationId("SPPC");
              cons.setQueueName("Anydata_queue");
              cons.setConsumerName("SNOOP");
              cons.setDequeueMode(cons.DEQ_REMOVE);
              //cons.setDequeueMode(cons.DEQ_LOCKED);
              std::cout << "Reception du message..." << std::endl;
              Message m2 = cons.receive(Message::ANYDATA);
              AnyData any(conn);
              any = m2.getAnyData();
              if(!any.isNull())
                   oracle::occi::TypeCode type = any.getType();
                   if(type == OCCI_TYPECODE_VARCHAR2)
                        std::string msg = any.getAsString();
                        std::cout << "Message Reçu: ";
                        std::cout << msg << std::endl;
                   else
                        std::cout << "Format du message invalide..." << std::endl;
                   std::cout << "Fin du message... (Press a key)" << std::endl;
              else
                   std::cout << "Message invalide..." << std::endl;
              System::String * theInput = System::Console::ReadLine();
         catch(SQLException ex)
              std::cout << "Exception: " << ex.getErrorCode() << " - " << ex.getMessage() << std::endl;
              System::String * tnput = System::Console::ReadLine();
    }

    The message from the queue will be removed when you do a commit after a successful dequeue call, depending upon your message retention settings.
    After you have done this processing and successfully performed a commit, what is the output of the following query:
    SQL> connect AQADMIN/password
    SQL> select msg_state from aq$<your_queue_table_name_goes_here> ;?
    If it is PROCESSED, check your queue retention settings.
    Additionally, make sure that the init.ora parameter AQ_TM_PROCESSES is set to a NON-ZERO value for this to happen.

  • How to map error from OCCI class SQLException?

    when catching an OCCI error for unique constraint violation (ORA-00001), I print out the error code (class SQLException method getErrorCode()) and it shows 21527.
    Is that expected (I was expecting the error code to be 1...)? And, if so, is there any mapping between SQL error codes and error codes returned by the exception class?

    I would avoid using hardcoded absolute paths like that if you can and try to use relative paths. I mean what if your app is hosted on a linux machine? It wont even have a c:.
    I am not exactly sure what your question is asking, it's kind of hard to understand....

Maybe you are looking for