OCCI problem with Borland

I try to compile OCCI example with Borland C and receiving this error in occiCommon.h:
typedef OCCI_STD_NAMESPACE::basic_string<utext> UString;
1) Too few arguments in template class name 'basic_string'
2)Declaration terminated incorrectly

I have the same task: using OCCI class in Borland C++Builder (v6) environment. Unfortunately, the only version of OCCI-class prepared by Oracle is for MS VC++. No one tool translate that, does not matter, whether you use ORAOCCI.DLL and implib.exe or ORAOCCI9.LIB and coff2omf.exe.

Similar Messages

  • Re: Fwd: Link Problems With Borland C++ 4.52

    I have seen this problem before in another context, and I'll offer the
    cause and solution in the hope that they will apply to the Crystal problem.
    Many Windows based applications rely on PASCAL calling conventions, which
    change the way parameters are handled in function/method calls. They
    indicate this by placing one of the following immediately before the
    function name in the prototype declarations:
    - pascal_far (or something like that)
    - WINAPI
    - some other typedef of either of the above
    For example:
    int WINAPI AddTotal(int valueA, int valueB);
    Unfortunately, v2.0 of Forte does not provide any mechanisms for changing
    the calling conventions of the prototypes in the generated C++ wrapper
    library, so when you compile that code, the linker fails. I think that the
    compiler may generate different symbols depending on calling conventions,
    so that's why it fails.
    To fix this, don't autocompile your code, but generate the distribution, go
    into the generated C++ files and look for the function prototypes (I think
    you can search for FORTE_NO_PROTOTYPES), add WINAPI to the appropriate
    places in the prototype definitions (see above) and use fcompile to build
    the library. Instructions for fcompile are in the Interfacing With
    External Systems manual.
    Hope this helps,
    James
    At 11:05 AM 5/29/97 PDT, you wrote:
    >
    We are trying to wrapper Crystal Reports from Forte. I know that there
    are a number of other people in this same boat, as I've seen messages
    posted here at various points during the past few weeks. We are having
    a particular problem with getting the compile to go through, which we
    have sent in to Forte Tech Support. I'm forwarding the message I sent
    Tech Support to this group in the hopes that someone here may have
    already seen and resolved a similar problem.
    Thanks in advance for any help you can offer!
    Dale V. Georg
    Indus Consultancy Services [email protected]
    Mack Trucks, Inc. [email protected]
    >
    Date: Wed, 28 May 97 13:47:20 PDT
    From: dg7077a
    To: Forte Technical Support
    Cc: Gardner, Steve
    Subject: Link Problems With Borland C++ 4.52
    Name of requestor: [Dale V. Georg / Alaiah Chandrashekar]
    Company: [Indus Consultancy Services]
    Phone for callback: [(610) 709-3956]
    Customer Site: [Mack Trucks, Inc.]
    Product: [Forte]
    Version of Forte: [2.0.H.1]
    Server OS: [SunOS 5.5.1]
    Client OS: [Windows 3.1]
    DBMS: [Oracle 7.2.3]
    Reproducible?: [Yes]
    Brief description: [Link Problems With Borland C++ 4.52]
    Complete description of problem or question:
    We are attempting to write a C-wrapper interface from Forte to Crystal
    Reports' Report Engine. We are using Borland C++ version 4.52.
    Unfortunately, we have been unable to get a clean compile after a day
    and half of effort. We get as far as the link stage of the
    compilation, and
    the compiler aborts with an "Unknown symbol" error message for each
    of the functions we are trying to wrapper. We have tried a number of
    ideas to fix this problem, and are continuing to try to solve it on
    our own,
    but any help would be greatly appreciated. Please have someone call
    Alaiah Chandrashekar at the number above as soon as possible.
    Thanks!
    Dale V. Georg
    Indus Consultancy Services [email protected]
    Mack Trucks, Inc. [email protected]
    James Urquhart [email protected]
    Product Manager phone: (510) 986-3513
    Forte Software, Inc. fax: (510) 869-2092

    James,
    Thanks for your quick response. Yesterday we had been running down
    the path of examining the calling conventions and trying to change them
    to PASCAL, but without much success. After receiving your note, we
    went back over it again, and this time we were able to finally to piece it
    together. In addition to editing the Forte-generated .cc file to declare
    the functions as PASCAL, we also had to turn off the compiler's case
    sensitivity. (The Crystal .lib file had the function names in mixed case,
    but the Borland compiler was generating all uppercase for the names.)
    Now I had actually tried this yesterday and it didn't work (in fact it
    generated a whole bunch of new errors) - because until we took a
    second look at it today, I didn't realize that Borland's linker actually has
    TWO flags that control case sensitivity. If you only turn one or the
    other off, things can get pretty ugly looking. As soon as we turned
    both of them off, the compile and link went beautifully. Again, thanks
    for your help; hopefully we are over the worst of it now!
    Dale
    I have seen this problem before in another context, and I'll offer the
    cause and solution in the hope that they will apply to the Crystalproblem.
    >
    Many Windows based applications rely on PASCAL callingconventions, which
    change the way parameters are handled in function/method calls.They
    indicate this by placing one of the following immediately before the
    function name in the prototype declarations:
    - pascal_far (or something like that)
    - WINAPI
    - some other typedef of either of the above
    For example:
    int WINAPI AddTotal(int valueA, int valueB);
    Unfortunately, v2.0 of Forte does not provide any mechanisms forchanging
    the calling conventions of the prototypes in the generated C++wrapper
    library, so when you compile that code, the linker fails. I think thatthe
    compiler may generate different symbols depending on callingconventions,
    so that's why it fails.
    To fix this, don't autocompile your code, but generate thedistribution, go
    into the generated C++ files and look for the function prototypes (I think
    you can search for FORTE_NO_PROTOTYPES), add WINAPI tothe appropriate
    places in the prototype definitions (see above) and use fcompile tobuild
    the library. Instructions for fcompile are in the Interfacing With
    External Systems manual.
    Hope this helps,
    James
    At 11:05 AM 5/29/97 PDT, you wrote:
    We are trying to wrapper Crystal Reports from Forte. I know that
    there
    are a number of other people in this same boat, as I've seenmessages
    posted here at various points during the past few weeks. We arehaving
    a particular problem with getting the compile to go through, whichwe
    have sent in to Forte Tech Support. I'm forwarding the message Isent
    Tech Support to this group in the hopes that someone here mayhave
    already seen and resolved a similar problem.
    Thanks in advance for any help you can offer!
    Dale V. Georg
    Indus Consultancy Services [email protected]
    Mack Trucks, Inc.
    [email protected]
    >
    >>
    Date: Wed, 28 May 97 13:47:20 PDT
    From: dg7077a
    To: Forte Technical Support
    Cc: Gardner, Steve
    Subject: Link Problems With Borland C++ 4.52
    Name of requestor: [Dale V. Georg / AlaiahChandrashekar
    Company: [Indus Consultancy Services]
    Phone for callback: [(610) 709-3956]
    Customer Site: [Mack Trucks, Inc.]
    Product: [Forte]
    Version of Forte: [2.0.H.1]
    Server OS: [SunOS 5.5.1]
    Client OS: [Windows 3.1]
    DBMS: [Oracle 7.2.3]
    Reproducible?: [Yes]
    Brief description: [Link Problems With Borland C++ 4.52]
    Complete description of problem or question:
    We are attempting to write a C-wrapper interface from Forte to
    Crystal
    >>
    Reports' Report Engine. We are using Borland C++ version 4.52.
    Unfortunately, we have been unable to get a clean compile after aday
    and half of effort. We get as far as the link stage of the
    compilation, and
    the compiler aborts with an "Unknown symbol" error message foreach
    of the functions we are trying to wrapper. We have tried a numberof
    ideas to fix this problem, and are continuing to try to solve it on
    our own,
    but any help would be greatly appreciated. Please have someonecall
    Alaiah Chandrashekar at the number above as soon as possible.
    Thanks!
    Dale V. Georg
    Indus Consultancy Services [email protected]
    Mack Trucks, [email protected]
    James Urquhart [email protected]
    Product Manager phone: (510) 986-3513
    Forte Software, Inc. fax: (510) 869-2092-----------------------------------------------------------------------------------
    Dale V. Georg
    Indus Consultancy Services [email protected]
    Mack Trucks, Inc. [email protected]
    [email protected]------------------

  • Fwd: Link Problems With Borland C++ 4.52

    We are trying to wrapper Crystal Reports from Forte. I know that there
    are a number of other people in this same boat, as I've seen messages
    posted here at various points during the past few weeks. We are having
    a particular problem with getting the compile to go through, which we
    have sent in to Forte Tech Support. I'm forwarding the message I sent
    Tech Support to this group in the hopes that someone here may have
    already seen and resolved a similar problem.
    Thanks in advance for any help you can offer!
    Dale V. Georg
    Indus Consultancy Services [email protected]
    Mack Trucks, Inc. [email protected]
    Date: Wed, 28 May 97 13:47:20 PDT
    From: dg7077a
    To: Forte Technical Support
    Cc: Gardner, Steve
    Subject: Link Problems With Borland C++ 4.52
    Name of requestor: [Dale V. Georg / Alaiah Chandrashekar]
    Company: [Indus Consultancy Services]
    Phone for callback: [(610) 709-3956]
    Customer Site: [Mack Trucks, Inc.]
    Product: [Forte]
    Version of Forte: [2.0.H.1]
    Server OS: [SunOS 5.5.1]
    Client OS: [Windows 3.1]
    DBMS: [Oracle 7.2.3]
    Reproducible?: [Yes]
    Brief description: [Link Problems With Borland C++ 4.52]
    Complete description of problem or question:
    We are attempting to write a C-wrapper interface from Forte to Crystal
    Reports' Report Engine. We are using Borland C++ version 4.52.
    Unfortunately, we have been unable to get a clean compile after a day
    and half of effort. We get as far as the link stage of the
    compilation, and
    the compiler aborts with an "Unknown symbol" error message for each
    of the functions we are trying to wrapper. We have tried a number of
    ideas to fix this problem, and are continuing to try to solve it on
    our own,
    but any help would be greatly appreciated. Please have someone call
    Alaiah Chandrashekar at the number above as soon as possible.
    Thanks!
    Dale V. Georg
    Indus Consultancy Services [email protected]
    Mack Trucks, Inc. [email protected]
    -------------

    We are trying to wrapper Crystal Reports from Forte. I know that there
    are a number of other people in this same boat, as I've seen messages
    posted here at various points during the past few weeks. We are having
    a particular problem with getting the compile to go through, which we
    have sent in to Forte Tech Support. I'm forwarding the message I sent
    Tech Support to this group in the hopes that someone here may have
    already seen and resolved a similar problem.
    Thanks in advance for any help you can offer!
    Dale V. Georg
    Indus Consultancy Services [email protected]
    Mack Trucks, Inc. [email protected]
    Date: Wed, 28 May 97 13:47:20 PDT
    From: dg7077a
    To: Forte Technical Support
    Cc: Gardner, Steve
    Subject: Link Problems With Borland C++ 4.52
    Name of requestor: [Dale V. Georg / Alaiah Chandrashekar]
    Company: [Indus Consultancy Services]
    Phone for callback: [(610) 709-3956]
    Customer Site: [Mack Trucks, Inc.]
    Product: [Forte]
    Version of Forte: [2.0.H.1]
    Server OS: [SunOS 5.5.1]
    Client OS: [Windows 3.1]
    DBMS: [Oracle 7.2.3]
    Reproducible?: [Yes]
    Brief description: [Link Problems With Borland C++ 4.52]
    Complete description of problem or question:
    We are attempting to write a C-wrapper interface from Forte to Crystal
    Reports' Report Engine. We are using Borland C++ version 4.52.
    Unfortunately, we have been unable to get a clean compile after a day
    and half of effort. We get as far as the link stage of the
    compilation, and
    the compiler aborts with an "Unknown symbol" error message for each
    of the functions we are trying to wrapper. We have tried a number of
    ideas to fix this problem, and are continuing to try to solve it on
    our own,
    but any help would be greatly appreciated. Please have someone call
    Alaiah Chandrashekar at the number above as soon as possible.
    Thanks!
    Dale V. Georg
    Indus Consultancy Services [email protected]
    Mack Trucks, Inc. [email protected]
    -------------

  • Problem with Borland Builder C++ AND NI-DAQ 6.9.3

    Hello,
    I am trying to porting a Data Acquisition application developed with Borland Builder 4.0 and NI-DAQ 6.5.1, changing data acquisition Hardware. Now I am using PCI - 6036E, with Ni driver version 6.9.3. My s.o. is Windows XP Professional.
    When I link application with nidaq32b.lib and nidex32b.lib and launch my EXE, without call any DAQ function, when I close my window PC is resetting! If I try to use Ni driver version 7.0 or 7.3, I obtain a GP fault as soon I start program.
    I think that there are problem of disallineament or other inside file EXE generated. I have tried to generate new file lib with implib utility from DLL, but with the same result.
    If anyone cannot help me, I think to substitute call to DAQ functions inside C code with DLL or EXE developed in Visual Basic.
    Can anyone give me any help for this? Is it better use VB 4.0 or VB 6.0?
    Thank you for your attention.
    Fabrizio

    Hi,
    I would definitely suggest to create the dll in VB6. There are shipping examples for VB6, so that you can see how it looks to program in VB6 with DAQ. These examples can be found at C:\Program Files\National Instruments\NI-DAQ\Examples\VBasic.
    I hope this helps. Have a Great Day!
    George

  • 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>);                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Problem with OCCI

    Hi,
    I have a problem with OCCI, when i create the connection the following exception appears:
    ORA-24960 - the attribute OCI_ATTR_USERNAME is greater than the maximum allowable length of 255.
    A piece of code:
    string userName;
         string password;
         string connectionString;
         userName = "lucas";
         password = "lucas";
         connectionString = "lucas"
         printf("Imprimindo o valor das váriaveis \n\n");
         printf("User name --");
         printf(userName.c_str());
         printf("\n");
         printf("Password --");
         printf(password.c_str());
         printf("\n");
         printf("Connection String --");
         printf(connectionString.c_str());
         printf("\n\n");
         Environment *env;
         Connection *cn;
         try{          
              printf("Criando Environment. \n");
              env = Environment::createEnvironment(Environment::DEFAULT);
              printf("Environment criado. \n");
         }catch(SQLException e){
              printf(e.what());
              printf("\n");
         try{          
              printf("Criando Connection.\n");
              cn = env->createConnection(userName.c_str(),password.c_str(),connectionString.c_str()); \\ Exception happens here
              printf("Connection criada. \n");
         }catch(SQLException e){
         printf(e.what());
              printf("\n");
    TKs.
    Lucas

    hello,i have the same problem,now i havn't overcome the problem.
    i think that the problem is the system envirment path problem.
    or the instant client problem.

  • Problem with Application Login after upgrading to Oracle 11g

    I have a home-grown application with Oracle 10g database running under Windows XP Pro. Recently, I installed Oracle 11g and imported the application database from 10g to 11g (still want to keep the 10g running for a while). However, I now having problem with the application logging into the new 11g database. (Keep getting invalid user/name message).
    BTW, I have no problem accessing the 11g database through SQLPlus (logging in with the same name and password that I use for the application), and the connection test of NetManager (again using the same name and password that I use for the application) was successful.
    The application itself uses the old Borland BDE (Borland Database Engine) to access the 10g and 11g database. Testing confirms that BDE can access Oracle 11g with no problems.
    Any idea about the probable cause(s) of the problem?
    Thanks in advance,
    sg2000

    11g by default is case sensitive username/password.
    You can disable that with setting parameter SEC_CASE_SENSITIVE_LOGON to false.
    SQL> SHOW PARAMETER SEC_CASE_SENSITIVE_LOGON
    SQL> ALTER SYSTEM SET SEC_CASE_SENSITIVE_LOGON = FALSE;

  • Problem with OCI call  and  how to install and use 'DEBUG_EXTPROC' on Linux

    Hi,
    Can any one let me know how I can install and use this debug_extproc package. I have installed oracle XE server on Linux machine(32-bit).
    When I use : DEBUG_EXTPROC.STARTUP_EXTPROC_AGENT' ... i get an error saying that : it is not declared.
    I tried looking in all the directories but did not find the dbgextp.sql(which is required in order to install that package).And tried searching on google but could not get any relevant information.
    Also I am newbie to OCI call interface and also to C programming too: I have coded a external procedure or custom user aggregate in C. But since I was using C++ : 'set' STL. I have compiled my program using g++ instead of gcc and I have correspondingly modified the make file in public/demo directory.
    So, is it fine to do it that way: using OCI (instead of OCCI(C++)) but again compiling the pgm as a regular C++ using g++ instead of gcc.(But rest of the pgm including printf statements : everything is in C).
    Also I have created the library from my : custagg.so library:
    SQL> create or replace library custagg is '$ORACLE_HOME/lib/custagg.so'
    But my aggregate function implemented as external C function using OCI is either not recognised or else : if recognized then there is some error because of which i am getting the following errors : ORA-06522
    SQL> select MinDistance(TT) from egg1;
    select MinDistance(TT) from egg1
    ERROR at line 1:
    ORA-06520: PL/SQL: Error loading external library
    ORA-06522: /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/lib/custagg.so:
    cannot dynamically load executable
    Please kindly answers my queries and trying to resolve this for almost 4 days now and could not find any clue on how to get this done.
    Thanks,
    -NN

    #/bin/make
    # Make file for OCI,OCCI and ODBC demos
    # Usage :
    # For compiling & linking the cdemo81.c file
    # make -f demo_xe.mk buildoci CDEMOEXE=cdemo81 CDEMOOBJS=cdemo81.o
    .SUFFIXES: .o .c .cpp
    ICINCHOME=$(ORACLE_HOME)/rdbms/public/
    ICLIBHOME=$(ORACLE_HOME)/lib
    ICLIBPATH=-L$(ICLIBHOME)
    THREADLIBS=-lthread
    CCLIB=$(ICLIBPATH) -lclntsh $(THREADLIBS)
    OCCILIB=$(ICLIBPATH) -locci -lclntsh $(THREADLIBS)
    CCINCLUDES = -I$(ICINCHOME)
    CCFLAGS=$(CCINCLUDES) -D_REENTRANT -g -xs
    LDFLAGS=
    SO_EXT=.so
    EXTLDFLAGS=$(LDFLAGS) -shared
    REMOVE=rm -rf
    MKLINK=ln
    MAKE=make
    MAKEFILE=demo_xe.mk
    CDEMOEXE=custagg.so
    CDEMOOBJS=custagg.o
    OCCIDEMO=occidml
    OCCIOBJDEMO=occiobj
    OTT=$(ORACLE_HOME)/bin/ott
    OCCIOTTUSR=hr
    OCCIOTTPWD=hr
    ODBCDEMOEXE=odbcdemo
    ODBCDEMOOBJS=odbcdemo.o
    AQDEMOEXE=ociaqdemo00
    AQDEMOOBJS=ociaqdemo00.o
    EXTDEMO=extdemo2.so
    CC=/usr/bin/g++
    echo "LIBCLNT value is :" $(LIBCLNT)
    echo "CC value is :" $(CC)
    .c.o:
    g++ -c -I$(ICINCHOME) $(CCFLAGS) $<
    all: clean buildoci
    echo "LIBCLNT value is :" $(LIBCLNT)
    buildoci: $(LIBCLNT) $(CDEMOOBJS)
    g++ -o $(CDEMOEXE) $(LDFLAGS) $(CDEMOOBJS) $(CCLIB)
    echo "CC value is :" $(CC)
    echo "LIBCLNT value is :" $(LIBCLNT)
    clean:
    $(REMOVE) $(CDEMOOBJS) $(CDEMOEXE)
    # This port-specific file is currently empty on Solaris. Product
    # lines may use this file to override compiler definitions and
    # flags used in occi.mk.
    # Linux compiler definitions
    CC=/usr/bin/gcc
    cc=/usr/bin/gcc
    CCFLAGS=$(CCINCLUDES) -DLINUX -D_GNU_SOURCE -D_REENTRANT -g
    LDFLAGS=-g
    # This macro CCINCLUDES has to be redefined on Linux because of
    # the existence of the 'new' directory in t_work. The name new
    # clashes with a system header file.
    CCINCLUDES = -idirafter .
    THREADLIBS=-lpthread
    ifdef BUILD_CCC296
    CC=/usr/bin/g++296
    endif
    And I am executing the make file using the command :
    make -f demo12.mk buildoci CDEMOEXE=custagg.so CDEMOOBJS=custagg.o
    I am not getting any error while running this make file.
    Can you please tell me whether PLSQL/Oracle is able to locate the file or not. Incase, if it is locating the file but due to some error in the custagg.so it is throwing that error. If this is the case, is there any way that i can debug the C program .....how can i install the debug_extproc package.. I am really new to C & OCI ... if the custagg.so is being located then there might be some problem with the way I am dynamically allocating memory to some variables.
    Please kindly reply to this Post/response.
    Please let me know if you also want to see my program code.
    Thanks & Regards,
    -NN

  • Using NI-DAQ with Borland C++ 5.01

    Hi,
    I've got a problem using Ni-DAQ with Borland C++ 5.01 (i know this section is for visual C++ but I couldm't find any for ANSI C++). If I write a simple program with one of the libraries included in nidaq.h and if i specify the correct lib and include locations I have a problem with the linkink process; in particular it says that the function can be resolved...
    If anyone can help me I would appreciate it. Thanx
    Optoclasfo

    Hey optoclasfo,
    I haven't used Borland much, but with Visual C++ the problem normally
    happens because the lib and include paths are not added to the
    project. For Visual C++ they are stored at
    Tools->Options->Directories. If the library files (*.lib) are not
    added to the project you can get this error as well.
    I hope this helps out.
    Joshua P.
    Application Engineering
    National Instruments

  • Problem with embedded objects

    Hi,
    I have problem with embedded objects which contained embedded objects.
    When I create an Object in the persistent memory and commit this object I get the following error:
    ORA-22805: cannot insert NULL object into object tables or nested tables
    In the constructor of my persisten object I create the embedded members in the transient memory:
    ATestPersObj::ATestPersObj() : m_count(0), m_lang(NULL), m_cost(NULL) {
      m_lang = new AEnumLanguage_OraType();
      m_cost = new AAmount_OraType();
    }Or when I dereference a reference I get this error:
    ORA-00600: internal error code, arguments: [kokeicadd2], [16], [5], [], [], [], [], []
    Can somebody give me a hint?
    I've defined the following Type:
    CREATE OR REPLACE TYPE AENUM_ORATYPE AS OBJECT (
                             VALUE  NUMBER(10,0)
                           ) NOT FINAL ;
    CREATE OR REPLACE TYPE AENUMLANGUAGE_ORATYPE UNDER AENUM_ORATYPE (
                           ) FINAL " );
    CREATE OR REPLACE TYPE ACURRENCY_ORATYPE AS OBJECT (
                             ISONR          NUMBER(5,0)
                           ) FINAL ;
    CREATE OR REPLACE TYPE AAMOUNT_ORATYPE AS OBJECT (
                             CCY        ACURRENCY_ORATYPE,
                             LO32BITS   NUMBER(10,0),
                             HI32BITS   NUMBER(10,0)
                           ) NOT FINAL ;
    CREATE OR REPLACE TYPE ATESTPERSOBJ AS OBJECT (
                             COUNT    NUMBER(4),
                             LANG     AENUMLANGUAGE_ORATYPE,
                             COST     AAMOUNT_ORATYPE   
                           ) FINAL ;
    oracle::occi::Ref<ATestPersObj> pObjR = new(c.getConnPtr(), "TTESTPERSOBJ") ATestPersObj();
    pObjR->setCount(i+2001);
    pObjR->setLang(AEnumLanguage(i+1));
    pObjR->setCost(AAmount(ACurrency(), 2.5));
    c.commit();
    c.execQueryRefs("SELECT REF(a) FROM TTESTPERSOBJ a", persObjListR);
    len = persObjListR.size();
    {for (int i = 0; i < len; i++) {  
      oracle::occi::Ref<ATestPersObj> pObjR = persObjListR;
    pObjR->getCount();
    pObjR->getLang();
    c.commit();
    With kind regards
    Daniel
    Message was edited by:
    DanielF
    Message was edited by:
    DanielF

    Hi,
    I have problem with embedded objects which contained embedded objects.
    When I create an Object in the persistent memory and commit this object I get the following error:
    ORA-22805: cannot insert NULL object into object tables or nested tables
    In the constructor of my persisten object I create the embedded members in the transient memory:
    ATestPersObj::ATestPersObj() : m_count(0), m_lang(NULL), m_cost(NULL) {
      m_lang = new AEnumLanguage_OraType();
      m_cost = new AAmount_OraType();
    }Or when I dereference a reference I get this error:
    ORA-00600: internal error code, arguments: [kokeicadd2], [16], [5], [], [], [], [], []
    Can somebody give me a hint?
    I've defined the following Type:
    CREATE OR REPLACE TYPE AENUM_ORATYPE AS OBJECT (
                             VALUE  NUMBER(10,0)
                           ) NOT FINAL ;
    CREATE OR REPLACE TYPE AENUMLANGUAGE_ORATYPE UNDER AENUM_ORATYPE (
                           ) FINAL " );
    CREATE OR REPLACE TYPE ACURRENCY_ORATYPE AS OBJECT (
                             ISONR          NUMBER(5,0)
                           ) FINAL ;
    CREATE OR REPLACE TYPE AAMOUNT_ORATYPE AS OBJECT (
                             CCY        ACURRENCY_ORATYPE,
                             LO32BITS   NUMBER(10,0),
                             HI32BITS   NUMBER(10,0)
                           ) NOT FINAL ;
    CREATE OR REPLACE TYPE ATESTPERSOBJ AS OBJECT (
                             COUNT    NUMBER(4),
                             LANG     AENUMLANGUAGE_ORATYPE,
                             COST     AAMOUNT_ORATYPE   
                           ) FINAL ;
    oracle::occi::Ref<ATestPersObj> pObjR = new(c.getConnPtr(), "TTESTPERSOBJ") ATestPersObj();
    pObjR->setCount(i+2001);
    pObjR->setLang(AEnumLanguage(i+1));
    pObjR->setCost(AAmount(ACurrency(), 2.5));
    c.commit();
    c.execQueryRefs("SELECT REF(a) FROM TTESTPERSOBJ a", persObjListR);
    len = persObjListR.size();
    {for (int i = 0; i < len; i++) {  
      oracle::occi::Ref<ATestPersObj> pObjR = persObjListR;
    pObjR->getCount();
    pObjR->getLang();
    c.commit();
    With kind regards
    Daniel
    Message was edited by:
    DanielF
    Message was edited by:
    DanielF

  • Linker problem with M series card

    I am attempting to incorporate a PCI 625 DAQ M series card into a Borland C++Builder application. To get started I have used the code from the example "ContAccelSamps-IntClk-AnlgStart" in the documentation. I have added "nidaq32.lib" to the project and included "nidaq.h" and "NIDAQmx.h" as in the example.
    Everything compiles correctly. However on linking I get the error message "NIDAQ32.LIB contains invalid OMF record, type 0x21 (possibly COFF). I am not sure what this means.
    Is this a bug in NIDAQ32.LIB or am I missing something simple here?
    In an attempt to resolve the problem I have rebuilt the library from the dll, but this doesn't work either, the new library is only 215 KB whereas the original one is 886 KB.
    So as a su
    bsidiary question might I ask how you build libraries from NI dlls.

    Hello,
    I apologize for the confusion around this. Currently, the NI-DAQmx C import library for Borland is only installed with LabWindows/CVI DAQ support. However, I am attaching the NI-DAQmx 7.3 import library that you will need for Borland support. We are working on posting this in a Knowledge Base on our website. Here is a link to another discussion forum thread in which a customer used with borland's "coff2omf" to work-around the linker issues they were seeing. This link also discusses another problem you may run into with floating point initialization that you may need to take into account. Hopefully this information will enable you to get your application working with Borland and M Series. If not, please let us know.
    http://exchange.ni.com
    /servlet/ProcessRequest?RHIVEID=101&RPAGEID=137&HOID=5065000000050000005EC50100&HTHREAD=000116062&UCATEGORY_0=_30_%24_12_&UCATEGORY_S=0
    thanks,
    Nicole
    Attachments:
    NIDAQmx.lib ‏487 KB

  • Problems with PrintPanel​/PrintCtrl

    Hi
    I have a very strange Problem with the Print-Functions!!!!
    Since 1 week I have to use C++ Builder 3.0 from Borland
    on my PC for development! I installed BC++3.0 and some Components!
    Now I have the Problems with the Printfunctions!
    If i call one, the programm hangs up with the message!
    Error in Module GDI.exe!?!
    Does anyone have the same experience or knows anyone a solution for my problem?
    Thanks a lot
    chris

    Hi Csound1
    approx every 30 seconds the browser freezes and 'saving' appears in the top bar of icloud mail. The cursor starts spinning and then after about 8 secs I can start typing again. I also fiund that about 5-6 times a day my icloud browser tab showing mail just close and return to the main icloud menu page showing icons for mail, calender, notes etc

  • A problem with threads

    I am trying to implement some kind of a server listening for requests. The listener part of the app, is a daemon thread that listens for connections and instantiates a handling daemon thread once it gets some. However, my problem is that i must be able to kill the listening thread at the user's will (say via a sto button). I have done this via the Sun's proposed way, by testing a boolean flag in the loop, which is set to false when i wish to kill the thread. The problem with this thing is the following...
    Once the thread starts excecuting, it will test the flag, find it true and enter the loop. At some point it will LOCK on the server socket waiting for connection. Unless some client actually connects, it will keep on listening indefinatelly whithought ever bothering to check for the flag again (no matter how many times you set the damn thing to false).
    My question is this: Is there any real, non-theoretical, applied way to stop thread in java safely?
    Thank you in advance,
    Lefty

    This was one solution from the socket programming forum, have you tried this??
    public Thread MyThread extends Thread{
         boolean active = true;          
         public void run(){
              ss.setSoTimeout(90);               
              while (active){                   
                   try{                       
                        serverSocket = ss.accept();
                   catch (SocketTimeoutException ste){
                   // do nothing                   
         // interrupt thread           
         public void deactivate(){               
              active = false;
              // you gotta sleep for a time longer than the               
              // accept() timeout to make sure that timeout is finished.               
              try{
                   sleep(91);               
              }catch (InterruptedException ie){            
              interrupt();
    }

  • Problem with Threads and a static variable

    I have a problem with the code below. I am yet to make sure that I understand the problem. Correct me if I am wrong please.
    Code functionality:
    A timer calls SetState every second. It sets the state and sets boolean variable "changed" to true. Then notifies a main process thread to check if the state changed to send a message.
    The problem as far I understand is:
    Assume the timer Thread calls SetState twice before the main process Thread runs. As a result, "changed" is set to true twice. However, since the main process is blocked twice during the two calls to SetState, when it runs it would have the two SetState timer threads blocked on its synchronized body. It will pass the first one, send the message and set "changed" to false since it was true. Now, it will pass the second thread, but here is the problem, "changed" is already set to false. As a result, it won't send the message even though it is supposed to.
    Would you please let me know if my understanding is correct? If so, what would you propose to resolve the problem? Should I call wait some other or should I notify in a different way?
    Thanks,
    B.D.
    Code:
    private static volatile boolean bChanged = false;
    private static Thread objMainProcess;
       protected static void Init(){
            objMainProcess = new Thread() {
                public void run() {
                    while( objMainProcess == Thread.currentThread() ) {
                       GetState();
            objMainProcess.setDaemon( true );
            objMainProcess.start();
        public static void initStatusTimer(){
            if(objTimer == null)
                 objTimer = new javax.swing.Timer( 1000, new java.awt.event.ActionListener(){
                    public void actionPerformed( java.awt.event.ActionEvent evt){
                              SetState();
        private static void SetState(){
            if( objMainProcess == null ) return;
            synchronized( objMainProcess ) {
                bChanged = true;
                try{
                    objMainProcess.notify();
                }catch( IllegalMonitorStateException e ) {}
        private static boolean GetState() {
            if( objMainProcess == null ) return false;
            synchronized( objMainProcess ) {
                if( bChanged) {
                    SendMessage();
                    bChanged = false;
                    return true;
                try {
                    objMainProcess.wait();
                }catch( InterruptedException e ) {}
                return false;
        }

    Thanks DrClap for your reply. Everything you said is right. It is not easy to make them alternate since SetState() could be called from different places where the state could be anything else but a status message. Like a GREETING message for example. It is a handshaking message but not a status message.
    Again as you said, There is a reason I can't call sendMessage() inside setState().
    The only way I was able to do it is by having a counter of the number of notifies that have been called. Every time notify() is called a counter is incremented. Now instead of just checking if "changed" flag is true, I also check if notify counter is greater than zero. If both true, I send the message. If "changed" flag is false, I check again if the notify counter is greater than zero, I send the message. This way it works, but it is kind of a patch than a good design fix. I am yet to find a good solution.
    Thanks,
    B.D.

  • Problem with threads running javaw

    Hi,
    Having a problem with multi thread programming using client server sockets. The program works find when starting the the application in a console using java muti.java , but when using javaw multi.java the program doesnt die and have to kill it in the task manager. The program doesnt display any of my gui error messages either when the server disconnect the client. all works find in a console. any advice on this as I havent been able to understand why this is happening? any comment would be appreciated.
    troy.

    troy,
    Try and post a minimum code sample of your app which
    does not work.
    When using javaw, make sure you redirect the standard
    error and standard output streams to file.
    Graeme.Hi Graeme,
    I dont understand what you mean by redirection to file? some of my code below.
    The code works fine under a console, code is supposed to exit when the client (the other server )disconnects. the problem is that but the clientworker side of the code still works. which under console it doesnt.
    public class Server{
    ServerSocket aServerSocket;
    Socket dianosticsSocket;
    Socket nPortExpress;
    ClientListener aClientListener;
    LinkedList queue = new LinkedList();
    int port = 0;
    int clientPort = 0;
    String clientName = null;
    boolean serverAlive = true;
    * Server constructor generates a server
    * Socket and then starts a client threads.
    * @param aPort      socket port of local machine.
    public Server(int aPort, String aClientName, int aClientPort){
    port = aPort;
    clientName = aClientName;
    clientPort = aClientPort;
    try{
    // create a new thread
    aServerSocket = new ServerSocket(port) ;
    // connect to the nPortExpress
    aClientListener = new ClientListener(InetAddress.getByName(clientName), clientPort, queue,this);
    // aClientListener.setDaemon(true);
    aClientListener.start();
    // start a dianostic port
    DiagnosticsServer aDiagnosticsServer = new DiagnosticsServer(port,queue,aClientListener);
    // System.out.println("Server is running on port " + port + "...");
    // System.out.println("Connect to nPort");
    catch(Exception e)
    // System.out.println("ERROR: Server port " + port + " not available");
    JOptionPane.showMessageDialog(null, (e.toString()),"ERROR: Server port " + port + " not available", JOptionPane.ERROR_MESSAGE);
    serverAlive = false;
    System.exit(1);
    while(serverAlive&&aClientListener.hostSocket.isConnected()){
    try{
    // connect the client
    Socket aClient = aServerSocket.accept();
    //System.out.println("open client connection");
    //System.out.println("client local: "+ aClient.getLocalAddress().toString());
    // System.out.println("client localport: "+ aClient.getLocalPort());
    // System.out.println("client : "+ aClient.getInetAddress().toString());
    // System.out.println("client port: "+ aClient.getLocalPort());
    // make a new client thread
    ClientWorker clientThread = new ClientWorker(aClient, queue, aClientListener, false);
    // start thread
    clientThread.start();
    catch(Exception e)
    //System.out.println("ERROR: Client connection failure");
    JOptionPane.showMessageDialog(null, (e.toString()),"ERROR: Client connection failure", JOptionPane.ERROR_MESSAGE);
    }// end while
    } // end constructor Server
    void serverExit(){
         JOptionPane.showMessageDialog(null, "Server ","ERROR: nPort Failure", JOptionPane.ERROR_MESSAGE);
         System.exit(1);
    }// end class Server
    *** connect to another server
    public class ClientListener extends Thread{
    InetAddress hostName;
    int hostPort;
    Socket hostSocket;
    BufferedReader in;
    PrintWriter out;
    boolean loggedIn;
    LinkedList queue;      // reference to Server queue
    Server serverRef; // reference to main server
    * ClientListener connects to the host server.
    * @param aHostName is the name of the host eg server name or IP address.
    * @param aHostPort is a port number of the host.
    * @param aLoginName is the users login name.
    public ClientListener(InetAddress aHostName, int aHostPort,LinkedList aQueue,Server aServer)      // reference to Server queue)
    hostName = aHostName;
    hostPort = aHostPort;
    queue = aQueue;
    serverRef = aServer;      
    // connect to the server
    try{
    hostSocket = new Socket(hostName, hostPort);
    catch(IOException e){
    //System.out.println("ERROR: Connection Host Failed");
    JOptionPane.showMessageDialog(null, (e.toString()),"ERROR: Connection to nPort Failed", JOptionPane.ERROR_MESSAGE);     
    System.exit(0);
    } // end constructor ClientListener
    ** multi client connection server
    ClientWorker(Socket aSocket,LinkedList aQueue, ClientListener aClientListener, boolean diagnostics){
    queue = aQueue;
    addToQueue(this);
    client = aSocket;
    clientRef = aClientListener;
    aDiagnostic = diagnostics;
    } // end constructor ClientWorker
    * run method is the main loop of the server program
    * in change of handle new client connection as well
    * as handle all messages and errors.
    public void run(){
    boolean alive = true;
    String aSubString = "";
    in = null;
    out = null;
    loginName = "";
    loggedIn = false;
    while (alive && client.isConnected()&& clientRef.hostSocket.isConnected()){
    try{
    in = new BufferedReader(new InputStreamReader(client.getInputStream()));
    out = new PrintWriter(new OutputStreamWriter(client.getOutputStream()));
    if(aDiagnostic){
    out.println("WELCOME to diagnostics");
    broadCastDia("Connect : diagnostics "+client.getInetAddress().toString());
    out.flush();
    else {       
    out.println("WELCOME to Troy's Server");
    broadCastDia("Connect : client "+client.getInetAddress().toString());
         out.flush();
    String line;
    while(((line = in.readLine())!= null)){
    StringTokenizer aStringToken = new StringTokenizer(line, " ");
    if(!aDiagnostic){
    broadCastDia(line);
    clientRef.sendMessage(line); // send mesage out to netExpress
    out.println(line);
    out.flush();
    else{
    if(line.equals("GETIPS"))
    getIPs();
    else{
    clientRef.sendMessage(line); // send mesage out to netExpress
    out.println(line);
    out.flush();
    } // end while
    catch(Exception e){
    // System.out.println("ERROR:Client Connection reset");
                             JOptionPane.showMessageDialog(null, (e.toString()),"ERROR:Client Connection reset", JOptionPane.ERROR_MESSAGE);     
    try{
    if(aDiagnostic){
    broadCastDia("Disconnect : diagnostics "+client.getInetAddress().toString());
    out.flush();
    else {       
    broadCastDia("Disconnect : client "+client.getInetAddress().toString());
         out.flush();
    // close the buffers and connection;
    in.close();
    out.close();
    client.close();
    // System.out.println("out");
    // remove from list
    removeThreadQueue(this);
    alive = false;
    catch(Exception e){
    // System.out.println("ERROR: Client Connection reset failure");
    JOptionPane.showMessageDialog(null, (e.toString()),"ERROR: Client Connection reset failure", JOptionPane.ERROR_MESSAGE);     
    }// end while
    } // end method run
    * method run - Generates io stream for communicating with the server and
    * starts the client gui. Run also parses the input commands from the server.
    public void run(){
    boolean alive = true;
    try{
    // begin to life the gui
    // aGuiClient = new ClientGui(hostName.getHostName(), hostPort, loginName, this);
    // aGuiClient.show();
    in = new BufferedReader(new InputStreamReader(hostSocket.getInputStream()));
    out = new PrintWriter(new OutputStreamWriter(hostSocket.getOutputStream()));
    while (alive && hostSocket.isConnected()){
    String line;
    while(((line = in.readLine())!= null)){
    System.out.println(line);
    broadCast(line);
    } // end while
    } // end while
    catch(Exception e){
    //     System.out.println("ERRORa Connection to host reset");
    JOptionPane.showMessageDialog(null, (e.toString()),"ERROR: Connection to nPort reset", JOptionPane.ERROR_MESSAGE);
    try{
    hostSocket.close();
         }catch(Exception a){
         JOptionPane.showMessageDialog(null, (a.toString()),"ERROR: Exception", JOptionPane.ERROR_MESSAGE);
    alive = false;
    System.exit(1);
    } // end method run

Maybe you are looking for