Database Connections Not Closing

I'm using iBatis for PostgreSQL database access and frequently have problems with connections not being closed. Here is a copy of my sqlMapConfig file:
============================
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE sqlMapConfig
PUBLIC "-//iBATIS.com//DTD SQL Map Config 2.0//EN"
"http://www.ibatis.com/dtd/sql-map-config-2.dtd">
<sqlMapConfig>
<properties resource="ibatis.properties" />
<settings
lazyLoadingEnabled="true"
cacheModelsEnabled="true"
enhancementEnabled="false"
useStatementNamespaces="false"
/>
<transactionManager type="JDBC" commitRequired="true">
<dataSource type="DBCP">
<property name="driverClassName" value="${driver}" />
<property name="url" value="${url}" />
<property name="username" value="${username}" />
<property name="password" value="${password}" />
<property name="maxActive" value="10"/>
<property name="maxIdle" value="5"/>
<property name="maxWait" value="5000"/>
<property name="logAbandoned" value="true"/>
<property name="removeAbandoned" value="true"/>
<property name="removeAbandonedTimeout" value="1"/>
<property name="Driver.logUnclosedConnections" value="true"/>
</dataSource>
</transactionManager>
<sqlMap resource="job-sqlMap.xml" />
</sqlMapConfig>
============================
Due to the logAbandoned and removeAbandoned settings, I get a report in my log file whenever there is a connection that was not properly closed. Here is one of those log entries:
23:22:51.483 (10) Finalizing a Connection that was never closed:
java.lang.Throwable: Connection was created at this point:
at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:175)
at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30)
at org.postgresql.jdbc3.Jdbc3Connection.<init>(Jdbc3Connection.java:24)
at org.postgresql.Driver.makeConnection(Driver.java:393)
at org.postgresql.Driver.connect(Driver.java:267)
at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294)
at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1148)
at org.apache.commons.dbcp.AbandonedObjectPool.borrowObject(AbandonedObjectPool.java:84)
at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:96)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
at com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.init(JdbcTransaction.java:48)
at com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.getConnection(JdbcTransaction.java:89)
at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryForList(MappedStatement.java:139)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:567)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:541)
at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:118)
at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(SqlMapClientImpl.java:94)
at edu.calpoly.lib.multimedia.big.db.AutomaticPeriodUpdateIBatisImplDBHandler.getGamesWithAutomaticUpdatePolicy(AutomaticPeriodUpdateIBatisImplDBHandler.java:154)
at edu.calpoly.lib.multimedia.big.game.AutoUpdateThread.run(AutoUpdateThread.java:155)
The file: AutomaticPeriodUpdateIBatisImplDBHandler.java contains an iBatis call on line # 154:
--> list = sqlMap.queryForList("getGamesWithAutoPolicy", null);
from the map file:
<select id="getGamesWithAutoPolicy" resultClass="java.util.HashMap">
<![CDATA[
SELECT gameid, policy
FROM update_policy
]]>
</select>
Here is the code for the entire method that uses this transaction:
============================
public List getGamesWithAutomaticUpdatePolicy() throws BIGDatabaseFacadeException
List list = new ArrayList();
try
sqlMap.startTransaction();
list = sqlMap.queryForList("getGamesWithAutoPolicy", null);
sqlMap.commitTransaction();
catch(SQLException sqle)
throw new BIGDatabaseFacadeException(sqle);
finally
try
sqlMap.endTransaction();
catch(SQLException sqle)
throw new BIGDatabaseFacadeException(sqle);
return list;
============================
I know that this should be handled as an automatic transaction, but I tried adding the start, commit and end transaction commands in my desperate attempt to fix this problem (but it still didn't help).
Here is my code for creation of sqlMap -
--> sqlMap = SqlMapClientBuilder.buildSqlMapClient(Resources.getResourceAsReader("sqlMaps.xml"));
Except for the fact that occasionally connections are not closed, overall my database access using iBatis works very well.
In the course of trying to fix this problem I've worked to update all my lib files to the latest versions, and here is current status:
My iBatis lib file: ibatis-2.3.4.726.jar
My JDBC driver: postgresql-8.4-701.jdbc3.jar
Required commons files:
commons-dbcp-1.2.2.jar
commons-pool-1.5.3.jar
Note that I tried adding --> commitRequired="true" to the transactionManager in sqlMaps.xml, hoping it might help, but no joy.
Please help me figure out why my database connections often do not close. Thank you very much!

I'm sorry, but I don't understand what you mean by "close the session." I believe iBatis is supposed to take care of all that automatically. My understanding is that all the user does is create the sqlMapClient and then use it along with various map files to query and update the database. iBatis does the rest.

Similar Messages

  • Database connection not closing on time out

    Hi All,
    Not sure if this is the right place for this question but..
    I've moved my app (built using jdev10.1.2., adf bc's and jsp's) to an app server. For some reason, the database connection is not closing. I have 46 connections to the database and I''m the only one with the URL, not good.
    So can anyone shed any light on this? I thought it should disconnect after a time out but its not.
    Any ideas would be gratfully received.
    Thanks in advance

    or try this one..
    Go to the bottom of the tutorial, you will find the configuration...
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/bc9baf90-0201-0010-479a-b49b25598ebf

  • Database connection not closed in Destroy()  method of servlet

    Hi,
    I have a problem with my deployed web application. At first, I thought Glassfish was messing up on me, and after checking the log I could see plenty of null pointer exceptions being thrown at lines in my code where I generate prepared statements from my connection object. I have been initialising my connection in the Init() method of all my classes, and equally, I've been closing it in Destroy(). I can only imagine that destroy() isn't being called - since the log clearly shows "connection success" messages but not "connection closed" messages. I am connecting to the servlets via a J2ME app on my mobile phone. Does connecting in this way somehow not invoke the destroy method when the servlets work is complete? Am I going to need to move all my connection initilisation and closing into the necessary doGet/doPost methods of each of my servlets?
    Chris

    You shouldn't be keeping the connection that long open. It's a bad design. It will timeout sooner or later and your complete application will crash. Always acquire and close the connection in the shortest possible scope, preferably just in the same method block where you process the query and/or results. If you want to improve performance while connecting, consider using a connection pool.
    Back to the actual problem: a servlet is created only once during application's lifetime and not during every request as you appears to think.
    You may find this tutorial useful to read on about using the DAO pattern in JSP/Servlet.
    [http://balusc.blogspot.com/2008/07/dao-tutorial-use-in-jspservlet.html]

  • TopLink logical connection not closed

    Hi everybody,
    I have a problem when using db adapter for polling databases tables. This is using TopLink to access database's data.
    My process was running w/o errors till I have started to use external data source defined in OAS.
    My oc4j-ra.xml file contains:
    ============================================================
         <connector-factory location="eis/DB/TestData" connector-name="Database Adapter">
              <config-property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
              <config-property name="connectionString" value=""/>
              <config-property name="userName" value=""/>
              <config-property name="password" value=""/>
              <config-property name="minConnections" value="5"/>
              <config-property name="maxConnections" value="5"/>
              <config-property name="minReadConnections" value="1"/>
              <config-property name="maxReadConnections" value="1"/>
              <config-property name="usesExternalConnectionPooling" value="true"/>
              <config-property name="dataSourceName" value="jdbc/TESTDS"/>
              <config-property name="usesExternalTransactionController" value="true"/>
              <config-property name="platformClassName" value="oracle.toplink.internal.databaseaccess.Oracle9Platform"/>
              <config-property name="usesNativeSequencing" value="true"/>
              <config-property name="sequencePreallocationSize" value="50"/>
              <config-property name="tableQualifier" value=""/>
              <config-property name="defaultNChar" value="false"/>
              <config-property name="usesBatchWriting" value="true"/>
         </connector-factory>
    ============================================================
    Once I have switched to this oc4j-ra.xml configuration file I got the following error in files logs (using the -Djdbc.connection.debug=true flag)
    ============================================================
    06/09/25 11:40:46 OrionCMTConnection not closed, check your code!
    06/09/25 11:40:46 Logical connection not closed, check your code!
    06/09/25 11:40:46 Created at:
    06/09/25 11:40:46 java.lang.Throwable: OrionCMTConnection created
    06/09/25 11:40:46      at com.evermind.sql.OrionCMTConnection.<init>(OrionCMTConnection.java:121)
    06/09/25 11:40:46      at com.evermind.sql.OrionCMTConnectionFinalize.<init>(OrionCMTConnectionFinalize.java:42)
    06/09/25 11:40:46      at com.evermind.util.ClassOptimizerFactory.getOrionCMTConnection(ClassOptimizerFactory.java:80)
    06/09/25 11:40:46      at com.evermind.sql.OrionCMTDataSource.getConnection(OrionCMTDataSource.java:237)
    06/09/25 11:40:46      at com.evermind.sql.OrionCMTDataSource.getConnection(OrionCMTDataSource.java:227)
    06/09/25 11:40:46      at oracle.toplink.jndi.JNDIConnector.connect(JNDIConnector.java:102)
    06/09/25 11:40:46      at oracle.toplink.sessions.DatabaseLogin.connect(DatabaseLogin.java:218)
    06/09/25 11:40:46      at oracle.toplink.internal.databaseaccess.DatabaseAccessor.reconnect(DatabaseAccessor.java:1323)
    06/09/25 11:40:46      at oracle.toplink.internal.databaseaccess.DatabaseAccessor.incrementCallCount(DatabaseAccessor.java:1198)
    06/09/25 11:40:46      at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:633)
    06/09/25 11:40:46      at oracle.toplink.publicinterface.Session.executeCall(Session.java:793)
    06/09/25 11:40:46      at oracle.toplink.internal.queryframework.CallQueryMechanism.executeCall(CallQueryMechanism.java:131)
    06/09/25 11:40:46      at oracle.toplink.internal.queryframework.CallQueryMechanism.executeCall(CallQueryMechanism.java:115)
    06/09/25 11:40:46      at oracle.toplink.internal.queryframework.CallQueryMechanism.executeSelectCall(CallQueryMechanism.java:194)
    06/09/25 11:40:46      at oracle.toplink.internal.queryframework.CallQueryMechanism.selectAllRows(CallQueryMechanism.java:565)
    06/09/25 11:40:46      at oracle.toplink.internal.queryframework.ExpressionQueryMechanism.selectAllRowsFromTable(ExpressionQueryMechanism.java:733)
    06/09/25 11:40:46      at oracle.toplink.internal.queryframework.ExpressionQueryMechanism.selectAllRows(ExpressionQueryMechanism.java:708)
    06/09/25 11:40:46      at oracle.toplink.queryframework.ReadAllQuery.execute(ReadAllQuery.java:447)
    06/09/25 11:40:46      at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:493)
    06/09/25 11:40:46      at oracle.toplink.queryframework.ReadQuery.execute(ReadQuery.java:125)
    06/09/25 11:40:46      at oracle.toplink.publicinterface.Session.internalExecuteQuery(Session.java:1958)
    06/09/25 11:40:46      at oracle.toplink.threetier.ClientSession.internalExecuteQuery(ClientSession.java:390)
    06/09/25 11:40:46      at oracle.toplink.publicinterface.Session.executeQuery(Session.java:1086)
    06/09/25 11:40:46      at oracle.toplink.publicinterface.Session.executeQuery(Session.java:1038)
    06/09/25 11:40:46      at oracle.toplink.publicinterface.Session.executeQuery(Session.java:876)
    06/09/25 11:40:46      at oracle.tip.adapter.db.inbound.DestructivePollingStrategy.poll(DestructivePollingStrategy.java:211)
    06/09/25 11:40:46      at oracle.tip.adapter.db.InboundWork.runOnce(InboundWork.java:247)
    06/09/25 11:40:46      at oracle.tip.adapter.db.InboundWork.run(InboundWork.java:213)
    06/09/25 11:40:46      at oracle.tip.adapter.fw.jca.work.WorkerJob.go(WorkerJob.java:51)
    06/09/25 11:40:46      at oracle.tip.adapter.fw.common.ThreadPool.run(ThreadPool.java:267)
    06/09/25 11:40:46      at java.lang.Thread.run(Thread.java:534)
    ============================================================
    Any clue on this?
    Thankfully,
    amo

    Thanks Marc,
    I have finally noticed that was not related with some TopLink error.
    So, is there any other way to refer in the DBAdapter to an OAS datasource?
    Regards,
    amo

  • Connection not closed in the database server end

    Hi,
    Our database server (sql server 2000) and java application are running in two different boxes. Because the java application sent to the db server quite a few queries that can not be completed (applications hangs there) due to huge amount of data (18 million records in one table and 1 million records in another table and there are joins among the three tables), we stopped the java program. However, in the db server end, the connections associated with these problem queries were not closed although the java app end already closed these connections by calling connection.close(). When this happened, we have to manually close the connection from sql server enterprise manager.
    Here are the questions.
    1)what could be the reason why db server does not close the connection?
    2)Is there any solution in the java end that could close the connection in the db server end when this situation happens? I say this situation happens, I mean in most cases when java application closes connection, db server closes connections in its end too.
    Thanks
    Mark

    mark.lin wrote:
    Thanks for your answers and questions.
    Here are the answers to your questions
    1)The jdbc driver is jturboJTurbo? Never heard of it. You mean this?
    http://www.newatlanta.com/products/jturbo/index.jsp
    Why pay for something when you have two options available that are free? One of them is from Microsoft itself. Whose idea was this?
    2)It's a desk top application.
    It seems to me that it should not be driver issue. I was this happened the Microsoft's own jdbc driver. By jdbc specification, although you don't close the connection explicitly in the program, the connection will be automatically closed in the java app end during garbage collection. Very bad - never depend on this. Always close your ResultSet, Statement, and Connection in reverse order of opening in a finally block, each one wrapped in individual try/catch blocks.
    One should never, ever depend on the GC to take care of resources like database connections or resource handles. Those should be cleaned up by your code.
    I tested this by intentionally not closing a connection. When I stops the application, the connection in the sql server end was also closed.
    But if you don't close the application and fail to close connections, you can see where eventually you'll exhaust the pool.
    It seems to me this is a sql server issue rather than a jdbc driver issue. I need way to prove this.
    Like I suggested, it's easy to swap in the jTDS driver and try it again. What do you have to lose?
    Or call Microsoft support and ask them. Or maybe JTurbo. You're paying for it - might as well use the support.
    %

  • Database.close not closing database?

    I've a singleton holding onto open (read-only) database handles, the environment and catalog DB handles. I'm using a StoredMap.get() to pull specific data items by their keys. Everything works fine, except in my JVM shutdown hook.
    The shutdown hook iterates over each of my open database handles and calls db.close() on them. Same goes for catalog DB and the environment.
    However, when the shutdown hook code gets to environment.close, it throws a DatabaseException saying - 1 database still open in environment.
    I've tried explicitly deallocating the reference to the database handle before calling db.close(). That doesn't help.
    Any ideas on what might cause a db.close to execute (no exceptions thrown), but the corresponding environment.close still thinks the database is not yet closed?
    I'm wondering if there is a timing aspect here, since the db.close and env.close are called in very rapid succession inside the shutdown hook code.
    Thanks

    Hi,
    Any ideas on what might cause a db.close to execute
    (no exceptions thrown), but the corresponding
    environment.close still thinks the database is not
    yet closed?
    I'm wondering if there is a timing aspect here, since
    the db.close and env.close are called in very rapid
    succession inside the shutdown hook code.Calling them in succession should not be a problem. Is it possible that you've opened a database more than once? You have to close each "handle' you've opened if you open a database multiple times.
    Mark

  • JDBC Connections not closed

    Hi,
    we work on a Jdevelopper intranet application and an Oc4j application server.
    recently, we have reached the maximum number of connections to an Oracle DB.
    apparently, we have a lot of old connections that are not closed!!
    is there any action to do on Oc4j configuration or Jdevelopper application to avoid this problem ??
    thank you for help.
    Cordialy

    Hi
    did you find any solution for this problem? I'm having the same problem...
    thanks in advanced
    Vitor

  • RH8/SQL2005 - database connection forcibly closed error

    We recently migrated from a SQL 2005 database instance on the same machine as the database to a database on the corporate SQL server instance. Testing seemed to proceed normally, but once we went into production (we build every evening with a perl script) we started encountering the following error:
    "D:/Program Files/Adobe/RoboSource Control 3/NGCMD.exe" CP $/subs/tafs -connection:webhelp_rh8 -I-
    "D:/Program Files/Adobe/RoboSource Control 3/NGCMD.exe" workfold $/subs/tafs . -connection:webhelp_rh8 -I-
    "D:/Program Files/Adobe/RoboSource Control 3/NGCMD.exe" Checkout tafs.hhk -connection:webhelp_rh8 -I-
    Building file list...
    File list built.
    Error: A transport-level error has occurred when sending the request to the server. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.)
    Error: Errors found while executing: "D:/Program Files/Adobe/RoboSource Control 3/NGCMD.exe" Checkout tafs.hhk -connection:webhelp_rh8 -I-
    Occurances are somewhat irregular, I can start the build manually and it runs fine, but when the automated script runs, as often as not, this error occurs.
    Has anyone else experienced a similar situation?
    .MW

    Doing binding configuration on a WCF service to override the default settings is not done the sameway it would be done on the client-side config file.
    A custom bindng must be used on the WCF service-side config to override the defualt binding settings on the WCF service-side.
    http://robbincremers.me/2012/01/01/wcf-custom-binding-by-configuration-and-by-binding-standardbindingelement-and-standardbindingcollectionelement/
    Thee readerQuotas and everything else must be given in the Custom Bindings to override any default setttings on the WCF service side.
    Also, you are posting to the wrong forum.
    http://social.msdn.microsoft.com/Forums/vstudio/en-us/home?forum=wcf

  • Database connection not working in Crystal Reports for Eclipse 2.0

    Hello All,
    We have several hunderd reports that were created in CR 8.5.  We are moving to a new Java  environemnt and we are also considering using BIRT.However to save development time and effort we are considering using the CR for Eclipse 2.0. For a proof of concept, we loaded several of our 8.5 reports into Crystal reports XI, saved them, and then loaded them into our CR for eclipse design environment.
    These reports were built from the values returned from a store procedure.. When we try to execute the reports from within Eclipse, we get  Error finding JNDI name (xxxx). We have created the appropriate datasource (to Sybase 12.5.4), and the schema is viewable in the db explorer. However when we associate the connection to this datasource, the connection no longer appears in the field explorer and no data is returned upon previewing the report.
    The original reports used ODBC to access the database. Is there anyway to easily convert these reports to using the Sybase JDBC datasource? Also in the DB explorer, the SPs are only showing the SP parameters,not the return values, so we are unable to easily drag the return fields onto the report to reset the links.
    Thanks in advance
    Edited by: Michael Knight on Oct 7, 2009 1:46 PM

    Michael,
    We had a similar situation but from my reseach the output from the stored procs cannot be viewed in the report designer in Eclipse. So we had to design the reports using the Crystal Reports Devloper application (the stand-alone version, not the Eclipse editor). The reports were designed w/an ODBC datasource. In order to get that working we had to create a JNDI JDBC datasource connection w/the exact same name as the ODBC datasource and that works. For example, the ODBC datasource was named OP01DSDB01.WORLD so we just created a JNDI datasource w/that exact same name (no jdbc/OP01DSDB01.WORLD just OP01DSDB01.WORLD). I'm not sure if there is a workaround for any of this but this was the easiest way to get them working.
    I know this isn't the ideal situation, but that was the easiest way to get things working.

  • Database connection not working across all Adobe programs

    I have a PDF form connected to an Access database via ODBC. On the form, I created a button that, when clicked, takes the data in the PDF and adds it to the database. The scripts for that action and the connection was established in LiveCycle Designer. I opened the PDF in Acrobat Pro and enabled Usage Rights for Reader (overwriting the file in the process). Here's what I find odd. The button works fine in Acrobat Pro, but when I open the PDF in Reader and try the button, it gives me an error saying that the accessor 'xfa.sourceSet.DataConnection.open();' is unknown. Why on earth would Adobe recognize the connection in Acrobat but not in Reader? That doesn't make sense to me, especially since I did enable the usage rights.

    I do not see where this permission is given in the enablement of Acrobat Professional Forms. What I see is the following:
    - Save form data
    - Commenting and drawing mark-up tools
    - Sign an existing signature field
    - Digitally sign the documen anywher on the page (only supported in Adobe Reader 8.0)
    I do not see connect to a database anywhere.
    Sabian

  • Jdbc Connections not closed on OC4J 9.0.4 - BUG VERSION?

    Hi, I migrate my applications from 9ias 9.0.3 to OAS 10g with OC4J 9.0.4.
    After migration, the jdbc connections provide by Data Source Names don't be closed in Oracle Database 8.1.7, stay INACTIVE state, and in few time of access, the Oracle Database exceded limit of sessions.
    The OC4J 9.0.4.1 resolve this problem ? Where i can download this release ?
    Any body have any idea ?
    thanks,
    Danilo

    Hi
    did you find any solution for this problem? I'm having the same problem...
    thanks in advanced
    Vitor

  • Third Party database connections not present

    I just downloaded the latest production build: 3.0.04.34 and I'm trying to setup a migration from MSSQL Server to Oracle, but the only connection options I am given are for Oracle and Access. This, in spite of the fact that all the 3.0 documentation states there are separate tabs for other third party vendors in the connection dialogue. What am I missing?

    You haven't read the documentation properly.
    The third party tabs don't appear until you have downloaded and registered the appropriate 3rd party JDBC drivers. This is described clearly in the help file.

  • [Bug] Or feature? Database connection closed if given a name after first op

    I am not sure if this is a bug or a feature.
    oracle.javatools.db.Database db = oracle.javatools.db.DatabaseFactory.findOrCreateDatabase("sample", conn);
    If I supply a name for the database as the above line using "sample", the database connection is closed after the first op, i.e., you can call
    db.listObjects once, but the second time, it will fail with StackOverFlowException. But the culprit is the database connection is closed after the first op.
    However, if I don't give it a name, using null,
    oracle.javatools.db.Database db = oracle.javatools.db.DatabaseFactory.findOrCreateDatabase(null, conn);
    There's no problem at all.
    Is this a bug or a feature?
    If a feature, the JavaDoc made it worse, by using the following example:
    http://www.oracle.com/technology/products/jdev/esdk/api1013/oracle/javatools/db/DatabaseFactory.html
    The DatabaseFactory should be used over the DBObjectProviderFactory when a Database specifically is required, and the name and Connection of that Database are available.
    e.g.
    java.sql.Connection conn = // the Connection to the db
    DatabaseFactory.findOrCreateDatabase( "ora10g", conn );
    The example sure sounds like a name is mandatory. Or perhaps the name is not some random name, but TNSName? If so, the Doc should certainly mention that.

    I am not sure if this is a bug or a feature.
    oracle.javatools.db.Database db = oracle.javatools.db.DatabaseFactory.findOrCreateDatabase("sample", conn);
    If I supply a name for the database as the above line using "sample", the database connection is closed after the first op, i.e., you can call
    db.listObjects once, but the second time, it will fail with StackOverFlowException. But the culprit is the database connection is closed after the first op.
    However, if I don't give it a name, using null,
    oracle.javatools.db.Database db = oracle.javatools.db.DatabaseFactory.findOrCreateDatabase(null, conn);
    There's no problem at all.
    Is this a bug or a feature?
    If a feature, the JavaDoc made it worse, by using the following example:
    http://www.oracle.com/technology/products/jdev/esdk/api1013/oracle/javatools/db/DatabaseFactory.html
    The DatabaseFactory should be used over the DBObjectProviderFactory when a Database specifically is required, and the name and Connection of that Database are available.
    e.g.
    java.sql.Connection conn = // the Connection to the db
    DatabaseFactory.findOrCreateDatabase( "ora10g", conn );
    The example sure sounds like a name is mandatory. Or perhaps the name is not some random name, but TNSName? If so, the Doc should certainly mention that.

  • Date dimension fragmentation from 2 different database connections

    Hi Everyone,
    In obiee 10g, is it possible to implement fragmentation on a date dimension from 2 different physical database connections (not schemas)?
    For example:
    Physical connection & dimension 1: physical1.obiee_rpd.w_mcal_day_d.date
    physical connection & dimension 2: physical2.obia_rpd.w_mcal_day_d.date
    the fact table will be: physical1.obiee_rpd.w_fact_f.fact
    The 2 physical dimension tables will be joined to the 1 fact table in the physical layer.
    I then create a BMM with 2 LTS : physical1.obiee_rpd.w_mcal_day_d and physical2.obia_rpd.w_mcal_day_d.
    I then create 1 logical column in that BMM which sources both physical1.obiee_rpd.w_mcal_day_d.date and physical2.obia_rpd.w_mcal_day_d.date.
    Then, i set up fragmentation to use physical1.obiee_rpd.w_mcal_day_d.date when physical1.obiee_rpd.w_mcal_day_d.date < '04/30/2012' and use physical2.obiee_rpd.w_mcal_day_d.date when physical1.obiee_rpd.w_mcal_day_d.date >= '05/01/2012'.
    The problem is that the query that answers generates always uses physical1.obieerpd.w_mcal_day_d.date , regardless of the date filter applied!_
    Any tips?
    Thanks!

    Hy,
    Can you try the following.
    Define:
    - one logical date dimension with two logical table sources (physical1.obiee_rpd.w_mcal_day_d.date and physical2.obia_rpd.w_mcal_day_d.date)
    - one logical fact table with two Logical Table Source (LTS). And in each LTS, define the same logical level in the content tab and don't forget to check the checkbox "This source should be combined with other sources at this level".
    Cheers
    Nico
    Edited by: gerardnico on Jun 25, 2012 4:23 PM Date and not datum (Dutch)

  • OrionCMTConnection not closed, check your code. OrionCMTConnection created

    Hi everybody, I have an application running in OAS 10g, this application generally works fine, but in the opmn log of my instance in found the next message :
    07/01/09 17:01:56 OrionCMTConnection not closed, check your code!
    07/01/09 17:01:56 Logical connection not closed, check your code!
    07/01/09 17:01:56 Created at:
    07/01/09 17:01:56 java.lang.Throwable: OrionCMTConnection created
    07/01/09 17:01:56 at com.evermind.sql.OrionCMTConnection.<init>(OrionCMTConnection.java:121)
    07/01/09 17:01:56 at com.evermind.sql.OrionCMTConnectionFinalize.<init>(OrionCMTConnectionFinalize.java:42)
    07/01/09 17:01:56 at com.evermind.util.ClassOptimizerFactory.getOrionCMTConnection(ClassOptimizerFactory.java:80)
    07/01/09 17:01:56 at com.evermind.sql.OrionCMTDataSource.getConnection(OrionCMTDataSource.java:237)
    07/01/09 17:01:56 at com.evermind.sql.OrionCMTDataSource.getConnection(OrionCMTDataSource.java:217)
    07/01/09 17:01:56 at view.base_control_maq.consulta_t_orden_produccion_cod(base_control_maq.java:1934)
    07/01/09 17:01:56 at control_maq._detalle__control__actividad._jspService(_detalle__control__actividad.java:280)
    07/01/09 17:01:56 at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
    07/01/09 17:01:56 at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:350)
    07/01/09 17:01:56 at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509)
    07/01/09 17:01:56 at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413)
    07/01/09 17:01:56 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    07/01/09 17:01:56 at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:824)
    07/01/09 17:01:56 at com.evermind.server.http.ServletRequestDispatcher.include(ServletRequestDispatcher.java:121)
    07/01/09 17:01:56 at com.evermind.server.http.EvermindPageContext.include(EvermindPageContext.java:267)
    07/01/09 17:01:56 at org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:99)
    07/01/09 17:01:56 at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:135)
    07/01/09 17:01:56 at org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:760)
    07/01/09 17:01:56 at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:892)
    07/01/09 17:01:56 at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:462)
    07/01/09 17:01:56 at templetas.template._jspService(_template.java:68)
    07/01/09 17:01:56 at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
    07/01/09 17:01:56 at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:350)
    07/01/09 17:01:56 at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509)
    07/01/09 17:01:56 at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413)
    07/01/09 17:01:56 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    07/01/09 17:01:56 at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:824)
    07/01/09 17:01:56 at com.evermind.server.http.ServletRequestDispatcher.include(ServletRequestDispatcher.java:121)
    07/01/09 17:01:56 at com.evermind.server.http.EvermindPageContext.include(EvermindPageContext.java:267)
    07/01/09 17:01:56 at org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:99)
    07/01/09 17:01:56 at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:135)
    07/01/09 17:01:56 at org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:760)
    07/01/09 17:01:56 at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:892)
    07/01/09 17:01:56 at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:462)
    07/01/09 17:01:56 at control_maq._control__actividad._jspService(_control__actividad.java:125)
    07/01/09 17:01:56 at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
    07/01/09 17:01:56 at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:350)
    07/01/09 17:01:56 at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509)
    07/01/09 17:01:56 at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413)
    07/01/09 17:01:56 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    07/01/09 17:01:56 at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:824)
    07/01/09 17:01:56 at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
    07/01/09 17:01:56 at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:222)
    07/01/09 17:01:56 at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1063)
    07/01/09 17:01:56 at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:263)
    07/01/09 17:01:56 at org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:1001)
    07/01/09 17:01:56 at org.apache.struts.tiles.TilesRequestProcessor.internalModuleRelativeForward(TilesRequestProcessor.java:345)
    07/01/09 17:01:56 at org.apache.struts.action.RequestProcessor.processForward(RequestProcessor.java:560)
    07/01/09 17:01:56 at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:209)
    07/01/09 17:01:56 at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
    07/01/09 17:01:56 at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
    07/01/09 17:01:56 at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    07/01/09 17:01:56 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    07/01/09 17:01:56 at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
    07/01/09 17:01:56 at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:239)
    07/01/09 17:01:56 at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:663)
    07/01/09 17:01:56 at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
    07/01/09 17:01:56 at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
    07/01/09 17:01:56 at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:224)
    07/01/09 17:01:56 at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:133)
    07/01/09 17:01:56 at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
    07/01/09 17:01:56 at java.lang.Thread.run(Thread.java:534)
    This error occurred with other java files too, but in the code apparently the jdbc connections are closed. I'm searching since a week the problem and different solutions in the forum but this does not apply for my problem, please help me.
    Regards
    Jeanette.

    Thanks Frances, but I set -Ddatasource.verbose=true and get some like this:
    Releasing connection com.evermind.sql.DriverManagerXAConnection@1cf6046 to pool (Pool size: 5)
    com.evermind.sql.OrionCMTDataSource@1a9a15f: Cache timeout, closing connection (Pool size: 4)
    com.evermind.sql.OrionCMTDataSource@1a9a15f: Cache timeout, closing connection (Pool size: 3)
    com.evermind.sql.OrionCMTDataSource@1a9a15f: Cache timeout, closing connection (Pool size: 2)
    com.evermind.sql.OrionCMTDataSource@1a9a15f: Cache timeout, closing connection (Pool size: 1)
    null: Releasing connection com.evermind.sql.DriverManagerXAConnection@6409e1 to pool (Pool size: 1)
    I suppose that some connections were closed well and others didn't close in the right form and use cache timeout.
    Nevertheless even now I don’t know how to correct the message of connection:
    07/01/11 18:31:44 OrionCMTConnection not closed, check your code!
    07/01/11 18:31:44 Logical connection not closed, check your code!
    07/01/11 18:31:44 Created at:
    07/01/11 18:31:44 java.lang.Throwable: OrionCMTConnection created
    07/01/11 18:31:44 at com.evermind.sql.OrionCMTConnection.<init>(OrionCMTConnection.java:121)
    07/01/11 18:31:44 at com.evermind.sql.OrionCMTConnectionFinalize.<init>(OrionCMTConnectionFinalize.java:42).........
    This time in the log I found other lines before the OrionCMTConnection….:
    null: Releasing connection com.evermind.sql.DriverManagerXAConnection@d35cb2 to pool (Pool size: 1)
    INFO - GenericFilterBean.init(118) | Initializing filter 'hibernateFilter'
    INFO - GenericFilterBean.init(143) | Filter 'hibernateFilter' configured successfully
    INFO - AbstractBeanFactory.getBean(219) | Creating shared instance of singleton bean 'sessionFactory'
    INFO - AbstractBeanFactory.getBean(219) | Creating shared instance of singleton bean 'sessionFactory'
    INFO - AbstractBeanFactory.getBean(219) | Creating shared instance of singleton bean 'dataSource'
    INFO - AbstractBeanFactory.getBean(219) | Creating shared instance of singleton bean 'dataSource'
    INFO - Environment.<clinit>(464) | Hibernate 3.0.5
    INFO - Environment.<clinit>(477) | hibernate.properties not found
    INFO - Environment.<clinit>(510) | using CGLIB reflection optimizer
    INFO - Environment.<clinit>(540) | using JDK 1.4 java.sql.Timestamp handling
    I'm totally disoriented now.. please help me
    Jane.

Maybe you are looking for

  • MB5S  GR/IR Analysis

    Dear Experts IN MB5s Report System is taking Qty of GR is 2 times if DCGR is two times and if its 3 times then system will Take add of All DCGR Are add when we r checking in MB5s  and about the IR qty its add all of Separte qty regarding the posting

  • Display seems like 16 bit color with slight flicker

    When I turned my iMac on today, it's like the display color spectrum is on 16 bit color and it has a flicker to it. This happed all of the sudden. It's less than a year old. 21" iMac Intel Core 2 Duo NVIDIA GeForce 9400 VRAM 256MB Any ideas?

  • Convert from jchar to char

    Does any one know how to convert from jchar to char? Thank you,

  • Objects fine in Muse, Resized and Moved in Browser

    Hiya Folks! I'm a bit stumped on this problem. I've designed a web page in Muse where alignment is incredibly important. Tweaked it until it was perfect in Muse and then I launched it to check it out in the browser. When previewed in the browser, it

  • How to debug the smart forms

    Hi All, Can any body guide me how to debug the smart forms. Thanks & Regards, Satish.