Solaris 6 binary on Solaris 8 ( Multithreaded application.)
I have to explore further, but I like to know whether any of you have faced similar problem.
We have multithreaded server. A thread in detached mode will be created to serve each new connection. The binary was compiled on 32bit solaris environment and it was running fine on solaris 6 machines.
Recently we switched to Solaris 8 machines. We used the same binary that was compiled on solaris 6. One problem I am noticing is some of the threads are idle and are alive for 3-4 days. We have timeouts enforced between successive transactions, inspite of that threads are alive for longer duration. We use "poll".
Do you see any problem in Solaris 8 w.r.t Poll/Select syscall or Detached threads ( we use POSIX APIs) that were compiled on Solaris 6 ?.
I would also like to give anyother information that would help you in identifying the problem.
Thanks
Mega
we have ported our product to solaris 5.7 from solaris5.6. With this version we are unable to install the product on solaris 5.6. It is unable to find the following libraries in 5.6, while installing and finally it is failing.
libMrm.so.4
libXm.so.4
libgen.so.3
Is there any way to make my product work on both versions of solaris?
Similar Messages
-
Solaris vs Linux For Multithreaded Application
Hi all,
I am having a Multithreaded Java application which is used to monitor devices in a network (NMS). After collecting the data from the devices, this will update the data in the database. (Usualy there will be lot of device around 25000) . There will be lot of database updation. I am planning to run this application in a server.
But now I am confused in selecting which platform (which os) I have to use. There are two options for me. Either to use Linux or Solaris.
Can anyone help me in selecting the platform. Since my application is multithreaded , please tell me which of these OS will give the best performance
Thanks in advanceThere's no way to tell which one performs better without testing it. Both have reasonably mature and stable multitasking and multi threading. Why don't you write the application and try it on both platforms?
-
How to Debug C++ Multithreaded Application in Solaris
Hi All,
I am working in Solaris Sparc 5.8 Machine. I need to debug Multithreaded C++ Application in Unix Environment.
I am using dbx debugger.
Please explain me how to debug multithreaded applications. if possible please explain me with example.
Thanks in Advance.
Thanks & Regards,
Vasu1. Look over the dbx manual that comes with Sun Studio. Dbx includes many features for debugging MT code.
2. If you have specific questions after reading the manual and trying out the features, ask them in the debugger forum:
http://forum.sun.com/forum.jspa?forumID=257 -
Sun Java Application Server 8.1 Upgrade Solaris 9 to Solaris 10
I have Sun Java Application Server 8.1 (version 8.1_02 (build b06-fcs) ) and HA which are currently installed on Solaris 9 box (Sparc).
Now, I plan to upgrade Solaris 9 to Solaris 10. What should I need to do before and after migration?
Thanks.Before I start, disclaimer -- I have no knowledge of Hibernate and the following comments are based on the stack trace you have included.
I think your permissions might be set all right but you might have an error in the hibernate query. It looks like hibernate uses antlr to parse the queries. While parsing the query, antlr is encountering an exceptional condition and is trying to exit the VM (by calling System.exit()). Obviously, the hibernate code does not have that permission and therefore the exception is logged.
My guess is if you fix the query such that hibernate/antlr can parse it, you will not run into this error.
Hope this helps, -
Solaris 8 binary compatibility - Solaris 7
Greetings:
and TIA.
Also apologies if this issue has been covered via some other resource.
Note: Hardware Utilized - Sparc
We have recently ported our 4.2 Forte C++/C code successfully from Solaris 6 to Solaris 8. As part of that port, we upgraded the compiler resources from 4.2 to 6.0. With these new binaries we have encountered the following runtime issue:
Solaris 8 code runs fine on Solaris 8, however these same executables dump core on Solaris 7
To troubleshoot this, we built the same code on a Solaris 7 platform. These executables ran fine on both Solaris 7 and Solaris 8
My question: Are Solaris 8 binaries incompatible with Solaris 7? Is there any online documentations which provides an overview/explanation for this behavior?
Regards:In general there is forward compatibility for applications between Solaris releases. There is no official backward compatibility. This means you
should always compile on the oldest release of
Solaris that you expectto run on. So, if you need
to run on Solaris 5.6, 7 and 8, compile on Solaris 5.6.
There is a tool called appcert which is shipped with
later versions of Solaris 8 and can be downloaded from:
http://www.sun.com/developers/tools/appcert/download.html
That will give you a good idea of the forward and backward compatibility of your application. General ABI information can be found at:
http://www.sun.com/developers/tools/abi/index.html
Alan
Sun Developer Technical Support
http://www.sun.com/developers/support -
Is it possible to build a binary working on solaris 8 from solaris 10
Hi
I understand that my requirement is kinda weird. However, I really wonder whether it is possible sometimes.
I have built ssh successfully both on solaris 8 and solaris 10. Now the problem is the binary built on solaris 8 can work on solaris 10, but the binary built on solaris 10 can not work on solaris 8.
The problem is SUNW_1.2.2 can not be found on solaris 8.
$ldd sshd
libresolv.so.2 => /usr/lib/libresolv.so.2
librt.so.1 => /usr/lib/librt.so.1
libsocket.so.1 => /usr/lib/libsocket.so.1
libnsl.so.1 => /usr/lib/libnsl.so.1
libc.so.1 => /usr/lib/libc.so.1
libc.so.1 (SUNW_1.22) => (version not found)
libdl.so.1 => /usr/lib/libdl.so.1
libaio.so.1 => /usr/lib/libaio.so.1
libmp.so.2 => /usr/lib/libmp.so.2
/usr/platform/SUNW,Sun-Fire-V210/lib/libc_psr.so.1After more detailed investigation, I found the system-call dlopen and so on are linked to SUNW_1.2.2
objdump -T sshd|grep SUNW_1.22
00251240 DF *UND* 00000000 SUNW_1.22 dlerror
00251510 DF *UND* 00000000 SUNW_1.22 dlclose
00251738 DF *UND* 00000000 SUNW_1.22 dlopen
0025181c DF *UND* 00000000 SUNW_1.22 dlsym
00251a98 DF *UND* 00000100 SUNW_1.22 unsetenvBut for the binary built on solaris 8, system-call dlopen is provided by SISCD_2.3.
objdump -T sshd|grep dl
0023f160 DF *UND* 00000008 SISCD_2.3 dlopen
0023f16c DF *UND* 00000008 SISCD_2.3 dlclose
0023f274 DF *UND* 00000008 SISCD_2.3 dlerror
0023f8d4 DF *UND* 00000008 SISCD_2.3 dlsymAs sshd from solaris 8 is working on solaris 10, I think SISCD2.3 is also available on Solaris10. So is it possible to build ssh (any special link option?) with SISCD_2.3 rather than SUNW_1.2.2?Yuechen wrote:
Hi
I understand that my requirement is kinda weird. However, I really wonder whether it is possible sometimes.
I have built ssh successfully both on solaris 8 and solaris 10. Now the problem is the binary built on solaris 8 can work on solaris 10, but the binary built on solaris 10 can not work on solaris 8.That is expected. Binaries should have forward compatibility and run on later versions of the OS.
Build on 8, run on 8 through 10.
Darren -
Pro*c multithreaded application has memory leak
Hi there,
I posted this message a week ago in OCI section, nobody answer me.
I am really curious if my application has a bug or the pro*c has a bug.
Anyone can compile the sample code and test it easily.
I made multithreaded application which queries dynamic SQL, it works.
But the memory leaks when i query the SQL statement.
The more memory leaks, the more i query the SQL statement, even same SQL
statement.
I check it with top, shell command.
My machine is SUN E450, Solaris 8. Oracle 9.2.0.1
Compiler : gcc (GCC) 3.2.2
I changed source code which is from
$(ORACLE_HOME)/precomp/demo/proc/sample10.pc
the sample10 doesn't need to be multithreaded. But i think it has to work
correctly if i changed it to multithreaded application.
the make file and source code will be placed below.
I have to figure out the problem.
Please help
Thanks in advance,
the make file is below
HOME = /user/jkku
ORA = $(ORACLE_HOME)
CC = gcc
PROC = proc
LC_INCL = -I$(HOME)/work/dbmss/libs/include
lc_incl = include=$(HOME)/work/dbmss/libs/include
SYS_INCL =
sys_incl =
ORA_INCL = -I. \
-I$(ORA)/precomp/public \
-I$(ORA)/rdbms/public \
-I$(ORA)/rdbms/demo \
-I$(ORA)/rdbms/pbsql/public \
-I$(ORA)/network/public \
-DSLMXMX_ENABLE -DSLTS_ENABLE -D_SVID_GETTOD
INCLUDES = $(LC_INCL) $(SYS_INCL) $(ORA_INCL)
includes = $(lc_incl) $(sys_incl)
LC_LIBS =
SYS_LIBS = -lpthread -lsocket -lnsl -lrt
ORA_LIBS = -L$(ORA)/lib/ -lclntsh
LIBS = $(LC_LIBS) $(SYS_LIBS) $(ORA_LIBS)
# Define C Compiler flags
CFLAGS += -D_Solaris64_ -m64
CFLAGS += -g -D_REENTRANT
# Define pro*c Compiler flags
PROCFLAGS += THREADS=YES
PROCFLAGS += CPOOL=YES
# Our object files
PRECOMPS = sample10.c
OBJS = sample10.o
.SUFFIXES: .o .c .pc
.c.o:
$(CC) -c $(CFLAGS) $(INCLUDES) $*.c
.pc.c:
$(PROC) $(PROCFLAGS) $(includes) $*.pc $*.c
all: sample10
sample10: $(PRECOMPS) $(OBJS)
$(CC) $(CFLAGS) -o sample10 $(OBJS) $(LIBS)
clean:
rm -rf *.o sample10 sample10.c
the source code is below which i changed the oracle sample10.pc to
multithreaded application.
Sample Program 10: Dynamic SQL Method 4
This program connects you to ORACLE using your username and
password, then prompts you for a SQL statement. You can enter
any legal SQL statement. Use regular SQL syntax, not embedded SQL.
Your statement will be processed. If it is a query, the rows
fetched are displayed.
You can enter multi-line statements. The limit is 1023 characters.
This sample program only processes up to MAX_ITEMS bind variables and
MAX_ITEMS select-list items. MAX_ITEMS is #defined to be 40.
#include <stdio.h>
#include <string.h>
#include <setjmp.h>
#include <sqlda.h>
#include <stdlib.h>
#include <sqlcpr.h>
/* Maximum number of select-list items or bind variables. */
#define MAX_ITEMS 40
/* Maximum lengths of the names of the
select-list items or indicator variables. */
#define MAX_VNAME_LEN 30
#define MAX_INAME_LEN 30
#ifndef NULL
#define NULL 0
#endif
/* Prototypes */
#if defined(__STDC__)
void sql_error(void);
int oracle_connect(void);
int alloc_descriptors(int, int, int);
int get_dyn_statement(void);
void set_bind_variables(void);
void process_select_list(void);
void help(void);
#else
void sql_error(/*_ void _*/);
int oracle_connect(/*_ void _*/);
int alloc_descriptors(/*_ int, int, int _*/);
int get_dyn_statement(/* void _*/);
void set_bind_variables(/*_ void -*/);
void process_select_list(/*_ void _*/);
void help(/*_ void _*/);
#endif
char *dml_commands[] = {"SELECT", "select", "INSERT", "insert",
"UPDATE", "update", "DELETE", "delete"};
EXEC SQL INCLUDE sqlda;
EXEC SQL INCLUDE sqlca;
EXEC SQL BEGIN DECLARE SECTION;
char dyn_statement[1024];
EXEC SQL VAR dyn_statement IS STRING(1024);
EXEC SQL END DECLARE SECTION;
EXEC ORACLE OPTION (ORACA=YES);
EXEC ORACLE OPTION (RELEASE_CURSOR=YES);
SQLDA *bind_dp;
SQLDA *select_dp;
/* Define a buffer to hold longjmp state info. */
jmp_buf jmp_continue;
char *db_uid="dbmuser/dbmuser@dbmdb";
sql_context ctx;
int err_sql;
enum{
SQL_SUCC=0,
SQL_ERR,
SQL_NOTFOUND,
SQL_UNIQUE,
SQL_DISCONNECT,
SQL_NOTNULL
int main()
int i;
EXEC SQL ENABLE THREADS;
EXEC SQL WHENEVER SQLERROR DO sql_error();
EXEC SQL WHENEVER NOT FOUND DO sql_not_found();
/* Connect to the database. */
if (connect_database() < 0)
exit(1);
EXEC SQL CONTEXT USE :ctx;
/* Process SQL statements. */
for (;;)
/* Allocate memory for the select and bind descriptors. */
if (alloc_descriptors(MAX_ITEMS, MAX_VNAME_LEN, NAME_LEN) != 0)
exit(1);
(void) setjmp(jmp_continue);
/* Get the statement. Break on "exit". */
if (get_dyn_statement() != 0)
break;
EXEC SQL PREPARE S FROM :dyn_statement;
EXEC SQL DECLARE C CURSOR FOR S;
/* Set the bind variables for any placeholders in the
SQL statement. */
set_bind_variables();
/* Open the cursor and execute the statement.
* If the statement is not a query (SELECT), the
* statement processing is completed after the
* OPEN.
EXEC SQL OPEN C USING DESCRIPTOR bind_dp;
/* Call the function that processes the select-list.
* If the statement is not a query, this function
* just returns, doing nothing.
process_select_list();
/* Tell user how many rows processed. */
for (i = 0; i < 8; i++)
if (strncmp(dyn_statement, dml_commands, 6) == 0)
printf("\n\n%d row%c processed.\n", sqlca.sqlerrd[2], sqlca.sqlerrd[2] == 1 ? '\0' : 's');
break;
/* Close the cursor. */
EXEC SQL CLOSE C;
/* When done, free the memory allocated for pointers in the bind and
select descriptors. */
for (i = 0; i < MAX_ITEMS; i++)
if (bind_dp->V != (char *) 0)
free(bind_dp->V);
free(bind_dp->I); /* MAX_ITEMS were allocated. */
if (select_dp->V != (char *) 0)
free(select_dp->V);
free(select_dp->I); /* MAX_ITEMS were allocated. */
/* Free space used by the descriptors themselves. */
SQLSQLDAFree(ctx, bind_dp);
SQLSQLDAFree(ctx, select_dp);
} /* end of for(;;) statement-processing loop */
disconnect_database();
EXEC SQL WHENEVER SQLERROR CONTINUE;
EXEC SQL COMMIT WORK RELEASE;
puts("\nHave a good day!\n");
return;
* Allocate the BIND and SELECT descriptors using sqlald().
* Also allocate the pointers to indicator variables
* in each descriptor. The pointers to the actual bind
* variables and the select-list items are realloc'ed in
* the set_bind_variables() or process_select_list()
* routines. This routine allocates 1 byte for select_dp->V
* and bind_dp->V, so the realloc will work correctly.
alloc_descriptors(size, max_vname_len, max_iname_len)
int size;
int max_vname_len;
int max_iname_len;
int i;
* The first sqlald parameter determines the maximum number of
* array elements in each variable in the descriptor. In
* other words, it determines the maximum number of bind
* variables or select-list items in the SQL statement.
* The second parameter determines the maximum length of
* strings used to hold the names of select-list items
* or placeholders. The maximum length of column
* names in ORACLE is 30, but you can allocate more or less
* as needed.
* The third parameter determines the maximum length of
* strings used to hold the names of any indicator
* variables. To follow ORACLE standards, the maximum
* length of these should be 30. But, you can allocate
* more or less as needed.
if ((bind_dp =
SQLSQLDAAlloc(ctx, size, max_vname_len, max_iname_len)) ==
(SQLDA *) 0)
fprintf(stderr,
"Cannot allocate memory for bind descriptor.");
return -1; /* Have to exit in this case. */
if ((select_dp =
SQLSQLDAAlloc(ctx, size, max_vname_len, max_iname_len)) == (SQLDA *)
0)
fprintf(stderr,
"Cannot allocate memory for select descriptor.");
return -1;
select_dp->N = MAX_ITEMS;
/* Allocate the pointers to the indicator variables, and the
actual data. */
for (i = 0; i < MAX_ITEMS; i++) {
bind_dp->I = (short *) malloc(sizeof (short));
select_dp->I = (short *) malloc(sizeof(short));
bind_dp->V = (char *) malloc(1);
select_dp->V = (char *) malloc(1);
return 0;
int get_dyn_statement()
char *cp, linebuf[256];
int iter, plsql;
for (plsql = 0, iter = 1; ;)
if (iter == 1)
printf("\nSQL> ");
dyn_statement[0] = '\0';
fgets(linebuf, sizeof linebuf, stdin);
cp = strrchr(linebuf, '\n');
if (cp && cp != linebuf)
*cp = ' ';
else if (cp == linebuf)
continue;
if ((strncmp(linebuf, "EXIT", 4) == 0) ||
(strncmp(linebuf, "exit", 4) == 0))
return -1;
else if (linebuf[0] == '?' ||
(strncmp(linebuf, "HELP", 4) == 0) ||
(strncmp(linebuf, "help", 4) == 0))
help();
iter = 1;
continue;
if (strstr(linebuf, "BEGIN") ||
(strstr(linebuf, "begin")))
plsql = 1;
strcat(dyn_statement, linebuf);
if ((plsql && (cp = strrchr(dyn_statement, '/'))) ||
(!plsql && (cp = strrchr(dyn_statement, ';'))))
*cp = '\0';
break;
else
iter++;
printf("%3d ", iter);
return 0;
void set_bind_variables()
int i, n;
char bind_var[64];
/* Describe any bind variables (input host variables) */
EXEC SQL WHENEVER SQLERROR DO sql_error();
bind_dp->N = MAX_ITEMS; /* Initialize count of array elements. */
EXEC SQL DESCRIBE BIND VARIABLES FOR S INTO bind_dp;
/* If F is negative, there were more bind variables
than originally allocated by sqlald(). */
if (bind_dp->F < 0)
printf ("\nToo many bind variables (%d), maximum is %d\n.",
-bind_dp->F, MAX_ITEMS);
return;
/* Set the maximum number of array elements in the
descriptor to the number found. */
bind_dp->N = bind_dp->F;
/* Get the value of each bind variable as a
* character string.
* C contains the length of the bind variable
* name used in the SQL statement.
* S contains the actual name of the bind variable
* used in the SQL statement.
* L will contain the length of the data value
* entered.
* V will contain the address of the data value
* entered.
* T is always set to 1 because in this sample program
* data values for all bind variables are entered
* as character strings.
* ORACLE converts to the table value from CHAR.
* I will point to the indicator value, which is
* set to -1 when the bind variable value is "null".
for (i = 0; i < bind_dp->F; i++)
printf ("\nEnter value for bind variable %.*s: ",
(int)bind_dp->C, bind_dp->S);
fgets(bind_var, sizeof bind_var, stdin);
/* Get length and remove the new line character. */
n = strlen(bind_var) - 1;
/* Set it in the descriptor. */
bind_dp->L = n;
/* (re-)allocate the buffer for the value.
sqlald() reserves a pointer location for
V but does not allocate the full space for
the pointer. */
bind_dp->V = (char *) realloc(bind_dp->V, (bind_dp->L + 1));
/* And copy it in. */
strncpy(bind_dp->V, bind_var, n);
/* Set the indicator variable's value. */
if ((strncmp(bind_dp->V, "NULL", 4) == 0) ||
(strncmp(bind_dp->V, "null", 4) == 0))
*bind_dp->I = -1;
else
*bind_dp->I = 0;
/* Set the bind datatype to 1 for CHAR. */
bind_dp->T = 1;
return;
void process_select_list()
int i, null_ok, precision, scale;
if ((strncmp(dyn_statement, "SELECT", 6) != 0) &&
(strncmp(dyn_statement, "select", 6) != 0))
select_dp->F = 0;
return;
/* If the SQL statement is a SELECT, describe the
select-list items. The DESCRIBE function returns
their names, datatypes, lengths (including precision
and scale), and NULL/NOT NULL statuses. */
select_dp->N = MAX_ITEMS;
EXEC SQL DESCRIBE SELECT LIST FOR S INTO select_dp;
/* If F is negative, there were more select-list
items than originally allocated by sqlald(). */
if (select_dp->F < 0)
printf ("\nToo many select-list items (%d), maximum is %d\n",
-(select_dp->F), MAX_ITEMS);
return;
/* Set the maximum number of array elements in the
descriptor to the number found. */
select_dp->N = select_dp->F;
/* Allocate storage for each select-list item.
sqlprc() is used to extract precision and scale
from the length (select_dp->L).
sqlnul() is used to reset the high-order bit of
the datatype and to check whether the column
is NOT NULL.
CHAR datatypes have length, but zero precision and
scale. The length is defined at CREATE time.
NUMBER datatypes have precision and scale only if
defined at CREATE time. If the column
definition was just NUMBER, the precision
and scale are zero, and you must allocate
the required maximum length.
DATE datatypes return a length of 7 if the default
format is used. This should be increased to
9 to store the actual date character string.
If you use the TO_CHAR function, the maximum
length could be 75, but will probably be less
(you can see the effects of this in SQL*Plus).
ROWID datatype always returns a fixed length of 18 if
coerced to CHAR.
LONG and
LONG RAW datatypes return a length of 0 (zero),
so you need to set a maximum. In this example,
it is 240 characters.
printf ("\n");
for (i = 0; i < select_dp->F; i++)
char title[MAX_VNAME_LEN];
/* Turn off high-order bit of datatype (in this example,
it does not matter if the column is NOT NULL). */
sqlnul ((unsigned short *)&(select_dp->T), (unsigned short
*)&(select_dp->T), &null_ok);
switch (select_dp->T)
case 1 : /* CHAR datatype: no change in length
needed, except possibly for TO_CHAR
conversions (not handled here). */
break;
case 2 : /* NUMBER datatype: use sqlprc() to
extract precision and scale. */
sqlprc ((unsigned int *)&(select_dp->L), &precision,
&scale);
/* Allow for maximum size of NUMBER. */
if (precision == 0) precision = 40;
/* Also allow for decimal point and
possible sign. */
/* convert NUMBER datatype to FLOAT if scale > 0,
INT otherwise. */
if (scale > 0)
select_dp->L = sizeof(float);
else
select_dp->L = sizeof(int);
break;
case 8 : /* LONG datatype */
select_dp->L = 240;
break;
case 11 : /* ROWID datatype */
case 104 : /* Universal ROWID datatype */
select_dp->L = 18;
break;
case 12 : /* DATE datatype */
select_dp->L = 9;
break;
case 23 : /* RAW datatype */
break;
case 24 : /* LONG RAW datatype */
select_dp->L = 240;
break;
/* Allocate space for the select-list data values.
sqlald() reserves a pointer location for
V but does not allocate the full space for
the pointer. */
if (select_dp->T != 2)
select_dp->V = (char *) realloc(select_dp->V,
select_dp->L + 1);
else
select_dp->V = (char *) realloc(select_dp->V,
select_dp->L);
/* Print column headings, right-justifying number
column headings. */
/* Copy to temporary buffer in case name is null-terminated */
memset(title, ' ', MAX_VNAME_LEN);
strncpy(title, select_dp->S, select_dp->C);
if (select_dp->T == 2)
if (scale > 0)
printf ("%.*s ", select_dp->L+3, title);
else
printf ("%.*s ", select_dp->L, title);
else
printf("%-.*s ", select_dp->L, title);
/* Coerce ALL datatypes except for LONG RAW and NUMBER to
character. */
if (select_dp->T != 24 && select_dp->T != 2)
select_dp->T = 1;
/* Coerce the datatypes of NUMBERs to float or int depending on
the scale. */
if (select_dp->T == 2)
if (scale > 0)
select_dp->T = 4; /* float */
else
select_dp->T = 3; /* int */
printf ("\n\n");
/* FETCH each row selected and print the column values. */
EXEC SQL WHENEVER NOT FOUND GOTO end_select_loop;
for (;;)
EXEC SQL FETCH C USING DESCRIPTOR select_dp;
/* Since each variable returned has been coerced to a
character string, int, or float very little processing
is required here. This routine just prints out the
values on the terminal. */
for (i = 0; i < select_dp->F; i++)
if (*select_dp->I < 0)
if (select_dp->T == 4)
printf ("%-*c ",(int)select_dp->L+3, ' ');
else
printf ("%-*c ",(int)select_dp->L, ' ');
else
if (select_dp->T == 3) /* int datatype */
printf ("%*d ", (int)select_dp->L,
*(int *)select_dp->V);
else if (select_dp->T == 4) /* float datatype */
printf ("%*.2f ", (int)select_dp->L,
*(float *)select_dp->V);
else /* character string */
printf ("%-*.*s ", (int)select_dp->L,
(int)select_dp->L, select_dp->V);
printf ("\n");
end_select_loop:
return;
void help()
puts("\n\nEnter a SQL statement or a PL/SQL block at the SQL> prompt.");
puts("Statements can be continued over several lines, except");
puts("within string literals.");
puts("Terminate a SQL statement with a semicolon.");
puts("Terminate a PL/SQL block (which can contain embedded
semicolons)");
puts("with a slash (/).");
puts("Typing \"exit\" (no semicolon needed) exits the program.");
puts("You typed \"?\" or \"help\" to get this message.\n\n");
int connect_database()
err_sql = SQL_SUCC;
EXEC SQL WHENEVER SQLERROR DO sql_error();
EXEC SQL WHENEVER NOT FOUND DO sql_not_found();
EXEC SQL CONTEXT ALLOCATE :ctx;
EXEC SQL CONTEXT USE :ctx;
EXEC SQL CONNECT :db_uid;
if(err_sql != SQL_SUCC){
printf("err => connect database(ctx:%ld, uid:%s) failed!\n", ctx, db_uid);
return -1;
return 1;
int disconnect_database()
err_sql = SQL_SUCC;
EXEC SQL WHENEVER SQLERROR DO sql_error();
EXEC SQL WHENEVER NOT FOUND DO sql_not_found();
EXEC SQL CONTEXT USE :ctx;
EXEC SQL COMMIT WORK RELEASE;
EXEC SQL CONTEXT FREE:ctx;
return 1;
void sql_error()
printf("err => %.*s", sqlca.sqlerrm.sqlerrml, sqlca.sqlerrm.sqlerrmc);
printf("in \"%.*s...\'\n", oraca.orastxt.orastxtl, oraca.orastxt.orastxtc);
printf("on line %d of %.*s.\n\n", oraca.oraslnr, oraca.orasfnm.orasfnml,
oraca.orasfnm.orasfnmc);
switch(sqlca.sqlcode) {
case -1: /* unique constraint violated */
err_sql = SQL_UNIQUE;
break;
case -1012: /* not logged on */
case -1089:
case -3133:
case -1041:
case -3114:
case -3113:
/* �6�Ŭ�� shutdown�ǰų� �α��� ���°� �ƴҶ� ��b�� �õ� */
/* immediate shutdown in progress - no operations are permitted */
/* end-of-file on communication channel */
/* internal error. hostdef extension doesn't exist */
err_sql = SQL_DISCONNECT;
break;
case -1400:
err_sql = SQL_NOTNULL;
break;
default:
err_sql = SQL_ERR;
break;
EXEC SQL CONTEXT USE :ctx;
EXEC SQL WHENEVER SQLERROR CONTINUE;
EXEC SQL ROLLBACK WORK;
void sql_not_found()
err_sql = SQL_NOTFOUND;Hi Jane,
What version of Berkeley DB XML are you using?
What is your operating system and your hardware platform?
For how long have been the application running?
What is your current container size?
What's set for EnvironmentConfig.setThreaded?
Do you know if containers have previously not been closed correctly?
Can you please post the entire error output?
What's the JDK version, 1.4 or 1.5?
Thanks,
Bogdan -
Using time() function in multithreaded application
I am using time() function in a multithreaded application with NULL argument for getting current time.
Some time it's observed that we get a time one minute earlier than current time (3600 seconds).
Is there a problem in the usage of the function?
I am using expression : currenttime = time(NULL);
I had seen some people using following way - time(¤ttime );
Will above two behaves differently in multithreaded environment?
[I am using Sun C++ 5.5 compiler on Solaris 8]How do you compare actual time against the time seen by your threads? If your threads are printing the value from time(2) to stdout, it's possible that you're seeing an artifact of thread scheduling and/or output buffering.
I really doubt that you have a concurrency problem, but anyway make sure that you include the -mt option on your compile line:
CC -mt blahblahblah... -
Migration from Sun solaris 8 to Solaris 10
Hi,
We are migrating from Solaris 8 to Solaris 10 with the compiler migration also earlier we are using Sun Studio 6 and now it is Sun Studio 11.
When we are compiling the code on Solaris 10 which has been running on the Solaris 8, we are facing some error. So could you help me on this
"ResourceManager.h", line 98: Warning (Anachronism): Type names qualified by template parameters require "typename".
"ConnectionMgr.h", line 62: Where: While specializing "ResourceManager<T>".
"ConnectionMgr.h", line 62: Where: Specialized in non-template code.
"ResourceManager.h", line 100: Warning (Anachronism): Type names qualified by template parameters require "typename".
"ConnectionMgr.h", line 62: Where: While specializing "ResourceManager<T>".
"ConnectionMgr.h", line 62: Where: Specialized in non-template code.
2 Warning(s) detected.
make[1]: *** [obj/ConnectionMgr.o] Error 2
Not sure of the warning , am not able to see these error on the compilation on Sun Studio 6.Below is the bit of the header file code, where the error is occurring.
98 typedef map<ResourceID, ResElement *>::iterator ResMapIterator;
100 typedef list<ResElement *>::iterator ResListIterator;
We are using a /opt/SUNWspro/bin/CC compiler and the verison is CC: Sun C++ 5.8
Please help me out about the issueSince you are jumping several compiler releases and two Solaris releases, you should migrate in two steps.
1. Get your application working with Sun Studio 11 on Solaris 8.
2. You can now run that application on Solaris 10, or you can rebuild it on Solaris 10 and then run it.
An application built on Solaris 8 will run on Solaris 9 and 10.
An application built on Solaris 10 cannot be run on Solaris 8 or 9.
We promise upward binary compatibility, allowing an old binary to be used with a newer compiler or on a newer Solaris. But we can't promise source code compatibility because we don't want to have to duplicate old bugs in old compilers.
C++ 5.8 in Sun Studio 11 detects errors that older compilers might have missed. The rules about where to use "typename" are one example.
I would not expect the warning about typename to be generated by either of the source code lines that you show, but I can't really tell without seeing a compilable example.
You need to use typename when you use a type that depends on a template parameter. Example:
template <class T> class C1 {
public:
typedef T Type;
template <class T> class C2 {
public:
typename T::Type a;
C2< C1<int> > c2i;If in C2 you do not specify typename, the compiler does not know whether T::Type is intended to be the name of a type. If it is not a type, the code is always invalid. The C++ rule is that if an an identifier is not known to be a type, it is not a type. You use typename to tell the compiler that T::Type is supposed to be the name of a type. -
Compiling for solaris 9 on solaris 8 machine
Hi, is it possible to use a solaris 8 machine with workshop, to compile binary for solaris 9.
I need to compile user-mode app as well as kernel modules both for 64/32 bit environments.
The modules are all dynamically linked.
If this is possible, what is the proper procedure??
ERAN.For user space apps, if you are sticking to the published interfaces (ie: not using any private, non-public symbols you might have dug up in our libraries) then compiling and linking on Solaris 8 and running on Solaris 9 is not a problem, at least for user space. Run appcert on your application if you want to ensure you aren't using anything private. We are forward-compatible in this sense.
As for kernel modules, I don't know enough to comment. -
Qt QMake is missing - Solaris 11 and Solaris Studio 12.3
OS: Oracle Solaris 11 - http://www.oracle.com/technetwork/server-storage/solaris11/overview/index.html
Development tools: Solaris Studio 12.3 - http://www.oracle.com/technetwork/server-storage/solarisstudio/overview/index.html
Hi, I want to make Qt desktop applications for Oracle Solaris 11, and Solaris Studio supports Qt projects. However the binary QMake is missing.
Is it available somewhere?
Thank you a lot.
Edited by: 909513 on Jan 22, 2012 6:05 PM
Edited by: 909513 on Jan 22, 2012 6:06 PMHere's what I used to compile up (I think) 90%+ of Qt 4.8.4. The configure step creates qmake and the compile rolls along until it hits a lot of non standard C++ code. But you get qmake out of it. The tarball is the latest snapshot of the 4.8.x git tree.
Caveat: It's being built using Sun Studio 12.3 and the stdcxx library from my package site, along with a bunch of dependant packages from there. I never got Qt 4.8.4 to finish compiling with webkit, the 3rdparty/javascriptcore/JavaScriptCore/* files are truly awful non compliant code and error out every step of the compile. Sigh.
Good luck
================================================================================
qt 4.8.2013.06.24
https://qt.gitorious.org/qt/qt/trees/4.8
Compile stdcxx 4.2.1 Done
Compile dbus 1.7.2 Done
Compile libmng 1.0.10 Skipped
setenv CC "cc"
setenv CXX "CC"
or
setenv CC "cc -xtarget=ultra -m64 -xcode=pic32"
setenv CXX "CC -xtarget=ultra -m64 -xcode=pic32"
setenv LDFLAGS "-L/usr/local/lib -mt -library=no%Cstd -L/usr/local/lib -lstdcxx4"
setenv CFLAGS "-I/usr/local/include -DUSE_SYSTEM_MALLOC"
setenv CXXFLAGS "-I/usr/local/include -mt -library=no%Cstd -L/usr/local/lib -lstdcxx4 -DUSE_SYSTEM_MALLOC"
setenv LINK "${CXX} -I/usr/local/include -mt -library=no%Cstd -L/usr/local/lib -lstdcxx4"
setenv AR "${CXX} -I/usr/local/include -mt -library=no%Cstd -L/usr/local/lib -lstdcxx4 -xar -o"
setenv CC "${CC} ${CFLAGS}"
setenv CXX "${CXX} ${CXXFLAGS}"
cd /var/tmp
rm -rf qt-qt
gunzip -c /usr/local/src/graphics/qt-4.8.2013.06.24.tar.gz | gtar -xvf -
cd qt-qt
/bin/perl -pe 's#/bin/sh#/bin/bash#' -i configure
/bin/perl -pe 's#OPT_CONFIRM_LICENSE=no#OPT_CONFIRM_LICENSE=yes#' -i configure
/bin/perl -pe 's#^QMAKE_INCDIR\s+=.*#QMAKE_INCDIR=/usr/local/include#' -i mkspecs/solaris-cc/qmake.conf
/bin/perl -pe 's#^QMAKE_LIBDIR\s+=.*#QMAKE_LIBDIR=/usr/local/lib#' -i mkspecs/solaris-cc/qmake.conf
/bin/perl -pe 's#^QMAKE_INCDIR_X11\s+=.*#QMAKE_INCDIR_X11=/usr/local/include#' -i mkspecs/solaris-cc/qmake.conf
/bin/perl -pe 's#^QMAKE_LIBDIR_X11\s+=.*#QMAKE_LIBDIR_X11=/usr/local/lib#' -i mkspecs/solaris-cc/qmake.conf
/bin/perl -pe "s#^QMAKE_CC\s+=.*#QMAKE_CC=${CC}#" -i mkspecs/solaris-cc/qmake.conf
/bin/perl -pe "s#^QMAKE_CXX\s+=.*#QMAKE_CXX=${CXX}#" -i mkspecs/solaris-cc/qmake.conf
/bin/perl -pe "s#^QMAKE_LINK\s+=.*#QMAKE_LINK=${LINK}#" -i mkspecs/solaris-cc/qmake.conf
/bin/perl -pe "s#^QMAKE_LINK_SHLIB\s+=.*#QMAKE_LINK_SHLIB=${LINK}#" -i mkspecs/solaris-cc/qmake.conf
/bin/perl -pe "s#^QMAKE_AR\s+=.*#QMAKE_AR=${AR} #" -i mkspecs/solaris-cc/qmake.conf
/bin/perl -pe 's#canBuildWebKit=\"no\"#canBuildWebKit=\"yes\"#' -i configure
/bin/perl -pe 's#canBuildQtConcurrent=\"no\"#canBuildQtConcurrent=\"yes\"#' -i configure
./configure -prefix /usr/local \
-qpa xcb \
-release \
-opensource \
-shared \
-no-fast \
-largefile \
-no-system-proxies \
-exceptions \
-accessibility \
-stl \
-qt-sql-sqlite \
-system-sqlite \
-no-qt3support \
-xmlpatterns \
-multimedia \
-audio-backend \
-no-phonon \
-phonon-backend \
-svg \
-webkit \
-x11 \
-no-javascript-jit \
-script \
-no-scripttools \
-declarative \
-platform solaris-cc \
-no-mmx \
-no-3dnow \
-no-sse \
-no-sse2 \
-no-sse3 \
-no-sse4.1 \
-no-sse4.2 \
-no-avx \
-no-neon \
-system-zlib \
-system-libtiff \
-system-libpng \
-no-libmng \
-system-libjpeg \
-openssl \
-nomake tests \
-R /usr/local/lib \
-I /usr/local/include \
-L /usr/local/lib \
-verbose \
-no-cups \
-iconv \
-no-gtkstyle \
-no-nas-sound \
-sm \
-xshape \
-no-xvideo \
-xsync \
-xinerama \
-xcursor \
-xfixes \
-no-xrandr \
-xrender \
-mitshm \
-fontconfig \
-no-xinput \
-xkb \
-no-glib \
-confirm-license \
-system-freetype
foreach file (3rdparty/javascriptcore/JavaScriptCore/runtime/* 3rdparty/javascriptcore/JavaScriptCore/runtime/* 3rdparty/javascriptcore/JavaScriptCore/API/*)
perl -pe 's#ENABLE\(GLIB_SUPPORT\)#0#' -i $file
perl -pe 's#OS\(DARWIN\)#0#' -i $file
perl -pe 's#OS\(WINCE\)#0#' -i $file
perl -pe 's#OS\(WINDOWS\)#0#' -i $file
perl -pe 's#OS\(SYMBIAN\)#0#' -i $file
perl -pe 's#OS\(OPENBSD\)#0#' -i $file
perl -pe 's#OS\(QNX\)#0#' -i $file
perl -pe 's#OS\(ANDROID\)#0#' -i $file
perl -pe 's#OS\(RVCT\)#0#' -i $file
perl -pe 's#OS\(FREEBSD\)#0#' -i $file
perl -pe 's#OS\(HAIKU\)#0#' -i $file
perl -pe 's#OS\(NETBSD\)#0#' -i $file
perl -pe 's#OS\(MAC_OS_X\)#0#' -i $file
perl -pe 's#OS\(IOS\)#0#' -i $file
perl -pe 's#OS\(AIX\)#0#' -i $file
perl -pe 's#OS\(LINUX\)#0#' -i $file
perl -pe 's#OS\(UNIX\)#1#' -i $file
perl -pe 's#OS\(SOLARIS\)#1#' -i $file
perl -pe 's#PLATFORM\(BREWMP\)#0#' -i $file
perl -pe 's#PLATFORM\(MAC\)#0#' -i $file
perl -pe 's#PLATFORM\(WIN\)#0#' -i $file
perl -pe 's#PLATFORM\(CHROMIUM\)#0#' -i $file
perl -pe 's#PLATFORM\(WX\)#0#' -i $file
perl -pe 's#PLATFORM\(GTK\)#0#' -i $file
perl -pe 's#COMPILER\(MSVC\)#0#' -i $file
perl -pe 's#COMPILER\(MINGW\)#0#' -i $file
perl -pe 's#COMPILER\(GCC\)#0#' -i $file
end
perl -pe '($. == 28) && s/^/#include "DateConversion.h"\n#include "DateInstance.h"/' -i 3rdparty/javascriptcore/JavaScriptCore/runtime/DateInstanceCache.h
foreach file (3rdparty/javascriptcore/JavaScriptCore/runtime/*)
perl -pe 's#JS_EXPORTDATA#__declspec(dllexport)#' -i $file
end
gmake
If you get this far you'll hit the dodgy code, but you'll have a qmake binary made. You can remove the -webkit option and it'll actually build qt I believe, but alas I need webkit
ta,
Mark -
Migration from Solaris 9 to Solaris 10: Memory fault problem
We are facing to migrate appication from Solaris 9 to Solaris 10,
Compilation was not a problem, but while running the application it is raising the following fault,
tail of truss
Incurred fault #5, FLTACCESS %pc = 0x100025CA8
siginfo: SIGBUS BUS_ADRALN addr=0x101394CC
Received signal #10, SIGBUS [default]
siginfo: SIGBUS BUS_ADRALN addr=0x101394CC
core analysis show that the fault occurs at different points for different runs.
Please let us know if there is a patch to solve the same.
Thanks & RegardsSorry i should have mentioned it as migration from Solaris 8 to Solaris 10.
Other info: In solaris 8 we compiled using -m32 and on Solaris 10 we are using -m64.
We had never tried on Solaris 9.
i just tried compiling on Solaris 9, i got the same error as in Solaris 10.
I tried to find using dbx but it crashes at different points for different runs.
First Run by pointing connection string - schema 1
dbx m2 core
detected a multithreaded program
program terminated by signal BUS (invalid address alignment)
(/Teamware/bin/../WS5.0/bin/sparcv9/dbx) where
current thread: t@1
=>[1] AddClient(0xffffffff7ffff0c0, 0xffffffff7ffff2f0, 0xffffffff7ffff1d4, 0x373300, 0xff0000000000, 0x8080808080808080), at
0x100025ca8
[2] DBSERV_RadReadProxyClients(0x1, 0x10002599c, 0x0, 0x0, 0x0, 0x0), at 0x10006106c
[3] ClientInitialise(0x1, 0x0, 0x0, 0x0, 0x0, 0x0), at 0x1000263e8
[4] InitialiseDetails(0x1, 0x1, 0x0, 0xffffffff7ffff600, 0xffffffff7ffff5f8, 0xffffffff7ffff5f0), at 0x10002bd4c
[5] ReadDatabaseIntoSharedMem(0x1000a9dd8, 0x2aa5, 0x10cf000, 0x20000000, 0x1, 0x8), at 0x10000c5d0
Second run by pointing Connect-string to Schema 2:
detected a multithreaded program
program terminated by signal BUS (invalid address alignment)
(/Teamware/bin/../WS5.0/bin/sparcv9/dbx) where
current thread: t@1
=>[1] AddReplyMessage(0xffffffff7ffff1d8, 0x6564006d69732d63, 0xffffffff7ffff200, 0x656400, 0xff0000000000,
0x8080808080808080), at 0x10002e458
[2] DBSERV_RadReadRadiusReplyMessages(0x10002e348, 0x0, 0x0, 0x0, 0x0, 0x0), at 0x1000700a4
[3] RadiusReplyMessageInitialise(0x1000b0538, 0x0, 0x0, 0x0, 0x0, 0x0), at 0x10002e2dc
[4] InitialiseDetails(0x1, 0x1, 0x0, 0xffffffff7ffff5f0, 0xffffffff7ffff5e8, 0xffffffff7ffff5e0), at 0x10002bc3c
[5] ReadDatabaseIntoSharedMem(0x1000a9dd8, 0x2c29, 0x1be400, 0x20000000, 0x1, 0x8), at 0x10000c5d0 -
Difference of nslookup printout on Solaris 9 and Solaris 10
Hi,
I am not sure whether I had to post in Solaris 9 or Solaris 10 forum. So I posted this here too.
We are porting some of our applications from Solaris 9 to Solaris 10. We found a
strange problem/ scenario with the nslookup on Solaris 9.
We issued a ENUM query on Solaris 9 and the output from the nslookup binary on
Solaris 9 is given below :
nslookup -q=naptr -timeout=0 -domainname=. 0.0.2.1.6.2.2.7.2.1.0.e164i.arpa
Server: test.org
Address: xx.xx.xx.xx
0.0.2.1.6.2.2.7.2.1.0.e164i.arpa order = 0, preference = 0
flags = "u"
services = "E2U+sip"
rule = "!^.*$!sip:01272261200;phone-context=[email protected];user=phone!"
replacement = (root)
0.0.2.1.6.2.2.7.2.1.0.e164i.arpa order = 1, preference = 0
flags = "u"
services = "E2U+sip"
rule = "!^.*$!sip:01272261200;phone-context=[email protected];user=phone!"
replacement = (root)
The same query on Solaris 10 has the following output :
nslookup -q=naptr -timeout=0 -domain=. 0.0.2.1.6.2.2.7.2.1.0.e164i.arpa
Server: xx.xx.xx.xx
Address: xx.xx.xx.x#53
0.0.2.1.6.2.2.7.2.1.0.e164i.arpa naptr = 0 0 "u" "E2U+sip" "!^.*$!sip:01272261200\;phone-context=[email protected]\;user=phone!" .
0.0.2.1.6.2.2.7.2.1.0.e164i.arpa naptr = 1 0 "u" "E2U+sip" "!^.*$!sip:01272261200\;phone-context=[email protected]\;user=phone!" .
I was wondering why the backslash is present only on Solaris 10 and not in Solaris 9. Is this a error in Solaris 9 or is the prinout format in Solaris
10 wrong ???
Thanks in advance !!
Regards,
PhilipWe encoutered a problem on the solaris 10 machine do to a applicative bug. At a moment we get the url xxxxx.do?method=toto&method=titi.Havent you used the same parameter name ??
method=toto&method=titi
Looks same to me ;-)
So I envision this as a coding bug than a Solaris bug.
Or ...maybe you can throw some more light if I misunderstood you.
-Rohit -
Solaris 8 to Solaris 10 upgrade for oracle 11i
Hi
Need to upgrade my 11i (11.5.9) apps from Solaris 8 to Solaris 10
It will also be a 32 bit to 64 bit conversion
Has anyone done this before. or can specify the any major obstacles.
ThanksDear Bansi
I did something similar on HP-UX but you can mainly follow this
1- Check Certification matrix against Solaris 10
2- Install 64 bit engine of 9iR2 using 9iR2 CD's without creation of a database
3- Patch the engine with the same patch level your database on it [9.2.0.3 is standard DB level for 11.5.9 CD's ] If you want to update this level than the existing to be latest [ie 9.2.0.6 check notes and certification matrix] you should do this step after next step
4- Attach your 11.5.9 database to that engine
5- Copy configurations files from old engine to the new engine [appsutil]
6- Copy Applications in similar locations [If migrate to another server using Solaris 10]
7- If you will change any Application paths or database path consider changing context file and rerun autoconfig
Regards,
A.S.Salem -
Compiler directives to differetiate between solaris 9 and solaris 10
i have an API which makes certain function calls which are different for solaris 9 and solaris 10. i cannot add my own defines, since that would mean that applications too would have to define them.
does the Sun Workshop compiler provide any default directives to differentiate between solaris 9 and solaris 10? something like #ifdef __SunOS_5.10 or something like that?
thanks.As explained in the C Users Guide, the compiler predefines several macros, one of which is represents the Solaris version number.
The macro name is derived from the output of the commands
uname -s and uname -r, starting with __, connected by _, and with dots replaced by _.
Running on Solaris 9:
% uname -s
SunOS
% uname -r
5.9
The defined macro name is __SunOS_5_9
On Solaris 10 you get __SunOS_5_10
__SunOS_5_9 -
Upgrade from Solaris 8 to Solaris 9... it sort of worked
I upgraded a V440 from solaris 8 to solaris 9 last night and it sort of worked. I tried installing off of disk1 instead of the install disk and it wouldn't mount the cd. So I just installed off of the install disk. All seemed to go well but after the reboot it was clear that things didn't go as planned. Basically what happened was the upgrade took the old file systems and placed them under a new /a directory and did a clean install on new file systems. None of my system configuration came over, nor my users, nor my applications... everything was just moved to /a.
Any ideas what happened here? Also, can I reboot using the old (Solaris 8) file systems and then try another upgrade?
Thanks,
barthi,
hope this helps..
http://docs-pdf.sun.com/817-0547/817-0547.pdf
Thanks
--Raman
Maybe you are looking for
-
Oracle EPM Planning 11.1.2.1 - Ziplogs utility not working on all servers
Oracle EPM Planning 11.1.2.1 - Ziplogs utility not working on all servers We have Planning 11.1.2.1 distributed so that Planning web app, EAS etc. are on own webservers and Essbase is on separate cluster. Currently we have an issue with ziplogs utili
-
When i try to open itunes a hazard warning appears reading"the file itunes library.itl cannot be opened because it was created using a newer version of itunes" so i can't open my itunes on my computer
-
Need help-confused on top margin space with div in sidebar div
Hello, I have tried for hours to figure out what is affecting the margin of the top right div #first_ad which is contained in #sidebar2. Right now I have that div first nav with 10px top that looks like 30 in IE7 and 40px in iIE8 (chrome, firefox are
-
WP_PLU vs. WBBDLD
Hi experts. I have a trouble, I am implementing a Best Practice Retail. At integration of POS and POSDM, in the XI module, the best practice suggest IDOC WBBDLD Assortment List, to update articles changes. I have a lot experience using IDOC WP_PLU fo
-
If given data, is there a way to find the height of its respective itemrenderer before adding it to the list ?