Postgresql

I am unable to get StarOffice on solaris x86 to recognize the postgresql sdbc driver to connect with PostgreSQL. I have not found a way to connect with the database. Does anyone know how to successfully connect StarOffice 8 (update 7) with PostgreSQL that comes with Solaris 10/11?
thanks,

Hi,
you need to edit config/data-sources.xml to use postgreSQL as a datasource by adding the following lines to that file besides installing PostgreSQL.
<data-source
name="Default data-source"
class="com.evermind.sql.ConnectionDataSource"
location="jdbc/DefaultDS"
pooled-location="jdbc/DefaultPooledDS"
xa-location="jdbc/xa/DefaultXADS"
ejb-location="jdbc/DefaultEJBDS"
schema="database-schemas/postgresql.xml"
url="jdbc:postgresql://localhost/ejb"
connection-driver="org.postgresql.Driver"
username="user"
password="pass"
/>
and substituting the correct hostname in place of "localhost", database name in place of "ejb", username in place of "user", and password in place of "pass" for your system.

Similar Messages

  • Performance problems when running PostgreSQL on ZFS and tomcat

    Hi all,
    I need help with some analysis and problem solution related to the below case.
    The long story:
    I'm running into some massive performance problems on two 8-way HP ProLiant DL385 G5 severs with 14 GB ram and a ZFS storage pool in raidz configuration. The servers are running Solaris 10 x86 10/09.
    The configuration between the two is pretty much the same and the problem therefore seems generic for the setup.
    Within a non-global zone I’m running a tomcat application (an institutional repository) connecting via localhost to a Postgresql database (the OS provided version). The processor load is typically not very high as seen below:
    NPROC USERNAME  SWAP   RSS MEMORY      TIME  CPU                            
        49 postgres  749M  669M   4,7%   7:14:38  13%
         1 jboss    2519M 2536M    18%  50:36:40 5,9%We are not 100% sure why we run into performance problems, but when it happens we experience that the application slows down and swaps out (according to below). When it settles everything seems to turn back to normal. When the problem is acute the application is totally unresponsive.
    NPROC USERNAME  SWAP   RSS MEMORY      TIME  CPU
        1 jboss    3104M  913M   6,4%   0:22:48 0,1%
    #sar -g 5 5
    SunOS vbn-back 5.10 Generic_142901-03 i86pc    05/28/2010
    07:49:08  pgout/s ppgout/s pgfree/s pgscan/s %ufs_ipf
    07:49:13    27.67   316.01   318.58 14854.15     0.00
    07:49:18    61.58   664.75   668.51 43377.43     0.00
    07:49:23   122.02  1214.09  1222.22 32618.65     0.00
    07:49:28   121.19  1052.28  1065.94  5000.59     0.00
    07:49:33    54.37   572.82   583.33  2553.77     0.00
    Average     77.34   763.71   771.43 19680.67     0.00Making more memory available to tomcat seemed to worsen the problem or at least didn’t prove to have any positive effect.
    My suspicion is currently focused on PostgreSQL. Turning off fsync boosted performance and made the problem less often to appear.
    An unofficial performance evaluation on the database with “vacuum analyze” took 19 minutes on the server and only 1 minute on a desktop pc. This is horrific when taking the hardware into consideration.
    The short story:
    I’m trying different steps but running out of ideas. We’ve read that the database block size and file system block size should match. PostgreSQL is 8 Kb and ZFS is 128 Kb. I didn’t find much information on the matter so if any can help please recommend how to make this change…
    Any other recommendations and ideas we could follow? We know from other installations that the above setup runs without a single problem on Linux on much smaller hardware without specific tuning. What makes Solaris in this configuration so darn slow?
    Any help appreciated and I will try to provide additional information on request if needed…
    Thanks in advance,
    Kasper

    raidz isnt a good match for databases. Databases tend to require good write performance for which mirroring works better.
    Adding a pair of SSD's as a ZIL would probably also help, but chances are its not an option for you..
    You can change the record size by "zfs set recordsize=8k <dataset>"
    It will only take effect for newly written data. Not existing data.

  • Using PostgreSQL through a DB Link connection

    Hi,
    I'm trying to connect to PostgreSQL using a DB Link connection but when retrieving the users in the Discoverer Administrator after selecting the Database Link I got the following error: Database Error - ORA - 00904: "USERNAME" invalid identifier. It seems that Discoverer is not able to execute a correct Data Dictionary query against PostgreSQL so the users (in this case) are not correctly listed. Is there any configuration option in Oracle Discoverer or DB Link parameter that I can use in order to make it work? What would be your recommendation in this case? Are PostgreSQL and Oracle Discoverer compatible?
    Thank you very much

    Hi,
    I would always recommend that you use database views in situations like this. Then the metadata is held in the Oracle database and you will have no issues importing these views into Discoverer.
    So create a schema in your database and in this schema create a view for each PostgreSQL table you want to use, for example, CREATE VIEW myview as SELECT * FROM pgtable@dblink. You can use a script to bulk create the views.
    If you want, You can set up primary key and foreign key constraints on these views so that the joins are automatically created when the views are imported into Discoverer. Also the security is much better with views as you only need a private db link and then grant selects on your views to other database users.
    Rod West

  • Configuring DBAT 9.1.0.5 connector with PostgreSQL database in OIM 11g

    Hi,
    I am trying to configure the DBAT 9.1.0.5 connector with PostgreSQL database in OIM 11g (11.1.1.5.0), thou' in the connector document the suppot for this postgres is not mentioned.
    So, as mentioned for other databases that the JDBC driver has to be copied to $JAVA_HOME/jre/lib/ext, I have also copied the postgres driver to the specific folder but while trying to configure the connector, I am getting the error as 'No suitable driver found'. Following is the stacktrace snippet.
    SEVERE: Class/Method: DBFacade/getConnection encounter some problems: No suitable driver found for jdbc:postgres://funereus.stadi.sonera.fi:5432/DEV1_DIGSIG
    java.sql.SQLException: No suitable driver found for jdbc:postgres://funereus.stadi.sonera.fi:5432/DEV1_DIGSIG
    at java.sql.DriverManager.getConnection(DriverManager.java:602)
    at java.sql.DriverManager.getConnection(DriverManager.java:154)
    at org.apache.commons.dbcp.DriverManagerConnectionFactory.createConnection(DriverManagerConnectionFactory.java:51)
    at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:290)
    at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:840)
    at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:95)
    at com.thortech.xl.gc.impl.common.DBFacade.getConnection(Unknown Source)
    at com.thortech.xl.gc.impl.common.DBFacade.getMetadata(Unknown Source)
    at com.thortech.xl.gc.impl.common.DBFacade.getDBType(Unknown Source)
    at com.thortech.xl.gc.impl.common.DBFacade.getSchema(Unknown Source)
    at com.thortech.xl.gc.impl.recon.DBReconTransportProvider.detectMetadata(Unknown Source)
    at com.thortech.xl.gc.impl.recon.DBReconTransportProvider.getMetadata(Unknown Source)
    at com.thortech.xl.webclient.actions.CreateConnectorAction.getGenericAdapter(CreateConnectorAction.java:2202)
    at com.thortech.xl.webclient.actions.CreateConnectorAction.imageScreen(CreateConnectorAction.java:1196)
    at com.thortech.xl.webclient.actions.CreateConnectorAction.goNext(CreateConnectorAction.java:521)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    Caused by: java.sql.SQLException: No suitable driver found for jdbc:postgres://funereus.stadi.sonera.fi:5432/DEV1_DIGSIG
    at java.sql.DriverManager.getConnection(DriverManager.java:602)
    at java.sql.DriverManager.getConnection(DriverManager.java:154)
    at org.apache.commons.dbcp.DriverManagerConnectionFactory.createConnection(DriverManagerConnectionFactory.java:51)
    at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:290)
    at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:840)
    at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:95)
    ... 62 more
    SEVERE: Class/Method: CreateGenConnectorAction/imageScreen encounter some problems: Provider Exception
    java.lang.Exception: Provider Exception
    at com.thortech.xl.webclient.actions.CreateConnectorAction.getGenericAdapter(CreateConnectorAction.java:2265)
    at com.thortech.xl.webclient.actions.CreateConnectorAction.imageScreen(CreateConnectorAction.java:1196)
    at com.thortech.xl.webclient.actions.CreateConnectorAction.goNext(CreateConnectorAction.java:521)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    I am using postgresql-8.4-703.jdbc4.jar and Driver class as org.postgresql.Driver
    some suggestions on this would be highly appreciated.
    Thanks
    Sid

    Thanks guys for the quick responses.
    But I have tried both the options for putting the jar in Third Party and also by uploading using the OOTB utility UploadJar.sh.
    But it is giving the same error.
    I have tired rebouncing the server and also Purge cached, but no success.
    Just to mention again, I have tried with all the last 3 postgres JDBC4 driver available on the site (u mentioned).
    So, any other clue?
    Thanks in advance.

  • [SOLVED] Postgis no longer working after upgrade of postgresql

    Dear all,
    after yesterdays upgrade of postgresql-server and libs to 9.0.1 the postgis package does no longer work. When trying to import postgis.sql (version 1.5) it always complains about wrong libraries version:
    psql:/usr/share/postgresql/contrib/postgis-1.5/postgis.sql:59: FEHLER: inkompatible Bibliothek »/usr/lib/postgresql/postgis-1.5.so«: Version stimmt nicht überein
    I have double checked on postgresql and postgis documents that the versions should be compatible:
    postgresql 9.0.1-2
    postgresql-libs 9.0.1-2
    postgis 1.5.1-1
    For all databases dump and restore was fine, except for my gis databases. So upgrade from 8.4.4 to 9.0.1 worked in general.
    Any ideas?
    Last edited by Wauzenplauz (2010-10-31 14:46:20)

    "Unfortunately" I did not have enough time to give it a try and rebuild the package.
    So today I found that there is already a new version of postgis available which works perfectly fine!

  • JDeveloper 10.1.2 with MySQL and PostgreSQL

    I'm testing JDeveloper 10.1.2 business components with mysql or postgresql because my company needs to connect also to these non-oracle DBs. ADF suits our developement needs, in speed and functionalities; anyway to make it our main developement system we need it to be compatible.
    I made three tests and they were all disappointing.
    At first, I installed MySQL 4.0 on my windows machine. I used the stable Connector/J 3.1
    and then MySQL Connector/J 3.0, but in both cases JDeveloper had a strange behaviour: I can make the connection, I can navigate correctly through all tables in the connection-navigator, I see all the column names etc... Anyway, as I try to build a "new Entity Object" from a table, there are no available table properties, like if the table had no columns.
    In this forum I only found documentation about rowid problems with mysql, but nothing about Entity Object wizard issues.
    Then I switched to PostgreSQL. I installed it locally, so I had to choose the 8.01 since I'm on a windows machine. JDBC driver: postgresql-8.0-310 jdbc3
    The developement test phase went ok, it is possible to use this DB just as if it was a Oracle, all the business components wizards works perfectly.
    The problem is at runtime, unfortunately. I built a simple datapage on the struts-config diagram and I dragged on it a "read-only table" from the data control palette.
    As I run the application, the embedded OC4J immediately returns this error:
    oracle.jbo.JboException: JBO-29000: JBO-29000: JBO-29000: JBO-26061: Errore durante lapertura della connessione JDBC.
    at oracle.jbo.JboException.<init>(JboException.java:343)
    (in english: Error during JDBC connection)
    There are no other available JDBC drivers for JVM 1.4x so I see no solution...
    I also tried to connect to an older PostgresSQL with its (older) JDBC but I get same the result.
    Anyone can help? Is it a JDev 10.1.2 issue?

    Hi Paolo.
    I'm also doing such tests.
    I did not ran into these problems because I created the busisness componentes using an Oracle connection first.
    After that, I switched the datatype of the table columns in the entity object to meet the SQL92 criteria ( like changing NUMBER(n) to INTEGER ).
    And then, I switched the connection to the postgreSQL or MySQL. This worked fine for me.
    But, the other big problem you will face is related to updating records using postgreSQL connection.
    Please see my post "Problem updating records using BC4J with foreign data sources" Problem updating records using BC4J with foreign data sources
    It would by fine if we help each other to solve this problems.
    Thanks
    Denis

  • Configuration of PostgreSQL in Solaris 10

    I really having problems in configuring postgreSQL in my desktop...
    When i execute the initdb command it display this error:
    The user must own the server process.
    thanx

    you have to be user postgres to use that command. if you are your regular user or root it won't work.
    so become root and type:
    su - postgres
    then type your command initdb (with whatever appropriate arguments) and it should work and initialize your database cluster.

  • [Oracle to PostgreSQL]connction string lacks some options

    Hi guys,
    I want to connect from oracle 11g to PostgreSQL 9.3 . l get this error message:
    ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
    [unixODBC]connction string lacks some options {08001,NativeErr = 202}
    ORA-02063: preceding 2 lines from k
    but I can connected to PostgreSQL using isql.
    Oracle CharacterSet :AL32UTF8
    PostgreSQL server_encoding:UTF8
    PostgreSQL client_encoding:UTF8
    Here are my configuration files:
    odbc.ini:
    [PostgreSQL]
    Driver = /usr/local/pgsqlodbc/lib/psqlodbcw.so
    Description = Test2PG
    Servername = 192.168.0.1
    PORT = 5432
    Protocol = 9.3
    UserName = postgres
    Password = postgres
    Database = testdb
    TRACE =Yes
    TaceFile = /tmp/sql.log
    tnsnames.ora:
    PostgreSQL =
    (DESCRIPTION =
       (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.10)(PORT = 1521))
       (CONNECT_DATA =(SID = PostgreSQL)
      (HS =OK)
    listener.ora:
    SID_LIST_LISTENER=
      (SID_LIST=
        (SID_DESC=
          (SID_NAME=PostgreSQL)
          (ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1)
          (EVNS=LD_LIBRARY_PATH=/usr/local/unixodbc/lib:/usr/local/pgsqlodbc/lib:/u01/app/oracle/product/11.2.0/dbhome_1/bin)
          (PROGRAM=dg4odbc)
    initiPostgreSQL.ora:
    HS_FDS_CONNECT_INFO = PostgreSQL
    HS_FDS_TRACE_LEVEL = 255
    HS_FDS_SHAREABLE_NAME = /usr/local/unixodbc/lib/libodbc.so
    HS_LANGUAGE=AMERICAN_AMERICA.WE8ISO8859P1
    set ODBCINI=/etc/odbc.ini
    Trace:
    Oracle Corporation --- THURSDAY  MAY 15 2014 15:59:19.875
    Heterogeneous Agent Release
    11.2.0.3.0
    Oracle Corporation --- THURSDAY  MAY 15 2014 15:59:19.874
        Version 11.2.0.3.0
    Entered hgogprd
    HOSGIP for "HS_FDS_TRACE_LEVEL" returned "255"
    Entered hgosdip
    setting HS_OPEN_CURSORS to default of 50
    setting HS_FDS_RECOVERY_ACCOUNT to default of "RECOVER"
    setting HS_FDS_RECOVERY_PWD to default value
    setting HS_FDS_TRANSACTION_LOG to default of HS_TRANSACTION_LOG
    setting HS_IDLE_TIMEOUT to default of 0
    setting HS_FDS_TRANSACTION_ISOLATION to default of "READ_COMMITTED"
    setting HS_NLS_NCHAR to default of "AL32UTF8"
    setting HS_FDS_TIMESTAMP_MAPPING to default of "DATE"
    setting HS_FDS_DATE_MAPPING to default of "DATE"
    setting HS_RPC_FETCH_REBLOCKING to default of "ON"
    setting HS_FDS_FETCH_ROWS to default of "100"
    setting HS_FDS_RESULTSET_SUPPORT to default of "FALSE"
    setting HS_FDS_RSET_RETURN_ROWCOUNT to default of "FALSE"
    setting HS_FDS_PROC_IS_FUNC to default of "FALSE"
    setting HS_FDS_MAP_NCHAR to default of "TRUE"
    setting HS_NLS_DATE_FORMAT to default of "YYYY-MM-DD HH24:MI:SS"
    setting HS_FDS_REPORT_REAL_AS_DOUBLE to default of "FALSE"
    setting HS_LONG_PIECE_TRANSFER_SIZE to default of "65536"
    setting HS_SQL_HANDLE_STMT_REUSE to default of "FALSE"
    setting HS_FDS_QUERY_DRIVER to default of "TRUE"
    setting HS_FDS_SUPPORT_STATISTICS to default of "FALSE"
    setting HS_FDS_QUOTE_IDENTIFIER to default of "TRUE"
    setting HS_KEEP_REMOTE_COLUMN_SIZE to default of "OFF"
    setting HS_FDS_GRAPHIC_TO_MBCS to default of "FALSE"
    setting HS_FDS_MBCS_TO_GRAPHIC to default of "FALSE"
    Default value of 32 assumed for HS_FDS_SQLLEN_INTERPRETATION
    setting HS_CALL_NAME_ISP to "gtw$:SQLTables;gtw$:SQLColumns;gtw$:SQLPrimaryKeys;gtw$:SQLForeignKeys;gtw$:SQLProcedures;gtw$:SQLStatistics;gtw$:SQLGetInfo"
    setting HS_FDS_DELAYED_OPEN to default of "TRUE"
    setting HS_FDS_WORKAROUNDS to default of "0"
    Exiting hgosdip, rc=0
    ORACLE_SID is "PostgreSQL"
    Product-Info:
      Port Rls/Upd:3/0 PrdStat:0
      Agent:Oracle Database Gateway for ODBC
      Facility:hsa
      Class:ODBC, ClassVsn:11.2.0.3.0_0011, Instance:PostgreSQL
    Exiting hgogprd, rc=0
    hostmstr:          0: HOA After hoagprd
    hostmstr:          0: HOA Before hoainit
    Entered hgoinit
    HOCXU_COMP_CSET=1
    HOCXU_DRV_CSET=31
    HOCXU_DRV_NCHAR=873
    HOCXU_DB_CSET=873
    HS_LANGUAGE is AMERICAN_AMERICA.WE8ISO8859P1
    LANG=en_US.UTF-8
    HOCXU_SEM_VER=112000
    Entered hgolofn at 2014/05/15-15:59:19
    HOSGIP for "HS_FDS_SHAREABLE_NAME" returned "/usr/local/unixodbc/lib/libodbc.so"
    Entered hgolofns at 2014/05/15-15:59:19
    libname=/usr/local/unixodbc/lib/libodbc.so, funcname=SQLAllocHandle
    symbol_peflctx=0x522520
    hoaerr:0
    Exiting hgolofns at 2014/05/15-15:59:19
    Entered hgolofns at 2014/05/15-15:59:19
    libname=/usr/local/unixodbc/lib/libodbc.so, funcname=SQLBindCol
    symbol_peflctx=0x5226c0
    hoaerr:0
    Exiting hgolofns at 2014/05/15-15:59:19
    Entered hgolofns at 2014/05/15-15:59:19
    libname=/usr/local/unixodbc/lib/libodbc.so, funcname=SQLBindParameter
    symbol_peflctx=0x523110
    hoaerr:0
    Exiting hgolofns at 2014/05/15-15:59:19
    Entered hgolofns at 2014/05/15-15:59:19
    libname=/usr/local/unixodbc/lib/libodbc.so, funcname=SQLCancel
    symbol_peflctx=0x524930
    hoaerr:0
    Exiting hgolofns at 2014/05/15-15:59:19
    Entered hgolofns at 2014/05/15-15:59:19
    libname=/usr/local/unixodbc/lib/libodbc.so, funcname=SQLDescribeParam
    symbol_peflctx=0x52e120
    hoaerr:0
    Exiting hgolofns at 2014/05/15-15:59:19
    Entered hgolofns at 2014/05/15-15:59:19
    libname=/usr/local/unixodbc/lib/libodbc.so, funcname=SQLDisconnect
    symbol_peflctx=0x52e670
    hoaerr:0
    Exiting hgolofns at 2014/05/15-15:59:19
    Entered hgolofns at 2014/05/15-15:59:19
    libname=/usr/local/unixodbc/lib/libodbc.so, funcname=SQLEndTran
    symbol_peflctx=0x531b50
    hoaerr:0
    Exiting hgolofns at 2014/05/15-15:59:19
    Entered hgolofns at 2014/05/15-15:59:19
    libname=/usr/local/unixodbc/lib/libodbc.so, funcname=SQLExecute
    symbol_peflctx=0x5336b0
    hoaerr:0
    Exiting hgolofns at 2014/05/15-15:59:19
    Entered hgolofns at 2014/05/15-15:59:19
    libname=/usr/local/unixodbc/lib/libodbc.so, funcname=SQLFetch
    symbol_peflctx=0x534070
    hoaerr:0
    Exiting hgolofns at 2014/05/15-15:59:19
    Entered hgolofns at 2014/05/15-15:59:19
    libname=/usr/local/unixodbc/lib/libodbc.so, funcname=SQLFreeHandle
    symbol_peflctx=0x5361e0
    hoaerr:0
    Exiting hgolofns at 2014/05/15-15:59:19
    Entered hgolofns at 2014/05/15-15:59:19
    libname=/usr/local/unixodbc/lib/libodbc.so, funcname=SQLFreeStmt
    symbol_peflctx=0x536210
    hoaerr:0
    Exiting hgolofns at 2014/05/15-15:59:19
    Entered hgolofns at 2014/05/15-15:59:19
    libname=/usr/local/unixodbc/lib/libodbc.so, funcname=SQLGetData
    symbol_peflctx=0x537fd0
    hoaerr:0
    Exiting hgolofns at 2014/05/15-15:59:19
    Entered hgolofns at 2014/05/15-15:59:19
    libname=/usr/local/unixodbc/lib/libodbc.so, funcname=SQLGetEnvAttr
    symbol_peflctx=0x53bc40
    hoaerr:0
    Exiting hgolofns at 2014/05/15-15:59:19
    Entered hgolofns at 2014/05/15-15:59:19
    libname=/usr/local/unixodbc/lib/libodbc.so, funcname=SQLGetFunctions
    symbol_peflctx=0x53c040
    hoaerr:0
    Exiting hgolofns at 2014/05/15-15:59:19
    Entered hgolofns at 2014/05/15-15:59:19
    libname=/usr/local/unixodbc/lib/libodbc.so, funcname=SQLMoreResults
    symbol_peflctx=0x53e0d0
    hoaerr:0
    Exiting hgolofns at 2014/05/15-15:59:19
    Entered hgolofns at 2014/05/15-15:59:19
    libname=/usr/local/unixodbc/lib/libodbc.so, funcname=SQLNumResultCols
    symbol_peflctx=0x53f030
    hoaerr:0
    Exiting hgolofns at 2014/05/15-15:59:19
    Entered hgolofns at 2014/05/15-15:59:19
    libname=/usr/local/unixodbc/lib/libodbc.so, funcname=SQLParamData
    symbol_peflctx=0x53f3f0
    hoaerr:0
    Exiting hgolofns at 2014/05/15-15:59:19
    Entered hgolofns at 2014/05/15-15:59:19
    libname=/usr/local/unixodbc/lib/libodbc.so, funcname=SQLPutData
    symbol_peflctx=0x541a40
    hoaerr:0
    Exiting hgolofns at 2014/05/15-15:59:19
    Entered hgolofns at 2014/05/15-15:59:19
    libname=/usr/local/unixodbc/lib/libodbc.so, funcname=SQLRowCount
    symbol_peflctx=0x541f30
    hoaerr:0
    Exiting hgolofns at 2014/05/15-15:59:19
    Entered hgolofns at 2014/05/15-15:59:19
    libname=/usr/local/unixodbc/lib/libodbc.so, funcname=SQLSetEnvAttr
    symbol_peflctx=0x5447f0
    hoaerr:0
    Exiting hgolofns at 2014/05/15-15:59:19
    Entered hgolofns at 2014/05/15-15:59:19
    libname=/usr/local/unixodbc/lib/libodbc.so, funcname=SQLSetDescRec
    symbol_peflctx=0x544570
    hoaerr:0
    Exiting hgolofns at 2014/05/15-15:59:19
    Entered hgolofns at 2014/05/15-15:59:19
    libname=/usr/local/unixodbc/lib/libodbc.so, funcname=SQLColAttribute
    symbol_peflctx=0x5254a0
    hoaerr:0
    Exiting hgolofns at 2014/05/15-15:59:19
    Entered hgolofns at 2014/05/15-15:59:19
    libname=/usr/local/unixodbc/lib/libodbc.so, funcname=SQLColumns
    symbol_peflctx=0x527280
    hoaerr:0
    Exiting hgolofns at 2014/05/15-15:59:19
    Entered hgolofns at 2014/05/15-15:59:19
    libname=/usr/local/unixodbc/lib/libodbc.so, funcname=SQLConnect
    symbol_peflctx=0x52b600
    hoaerr:0
    Exiting hgolofns at 2014/05/15-15:59:19
    Entered hgolofns at 2014/05/15-15:59:19
    libname=/usr/local/unixodbc/lib/libodbc.so, funcname=SQLDescribeCol
    symbol_peflctx=0x52d8c0
    hoaerr:0
    Exiting hgolofns at 2014/05/15-15:59:19
    Entered hgolofns at 2014/05/15-15:59:19
    libname=/usr/local/unixodbc/lib/libodbc.so, funcname=SQLDriverConnect
    symbol_peflctx=0x52f420
    hoaerr:0
    Exiting hgolofns at 2014/05/15-15:59:19
    Entered hgolofns at 2014/05/15-15:59:19
    libname=/usr/local/unixodbc/lib/libodbc.so, funcname=SQLExecDirect
    symbol_peflctx=0x532ff0
    hoaerr:0
    Exiting hgolofns at 2014/05/15-15:59:19
    Entered hgolofns at 2014/05/15-15:59:19
    libname=/usr/local/unixodbc/lib/libodbc.so, funcname=SQLForeignKeys
    symbol_peflctx=0x534bc0
    hoaerr:0
    Exiting hgolofns at 2014/05/15-15:59:19
    Entered hgolofns at 2014/05/15-15:59:19
    libname=/usr/local/unixodbc/lib/libodbc.so, funcname=SQLGetConnectAttr
    symbol_peflctx=0x536670
    hoaerr:0
    Exiting hgolofns at 2014/05/15-15:59:19
    Entered hgolofns at 2014/05/15-15:59:19
    libname=/usr/local/unixodbc/lib/libodbc.so, funcname=SQLGetDescField
    symbol_peflctx=0x538800
    hoaerr:0
    Exiting hgolofns at 2014/05/15-15:59:19
    Entered hgolofns at 2014/05/15-15:59:19
    libname=/usr/local/unixodbc/lib/libodbc.so, funcname=SQLGetDescRec
    symbol_peflctx=0x538ea0
    hoaerr:0
    Exiting hgolofns at 2014/05/15-15:59:19
    Entered hgolofns at 2014/05/15-15:59:19
    libname=/usr/local/unixodbc/lib/libodbc.so, funcname=SQLGetDiagField
    symbol_peflctx=0x53a350
    hoaerr:0
    Exiting hgolofns at 2014/05/15-15:59:19
    Entered hgolofns at 2014/05/15-15:59:19
    libname=/usr/local/unixodbc/lib/libodbc.so, funcname=SQLGetDiagRec
    symbol_peflctx=0x53b220
    hoaerr:0
    Exiting hgolofns at 2014/05/15-15:59:19
    Entered hgolofns at 2014/05/15-15:59:19
    libname=/usr/local/unixodbc/lib/libodbc.so, funcname=SQLGetInfo
    symbol_peflctx=0x53cbd0
    hoaerr:0
    Exiting hgolofns at 2014/05/15-15:59:19
    Entered hgolofns at 2014/05/15-15:59:19
    libname=/usr/local/unixodbc/lib/libodbc.so, funcname=SQLGetStmtAttr
    symbol_peflctx=0x53cf60
    hoaerr:0
    Exiting hgolofns at 2014/05/15-15:59:19
    Entered hgolofns at 2014/05/15-15:59:19
    libname=/usr/local/unixodbc/lib/libodbc.so, funcname=SQLGetTypeInfo
    symbol_peflctx=0x53dc40
    hoaerr:0
    Exiting hgolofns at 2014/05/15-15:59:19
    Entered hgolofns at 2014/05/15-15:59:19
    libname=/usr/local/unixodbc/lib/libodbc.so, funcname=SQLPrepare
    symbol_peflctx=0x53fce0
    hoaerr:0
    Exiting hgolofns at 2014/05/15-15:59:19
    Entered hgolofns at 2014/05/15-15:59:19
    libname=/usr/local/unixodbc/lib/libodbc.so, funcname=SQLPrimaryKeys
    symbol_peflctx=0x540340
    hoaerr:0
    Exiting hgolofns at 2014/05/15-15:59:19
    Entered hgolofns at 2014/05/15-15:59:19
    libname=/usr/local/unixodbc/lib/libodbc.so, funcname=SQLProcedureColumns
    symbol_peflctx=0x540ae0
    hoaerr:0
    Exiting hgolofns at 2014/05/15-15:59:19
    Entered hgolofns at 2014/05/15-15:59:19
    libname=/usr/local/unixodbc/lib/libodbc.so, funcname=SQLProcedures
    symbol_peflctx=0x541300
    hoaerr:0
    Exiting hgolofns at 2014/05/15-15:59:19
    Entered hgolofns at 2014/05/15-15:59:19
    libname=/usr/local/unixodbc/lib/libodbc.so, funcname=SQLSetConnectAttr
    symbol_peflctx=0x542270
    hoaerr:0
    Exiting hgolofns at 2014/05/15-15:59:19
    Entered hgolofns at 2014/05/15-15:59:19
    libname=/usr/local/unixodbc/lib/libodbc.so, funcname=SQLSetStmtAttr
    symbol_peflctx=0x546050
    hoaerr:0
    Exiting hgolofns at 2014/05/15-15:59:19
    Entered hgolofns at 2014/05/15-15:59:19
    libname=/usr/local/unixodbc/lib/libodbc.so, funcname=SQLSetDescField
    symbol_peflctx=0x5440d0
    hoaerr:0
    Exiting hgolofns at 2014/05/15-15:59:19
    Entered hgolofns at 2014/05/15-15:59:19
    libname=/usr/local/unixodbc/lib/libodbc.so, funcname=SQLStatistics
    symbol_peflctx=0x548140
    hoaerr:0
    Exiting hgolofns at 2014/05/15-15:59:19
    Entered hgolofns at 2014/05/15-15:59:19
    libname=/usr/local/unixodbc/lib/libodbc.so, funcname=SQLTables
    symbol_peflctx=0x5491b0
    hoaerr:0
    Exiting hgolofns at 2014/05/15-15:59:19
    Exiting hgolofn, rc=0 at 2014/05/15-15:59:19
    HOSGIP for "HS_OPEN_CURSORS" returned "50"
    HOSGIP for "HS_FDS_FETCH_ROWS" returned "100"
    HOSGIP for "HS_LONG_PIECE_TRANSFER_SIZE" returned "65536"
    HOSGIP for "HS_NLS_NUMERIC_CHARACTER" returned ".,"
    HOSGIP for "HS_KEEP_REMOTE_COLUMN_SIZE" returned "OFF"
    HOSGIP for "HS_FDS_DELAYED_OPEN" returned "TRUE"
    HOSGIP for "HS_FDS_WORKAROUNDS" returned "0"
    HOSGIP for "HS_FDS_MBCS_TO_GRAPHIC" returned "FALSE"
    HOSGIP for "HS_FDS_GRAPHIC_TO_MBCS" returned "FALSE"
    Invalid value of 32 given for HS_FDS_SQLLEN_INTERPRETATION
    treat_SQLLEN_as_compiled = 1
    Exiting hgoinit, rc=0 at 2014/05/15-15:59:19
    hostmstr:          0: HOA After hoainit
    hostmstr:          0: HOA Before hoalgon
    Entered hgolgon at 2014/05/15-15:59:19
    reco:0, name:postgres, tflag:0
    Entered hgosuec at 2014/05/15-15:59:19
    Exiting hgosuec, rc=0 at 2014/05/15-15:59:19
    HOSGIP for "HS_FDS_RECOVERY_ACCOUNT" returned "RECOVER"
    HOSGIP for "HS_FDS_TRANSACTION_LOG" returned "HS_TRANSACTION_LOG"
    HOSGIP for "HS_FDS_TIMESTAMP_MAPPING" returned "DATE"
    HOSGIP for "HS_FDS_DATE_MAPPING" returned "DATE"
    HOSGIP for "HS_FDS_MAP_NCHAR" returned "TRUE"
    HOSGIP for "HS_FDS_RESULTSET_SUPPORT" returned "FALSE"
    HOSGIP for "HS_FDS_RSET_RETURN_ROWCOUNT" returned "FALSE"
    HOSGIP for "HS_FDS_PROC_IS_FUNC" returned "FALSE"
    HOSGIP for "HS_FDS_REPORT_REAL_AS_DOUBLE" returned "FALSE"
    using postgres as default value for "HS_FDS_DEFAULT_OWNER"
    HOSGIP for "HS_SQL_HANDLE_STMT_REUSE" returned "FALSE"
    Entered hgocont at 2014/05/15-15:59:19
    HS_FDS_CONNECT_INFO = "PostgreSQL"
    RC=-1 from HOSGIP for "HS_FDS_CONNECT_STRING"
    Entered hgogenconstr at 2014/05/15-15:59:19
    dsn:PostgreSQL, name:postgres
    optn:
    Entered hgocip at 2014/05/15-15:59:19
    dsn:PostgreSQL
    Exiting hgocip, rc=0 at 2014/05/15-15:59:19
    ##>Connect Parameters (len=40)<##
    ## DSN=PostgreSQL;
    #! UID=postgres;
    #! PWD=*
    Exiting hgogenconstr, rc=0 at 2014/05/15-15:59:19
    Entered hgopoer at 2014/05/15-15:59:19
    hgopoer, line 231: got native error 202 and sqlstate 08001; message follows...
    [unixODBC]connction string lacks some options {08001,NativeErr = 202}
    Exiting hgopoer, rc=0 at 2014/05/15-15:59:19
    hgocont, line 2754: calling SqlDriverConnect got sqlstate 08001
    Exiting hgocont, rc=28500 at 2014/05/15-15:59:19 with error ptr FILE:hgocont.c LINE:2774 FUNCTION:hgocont() ID:Something other than invalid authorization
    Exiting hgolgon, rc=28500 at 2014/05/15-15:59:19 with error ptr FILE:hgolgon.c LINE:801 FUNCTION:hgolgon() ID:Calling hgocont
    hostmstr:          0: HOA After hoalgon
    RPC Calling nscontrol(0), rc=0
    hostmstr:          0: RPC Before Exit Agent
    hostmstr:          0: HOA Before hoaexit
    Entered hgoexit at 2014/05/15-15:59:19
    Exiting hgoexit, rc=0
    hostmstr:          0: HOA After hoaexit
    hostmstr:          0: RPC After Exit Agent
    ODBC Trace:
    [ODBC][6580][1400140759.882270][SQLSetConnectAttr.c][396]
      Entry:
      Connection = 0x90bd960
      Attribute = SQL_ATTR_AUTOCOMMIT
      Value = (nil)
      StrLen = -5
    [ODBC][6580][1400140759.882326][SQLSetConnectAttr.c][671]
      Exit:[SQL_SUCCESS]
    [ODBC][6580][1400140759.882642][SQLDriverConnect.c][728]
      Entry:
      Connection = 0x90bd960
      Window Hdl = (nil)
      Str In = [DSN=PostgreSQL;UID=postgres;PWD=********][length = 40]
      Str Out = 0x90bd200
      Str Out Max = 1024
      Str Out Ptr = 0xbfd1e25c
      Completion = 0
      UNICODE Using encoding ASCII 'ANSI_X3.4-1968' and UNICODE 'UCS-2LE'
      DIAG [08001] connction string lacks some options
    [ODBC][6580][1400140759.887954][SQLDriverConnect.c][1454]
      Exit:[SQL_ERROR]
    [ODBC][6580][1400140759.888032][SQLGetDiagRec.c][680]
      Entry:
      Connection = 0x90bd960
      Rec Number = 1
      SQLState = 0xbfd1df58
      Native = 0xbfd1df7c
      Message Text = 0xbfd1dd20
      Buffer Length = 510
      Text Len Ptr = 0xbfd1df94
    [ODBC][6580][1400140759.888065][SQLGetDiagRec.c][717]
      Exit:[SQL_SUCCESS]
      SQLState = 08001
      Native = 0xbfd1df7c -> 202
      Message Text = [[unixODBC]connction string lacks some options]
    [ODBC][6580][1400140759.888108][SQLGetDiagRec.c][680]
      Entry:
      Connection = 0x90bd960
      Rec Number = 2
      SQLState = 0xbfd1df58
      Native = 0xbfd1df7c
      Message Text = 0xbfd1dd20
      Buffer Length = 510
      Text Len Ptr = 0xbfd1df94
    [ODBC][6580][1400140759.888136][SQLGetDiagRec.c][717]
      Exit:[SQL_NO_DATA]
    [ODBC][6580][1400140759.888222][SQLDisconnect.c][208]
      Entry:
      Connection = 0x90bd960
    [ODBC][6580][1400140759.888250][SQLDisconnect.c][237]Error: 08003
    [ODBC][6580][1400140759.888319][SQLFreeHandle.c][284]
      Entry:
      Handle Type = 2
      Input Handle = 0x90bd960
    [ODBC][6580][1400140759.888352][SQLFreeHandle.c][333]
      Exit:[SQL_SUCCESS]
    [ODBC][6580][1400140759.889499][SQLFreeHandle.c][219]
      Entry:
      Handle Type = 1
      Input Handle = 0x90abf70
    Thank you.

    When looking at the strace file the Driver Manager tries to load the odbc.ini you specified in your gateway init file: set ODBCINI=/etc/odbc.ini
    but that fails as the oracle user can not access it - instead it tries to load a different file:
    17811 open("/etc/odbc.ini", O_WRONLY|O_CREAT|O_APPEND, 0666) = -1 EACCES (Permission denied)
    17811 open("/usr/local/unixodbc/etc/odbc.ini", O_RDONLY) = 8
    Could you please make sure that the oracle user can access that file?
    You also mentioned at the beginning that you could connect to the Postgres database using isql - did you do the test as "oracle" user and what ENV parameters have you set before opening isql?
    Just a minor issue which has no impact as your LD_LIBRARY_PATH in the environment is set correctly - the listener.ora file contains the line
    (EVNS=LD_LIBRARY_PATH=/usr/local/unixodbc/lib:/usr/local/pgsqlodbc/lib:/u01/app/oracle/product/11.2.0/dbhome_1/bin)
    but EVNS should be ENVS or even better ENV. So please correct:
    (EVNS=LD_LIBRARY_PATH=/usr/local/unixodbc/lib:/usr/local/pgsqlodbc/lib:/u01/app/oracle/product/11.2.0/dbhome_1/bin)
    to
    (ENV="LD_LIBRARY_PATH=/usr/local/unixodbc/lib:/usr/local/pgsqlodbc/lib:/u01/app/oracle/product/11.2.0/dbhome_1/bin")
    Then stop and start the listener.
    - Klaus

  • Huge pauses in accept/fork server (postgresql) on 96GB S10 server

    Hi,
    We are deploying new hardware for our Solaris 10 Postgresql server and have stumbled onto a very confusing problem. This doesn't appear to be an obvious system limit issue, but something more complex.
    The new server is:
    dual Intel, four cores each, total of 16x threads w/hyperthreading enabled
    96GB memory
    60+ drives in several ZFS pools with cache and ZiL devices
    Running Postgresql 8.2.21, 32bit binaries (which is a requirement)
    Solaris 10 x64 at latest patchlevel
    Default system settings
    On the new server, when we attempt a connection to Postgresql, the main server process takes a very long time to accept & fork the child server process; several seconds rather than the usual 10+ milliseconds. The accept queue is processed at a glacial pace, rendering Postgresql completely unusable. During this time there are no errors from the operating system or the application and vmstat appears normal.
    Now for the confusing part: Proc tools don't work
    While the Postgresql process is not accepting/forking a child process, it is normal and observable using tools like truss, pstack, pmap, pfiles... However, when we attempted a pstack of the Postgresql daemon during the connect/accept/fork "hang", the pstack invocation hung for several seconds and returned no information except the PID and command-line information. A truss invocation also hung for several seconds, finally outputing a very slow stream of normal-looking output. When we gcore'd the process and tried looking at in gdb, there were only messages about address at zero, nothing to make sense of.
    We lowered the Postgresql shared memory from 1500MB to 700MB and the problem stopped. We whittled down the SHM size to working/non-working sizes, but they seemed to fluctuate. We have other servers that run these amounts of shared memory without issue. Given the fluctuation, we are hesitant to assume that there is ANY shared memory size that is reliable until we understand the problem.
    Now for the more confusing part: DTrace fixes the problem, at least while it is running
    We tried DTraceToolkit scripts to examine the PG process. As soon as we invoked dapptrace on the PID, connections began flowing, albeit at a pace that you would expect from a DTrace'd process. When we CTRL-C'd from the DTrace script and re-attempted to connect, the problem would return. By running dapptrace or another DTrace script, we could un-stick the Postgresql server process at will and bring it back by exiting the script.
    Now for the even more confusing part: Less memory is better, twice the apps is better still
    * We tried an identical, in every respect, server and could reproduce the condition
    * We tried an identical server, except with only 48GB memory, and could NOT reproduce the problem
    * We accidentally started two Postgresql processed with 1800MB shared memory each, but ONLY THE
    FIRST server was affected. Subsequent servers are not affected.
    * Trying to replicate the "sacrificial" server setup, we wrote a program to allocate shared memory and
    semaphores similar to a Postgreql process, then started a Postgresql process. The did not avoid the
    problem for the server, which we didn't expect. Perhaps we didn't perfectly recreate the scenario.
    The big questions:
    * What would oddly hang during fork with SHM?
    * Why would we hit this problem at 96GB memory but not 48GB?
    * Why would a DTrace script alter the condition for the better?
    * Why would one Postgresql process suffer the problem but not subsequent processes?
    Any help would be greatly appreciated.

    The problem seems to be related to or manifested in fork(). The forked process resumes immediately, but the forking process hangs for a great deal of time.
    The following is the code that is run, slightly abbreviated. "child done" takes zero seconds, but "parent done" has taken between zero and 42 seconds.
    int result;
    time_t start,end;
    start = time()
    result = fork();
    end = time(NULL);
    if (result == 0)
         elog(INFO,"fork_process:child done, %d", end - start);
    else
         elog(INFO,"fork_process:parent done, %d", end - start);
    011-07-25 17:03:02 PDT 3787 273 INFO: 00000: MJC::fork_process:parent done, 14
    2011-07-25 17:03:02 PDT 3787 309 INFO: 00000: MJC::fork_process:parent done, 0
    2011-07-25 17:03:02 PDT 3787 309 INFO: 00000: MJC::fork_process:child done, 0
    2011-07-25 17:03:19 PDT 3787 361 INFO: 00000: MJC::fork_process:child done, 0
    2011-07-25 17:04:01 PDT 3787 361 INFO: 00000: MJC::fork_process:parent done, 42
    2011-07-25 17:04:01 PDT 3787 379 INFO: 00000: MJC::fork_process:parent done, 0
    2011-07-25 17:04:01 PDT 3787 379 INFO: 00000: MJC::fork_process:child done, 0
    2011-07-25 17:04:01 PDT 3787 401 INFO: 00000: MJC::fork_process:parent done, 0
    2011-07-25 17:04:01 PDT 3787 401 INFO: 00000: MJC::fork_process:child done, 0
    2011-07-25 17:04:11 PDT 3787 469 INFO: 00000: MJC::fork_process:child done, 0
    2011-07-25 17:04:32 PDT 3787 469 INFO: 00000: MJC::fork_process:parent done, 21
    2011-07-25 17:04:33 PDT 3787 505 INFO: 00000: MJC::fork_process:child done, 0
    2011-07-25 17:04:39 PDT 3787 505 INFO: 00000: MJC::fork_process:parent done, 6
    2011-07-25 17:04:39 PDT 3787 541 INFO: 00000: MJC::fork_process:child done, 0
    2011-07-25 17:05:02 PDT 3787 541 INFO: 00000: MJC::fork_process:parent done, 23
    2011-07-25 17:05:02 PDT 3787 559 INFO: 00000: MJC::fork_process:parent done, 0
    2011-07-25 17:05:02 PDT 3787 559 INFO: 00000: MJC::fork_process:child done, 0
    2011-07-25 17:06:02 PDT 3787 595 INFO: 00000: MJC::fork_process:child done, 0
    2011-07-25 17:06:15 PDT 3787 595 INFO: 00000: MJC::fork_process:parent done, 13
    2011-07-25 17:07:15 PDT 3787 615 INFO: 00000: MJC::fork_process:child done, 0
    Edited by: 874267 on Jul 25, 2011 5:08 PM

  • Servlet inserting record into postgresql through hibernate

    Hi
    I have developed a servlet. This servlet is inserting record into postgres sql through hibernate using eclispe ide. When I run my code then I find the following exception
    exception
    java.lang.NullPointerException
         hibernate.example.FirstExample.doGet(FirstExample.java:54)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    I have developed the following code
    package hibernate.example;
    public class Contact {
         private String firstName;
         private String lastName;
         private String email;
         private long id;
         public String getEmail() {
         return email;
         public String getFirstName() {
         return firstName;
         public String getLastName() {
         return lastName;
         public void setEmail(String string) {
         email = string;
         public void setFirstName(String string) {
         firstName = string;
         public void setLastName(String string) {
         lastName = string;
         public long getId() {
         return id;
         public void setId(long l) {
         id = l;
    **Now the servlet is**
    package hibernate.example;
    import java.io.IOException;
    import java.io.PrintWriter;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import org.hibernate.Session;
    import org.hibernate.SessionFactory;
    import org.hibernate.cfg.Configuration;
    public class FirstExample extends HttpServlet     {
         Session session = null;
         public String getServletInfo() {
              return "Servlet connects to PostgreSQL database and displays result of a SELECT";
         public void doGet(HttpServletRequest request, HttpServletResponse response)
         throws IOException, ServletException {
              try{
                   response.setContentType("text/html");
                   PrintWriter out = response.getWriter();
                   Configuration cfg = new Configuration().configure();
                   SessionFactory factory = cfg.buildSessionFactory();
                   session = factory.openSession();
                   out.println("Inserting Record");
                   Contact contact = new Contact();
                   contact.setId(6);
                   contact.setFirstName("Deepak");
                   contact.setLastName("Kumar");
                   contact.setEmail("[email protected]");
                   session.save(contact);
                   out.println("Done");
              catch(Exception e){
                   System.err.println(e.getMessage());
              finally{
                   session.flush();
                   session.close();
    **web.xml is**
    <web-app>
              <database>
                   <driver>
                   <type>org.postgresql.Driver</type>
              <url>jdbc:postgresql://127.0.0.1:5432/ali</url>
              <user>ali</user>
              <password>ali</password>
                   </driver>
              </database>
              <servlet>
              <servlet-name>FirstExample</servlet-name>
              <servlet-class>hibernate.example.FirstExample</servlet-class>
              </servlet>
              <servlet-mapping>
              <servlet-name>FirstExample</servlet-name>
              <url-pattern>/hb</url-pattern>
              </servlet-mapping>
    </web-app>
    **And contact.hbm.xml is**
    <?xml version="1.0"?>
    <!DOCTYPE hibernate-mapping PUBLIC
    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
    <hibernate-mapping>
    <class name="hibernate.example.Contact" table="CONTACT">
    <id name="id" type="long" column="ID" >
    <generator class="assigned"/>
    </id>
    <property name="firstName">
    <column name="FIRSTNAME" />
    </property>
    <property name="lastName">
    <column name="LASTNAME"/>
    </property>
    <property name="email">
    <column name="EMAIL"/>
    </property>
    </class>
    </hibernate-mapping>
    **And hibernate.cfg.xml is**
    <?xml version='1.0' encoding='utf-8'?>
    <!DOCTYPE hibernate-configuration PUBLIC
    "-//Hibernate/Hibernate Configuration DTD//EN"
    "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
    <hibernate-configuration>
    <session-factory>
    <property name="hibernate.connection.driver_class">com.postgressql.jdbc.Driver</property>
    <property name="hibernate.connection.url">jdbc:postgresql://127.0.0.1:5432/ali</property>
    <property name="hibernate.connection.username">ali</property>
    <property name="hibernate.connection.password">ali</property>
    <property name="hibernate.connection.pool_size">10</property>
    <property name="show_sql">true</property>
    <property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
    <property name="hibernate.hbm2ddl.auto">update</property>
    <!-- Mapping files -->
    <mapping resource="contact.hbm.xml"/>
    </session-factory>
    </hibernate-configuration>
    Pleas tell me that where I have done the mistake and how can I resolove the error.

    ahmadgee wrote:
    Thank u very much.
    First I tried with out the servlet. I took a simple class. But it was displaying the null pointer exception.
    then you still have the problem. do you understand the root cause?
    After then I made a servlet. how was that going to help your null pointer exception?
    Now it is displaying error hibernate.cfg.xml not found.that's part of the problem. where is the servlet reading that file and initializing the session factory? how is it finding that file?
    i don't know where you have that .cfg.xml file, or where the recommended place is where hibernate expects to see it, but i'd bet it needs to be in the CLASSPATH, which means WEB-INF/classes.
    figure out why you get that NPE first, though. the servlet is only making things worse.
    %

  • How to use stored procedures in postgresql

    hiii,
    if any body knows how to create a stored procedure in postgresql
    please help me

    Hi,
    Refer the below link:
    JDBC:
    Receiver JDBC scenario MS access - /people/sameer.shadab/blog/2005/10/24/connecting-to-ms-access-using-receiver-jdbc-adapter-without-dsn
    /people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30 --> for jdbc receiver: file -JDBC
    Stored Procedures-
    /people/siva.maranani/blog/2005/05/21/jdbc-stored-procedures
    http://www.ics.com/support/docs/dx/1.5/tut6.html
    /people/sriram.vasudevan3/blog/2005/02/14/calling-stored-procs-in-maxdb-using-sap-xi
    http://www.ics.com/support/docs/dx/1.5/tut6.html
    http://java.sun.com/docs/books/tutorial/jdbc/basics/sql.html
    http://www.sqlteam.com/article/stored-procedures-an-overview
    HI in the message mapping structure u need to specify the different action and also u need to specify the procedure name.
    refer the below link which has all the associated action
    http://help.sap.com/saphelp_nw04s/helpdata/en/22/b4d13b633f7748b4d34f3191529946/frameset.htm
    Chirag

  • Bug while using string parameter values in postgresql query

    Hi,
    I have the following query for the postgresql database:
    Code:
    <queryString><![CDATA[SELECT
    evt_src_mgr_rpt_v."evt_src_mgr_name" AS esm_name,
    evt_src_collector_rpt_v."evt_src_collector_name" AS collector_name,
    evt_src_grp_rpt_v."evt_src_grp_name" AS grp_name,
    evt_src_grp_rpt_v."state_ind" AS state_ind,
    evt_src_rpt_v."evt_src_name" AS src_name,
    evt_src_rpt_v."date_modified" AS date_modified,
    evt_src_rpt_v."date_created" AS date_created,
    CASE WHEN $P{mysortfield} = 'evt_src_mgr_name' THEN evt_src_mgr_name
    WHEN $P{mysortfield} = 'evt_src_collector_name' THEN evt_src_collector_name
    WHEN $P{mysortfield} = 'evt_src_grp_name' THEN evt_src_grp_name
    ELSE evt_src_name END as sort
    FROM
    "evt_src_mgr_rpt_v" evt_src_mgr_rpt_v
    LEFT JOIN
    "evt_src_collector_rpt_v" evt_src_collector_rpt_v
    ON EVT_SRC_MGR_RPT_V."evt_src_mgr_id" = evt_src_collector_rpt_v."evt_src_mgr_id"
    LEFT JOIN
    "evt_src_grp_rpt_v" evt_src_grp_rpt_v
    ON evt_src_collector_rpt_v."evt_src_collector_id" = evt_src_grp_rpt_v."evt_src_collector_id"
    LEFT JOIN
    "evt_src_rpt_v" evt_src_rpt_v
    ON evt_src_grp_rpt_v."evt_src_grp_id" = evt_src_rpt_v."evt_src_grp_id"
    LEFT JOIN
    "evt_src_offset_rpt_v" evt_src_offset_rpt_v
    ON evt_src_rpt_v."evt_src_id" = evt_src_offset_rpt_v."evt_src_id"
    WHERE
    $P!{mysortfield} LIKE '$P!{searchvalue}' || '%']]></queryString>
    That is I try to select only the records where the field which is
    selected by user as report parameter ($P{mysortfield}) contains data
    starting with the text entered by user as a report parameter
    ($P{searchvalue}).
    When I try to run the report in iReport with active connection to the
    database the report is generated as expected.
    But when I try to run the report from Sentinel Log Manager I get the
    following error: "java.lang.String cannot be cast to
    net.sf.jasperreports.engine.JRValueParameter".
    After several detailed debug sessions I finally came into a conclusion
    that this error is related to the use of parameter values (
    $P!{mysortfield} and $P!{searchvalue} ).
    I even tried using the following WHERE clause (which emulates the
    queries as used in standart reports (especially at VendorProduct related
    SQL queries ) with no success:
    Code:
    WHERE
    ($P{mysortfield} = 'evt_src_mgr_name' AND evt_src_mgr_name LIKE ($P{searchvalue} || '%')) OR
    ($P{mysortfield} = 'evt_src_collector_name' AND evt_src_collector_name LIKE ($P{searchvalue} || '%')) OR
    ($P{mysortfield} = 'evt_src_grp_name' AND evt_src_grp_name LIKE ($P{searchvalue} || '%')) OR
    ($P{mysortfield} = 'evt_src_name' AND evt_src_name LIKE ($P{searchvalue} || '%'))
    Any suggestions?
    hkalyoncu
    hkalyoncu's Profile: http://forums.novell.com/member.php?userid=63527
    View this thread: http://forums.novell.com/showthread.php?t=450687

    bweiner12345;2167651 Wrote:
    > I'm not 100% sure the $P! (instead of just $P) is needed in that WHERE
    > portion of your SQL statement.
    >
    > What I would suggest doing is building the WHERE portion of your query
    > up again step by step. That is, instead of using any parameters in your
    > WHERE:
    >
    > $P!{mysortfield} LIKE '$P!{searchvalue}' || '%'
    >
    > ... take a step back and literally hard-code some values in there, such
    > as:
    >
    > evt_src_mgr_name LIKE '%' || '%'
    >
    > ... and run it on your box to make sure it works fine.
    >
    > If it works fine, start substituting the parameters one by one:
    >
    > $P{mysortfield} LIKE '%' || '%'
    >
    > .... test on the box.
    >
    > $P{mysortfield} LIKE '$P{searchvalue}' || '%'
    >
    > .... test on the box.
    >
    > It may be a little tedious, but at least you'll find out where the
    > problem is occurring... and may be quicker in the long run.
    >
    > (Note: In my above example steps I didn't use the ! in with the
    > parameters, as I don't think they are needed in the WHERE clause... but
    > I could be wrong... and by following the above step-by-step technique
    > should answer that for sure.)
    Thank you for the suggestions:
    While trying to implement your suggestions I realized that there was a
    error at the parameter name I used inside the where clause (it should be
    $P{searchfield}).
    Here are my results:
    Code:
    vt_src_mgr_name LIKE '%' || '%'
    worked as expected.
    Code:
    $P{searchfield} LIKE '%' || '%'
    produced PDF but wrong output.
    Code:
    $P!{searchfield} LIKE '%' || '%'
    resulted with the error "java.lang.String cannot be cast to
    net.sf.jasperreports.engine.JRValueParameter" and no PDF.
    Then I tried the following where clause which resulted in exactly as
    expected PDF:
    Code:
    WHERE
    ($P{searchfield} = 'evt_src_mgr_name' AND evt_src_mgr_name LIKE ($P{searchvalue} || '%')) OR
    ($P{searchfield} = 'evt_src_collector_name' AND evt_src_collector_name LIKE ($P{searchvalue} || '%')) OR
    ($P{searchfield} = 'evt_src_grp_name' AND evt_src_grp_name LIKE ($P{searchvalue} || '%')) OR
    ($P{searchfield} = 'evt_src_name' AND evt_src_name LIKE ($P{searchvalue} || '%'))
    As a summary:
    * The query which works in iRepord do not work in Sentinel Log
    Manager.
    * I found a workaround for my case.
    * I did not checked, but the reports provided in Sentinel RD which use
    the same technique for VendorProduct parameter (i.e. the reports with
    query string containing
    Code:
    LIKE ($P{VendorProduct} || '%')
    will most probably not work as expected IF Sentinel RD uses the same
    code as Sentinel Log Manager.
    hkalyoncu
    hkalyoncu's Profile: http://forums.novell.com/member.php?userid=63527
    View this thread: http://forums.novell.com/showthread.php?t=450687

  • [SOLVED] Can't get PostgreSQL to start after following Wiki instruc...

    I'm trying to start the postgresql service on my systemd installation. I've followed the instructions on the wiki. First I installed the package postgresql, then I uncommented the PGROOT line in the configuration file.
    When I try to run systemctl start postgresql, I get the following:
    # systemctl start postgresql
    Job for postgresql.service failed. See 'systemctl status postgresql.service' and 'journalctl -n' for details.
    # systemctl status postgresql
    postgresql.service - PostgreSQL database server
    Loaded: loaded (/usr/lib/systemd/system/postgresql.service; disabled)
    Active: failed (Result: exit-code) since Sun, 2012-10-28 14:08:48 CET; 34s ago
    Process: 12687 ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGROOT}/data (code=exited, status=1/FAILURE)
    CGroup: name=systemd:/system/postgresql.service
    Oct 28 14:08:48 nemesis systemd[1]: Starting PostgreSQL database server...
    Oct 28 14:08:48 nemesis postgres[12687]: "/var/lib/postgres/data" is missing or empty. Use a command like
    Oct 28 14:08:48 nemesis postgres[12687]: su - postgres -c "initdb --locale en_US.UTF-8 -D '/var/lib/postgres/data'"
    Oct 28 14:08:48 nemesis postgres[12687]: with relevant options, to initialize the database cluster.
    Oct 28 14:08:48 nemesis systemd[1]: Failed to start PostgreSQL database server.
    Oct 28 14:08:48 nemesis systemd[1]: Unit postgresql.service entered failed state
    I tried doing what it suggested to me:
    # su - postgres -c "initdb --locale en_US.UTF-8 -D '/var/lib/postgres/data'"
    The files belonging to this database system will be owned by user "postgres".
    This user must also own the server process.
    The database cluster will be initialized with locale "en_US.UTF-8".
    The default database encoding has accordingly been set to "UTF8".
    The default text search configuration will be set to "english".
    creating directory /var/lib/postgres/data ... initdb: could not create directory "/var/lib/postgres/data": Permission denied
    I also tried with the directory that was set in the configuration file, with similar results:
    # su - postgres -c "initdb --locale en_US.UTF-8 -D '/var/lib/postgres'"
    The files belonging to this database system will be owned by user "postgres".
    This user must also own the server process.
    The database cluster will be initialized with locale "en_US.UTF-8".
    The default database encoding has accordingly been set to "UTF8".
    The default text search configuration will be set to "english".
    fixing permissions on existing directory /var/lib/postgres ... initdb: could not change permissions of directory "/var/lib/postgres": Operation not permitted
    I don't know what to try next. I'm not sure what it needs me to do that it can't do itself. I've never worked with any kind of database system, I'm just installing PostgreSQL to start tinkering with it a bit for some pet projects.
    Thanks for your time
    Last edited by robrene (2012-10-28 13:24:52)

    Whelp, stupid me. Right after posting I managed to fix it myself. I'll post the solution and leave it here in case other people run into the same problem. The solution was to change the owner of the PGROOT directory and then running the initdb command again:
    # chown -R postgres:postgres /var/lib/postgres/
    # su - postgres -c "initdb --locale en_US.UTF-8 -D '/var/lib/postgres/data'"

  • [SOLVED] upgrading postgresql from 9.0.4

    I am trying to upgrade postgresql from 9.0.4 to 9.2.3 using the directions from the wiki (postgresql page, under "upgrading"), due to systemd causing my connections to be refused on my socket for 9.0.4...
    # pacman -S postgresql-old-upgrade postgresql-libs
    :: postgresql-libs is in IgnorePkg/IgnoreGroup. Install anyway? Y/n
    resolving dependencies...
    looking for inter-conflicts...
    :: postgresql-libs and postgresql are in conflict (postgresql-client). Remove postgresql? y/N
    If pacman wants to remove my old postgresql binaries, then how is pg_upgrade supposed to work when I need to feed it the location of the new binaries as well as the old ones?
    Last edited by awayand (2013-03-20 04:11:30)

    well I guess I have a solution now for those that have the same problem: http://blog.sleepmail.com/upgrading-pos … archlinux/

  • Postgresql installed but not working due to missing socket

    So I installed Postgresql onto my Mac and whenever I run anything like psql or createdb cool_database_name I get the following error.
    psql: could not connect to server: No such file or directory Is the server running locally
    and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
    So I follow along the different solutions. I reinstall postgresql to no avail. I go to postgresql.conf` and change it to
    #port = 5432                             # (change requires restart)
    #max_connections = 20                    # (change requires restart)
    # Note:  Increasing max_connections costs ~400 bytes of shared memory per
    # connection slot, plus lock space (see max_locks_per_transaction).
    #superuser_reserved_connections = 3     # (change requires restart)
    #unix_socket_directory = '/var/pgsql_socket'             # (change requires restart)
    #unix_socket_group = ''                 # (change requires restart)
    #unix_socket_permissions = 0777         # begin with 0 to use octal notation
    yet still nothing. I run commands such as
    ls -lA /var/run/postgresql
    Which tell me the file or directory does not exist.
    I also check into the pg_hba.conf file but everything looks ok
    # "local" is for Unix domain socket connections only local   all             all          trust
    # IPv4 local connections: host    all             all             127.0.0.1/32            trust
    # IPv6 local connections: host    all             all             ::1/128                 trust
    # Allow replication connections from localhost, by a user with the # replication privilege.
    #local   replication     jason                                trust
    #host    replication     jason        127.0.0.1/32            trust
    #host    replication     jason        ::1/128                 trust
    When I run psql -h localhost I get
    psql: could not connect to server: Connection refused Is the server running on host "localhost" (::1)
    and accepting TCP/IP connections on port 5432?
    could not connect to server:
    Connection refused Is the server running on host "localhost" (127.0.0.1) and
    accepting TCP/IP connections on port 5432?
    could not connect to server:
    Connection refused Is the server running on host "localhost" (fe80::1) and
    accepting TCP/IP connections on port 5432?
    I'm at a lost as to how to fix this. Any help would be appreciated.

    I see this all the time, even when AV is configured to exclude the RemoteInstall folder.
    To work around it I do:
    NET STOP WDSSERVER
    DISM /UnMount-Wim /MountDir:"F:\RemoteInstall\SMSTempBootFiles\ZZZ00011" /Discard
    DEL /f /s F:\RemoteInstall\SMSTempBootFiles\ZZZ00011\*.*
    DISM /Mount-Wim /WimFile:"F:\RemoteInstall\SMSImages\ZZZ00011\bootimage.wim" /index:1 /MountDir:"F:\RemoteInstall\SMSTempBootFiles\ZZZ00011"
    NET START WDSSERVER
    Where ZZZ00011 is the package id of your boot image
    This can be wrapped in a script for reuse
    After net stop wdsserver the unmount command is failing:
    Error DISM WIM Provider: PID=3892 TID=2220 base\ntsetup\opktools\dism\providers\wimprovider\dll\wimmanager.cpp:2796 - CWimManager::InternalOpUnmount(hr:0x80070032)

  • Cannot view postgresql tables

    I can not view tables or open the tables folder in Data Source Explorer when connected to a postgresql 9.2.4 database in Eclipse 4.4.2
    I have set the driver to postgresql-9.2-1003.jdbc4.jar.
    I can connect to the database, view the schema list, view the tables in pg_catalog but I can not view the tables in the public schema.
    Thanks
    Graham

    No response has been received.
    I went back to using Netbeans. Every so often I attempt to use Eclipse as it does have some advantages over Netbeans but every time I do, I end abandoning it because something does not work.
    Graham

Maybe you are looking for