From users-return-22738-apmail-activemq-users-archive=activemq.apache.org@activemq.apache.org Fri Mar 05 15:30:42 2010 Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 77478 invoked from network); 5 Mar 2010 15:30:42 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 5 Mar 2010 15:30:42 -0000 Received: (qmail 95020 invoked by uid 500); 5 Mar 2010 15:30:27 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 94991 invoked by uid 500); 5 Mar 2010 15:30:27 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 94983 invoked by uid 99); 5 Mar 2010 15:30:27 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Mar 2010 15:30:27 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,SPF_HELO_PASS,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Mar 2010 15:30:20 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1NnZTT-00045t-Si for users@activemq.apache.org; Fri, 05 Mar 2010 07:29:59 -0800 Message-ID: <27795341.post@talk.nabble.com> Date: Fri, 5 Mar 2010 07:29:59 -0800 (PST) From: magellings To: users@activemq.apache.org Subject: Re: MasterSlave | Spring + Camel + ActiveMQ + C3P0 + Oracle In-Reply-To: <27791033.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: mark.gellings@qg.com References: <27780184.post@talk.nabble.com> <27781613.post@talk.nabble.com> <27791033.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org Not sure. If you go to c3p0's website there probably is an explanation for that config... juhasiltanen wrote: > > Hi, > > Thank you for your quick reply! > > It is now working as it should, I combined the properties we had with the > properties you had. Only one property needed to be excluded and it was > unreturnedConnectionTimeout. > > Do you have an idea why this property is causing a failure to acquire a > lock / conenction failure? > > My DS bean configuration is now: > > destroy-method="close"> > > > > > > > > > > > > > > > > > > > And at least in out development environment it is working ok. Thank you > for your help! > > > magellings wrote: >> >> we are using c3p0 with sql server. Be sure there is a record inserted >> into the lock table. If there isn't after 30s the master broker will >> fail as you see and shutdown. You can ensure the record is inserted if >> you set createTablesOnStartup to true, but then I'd recommend setting >> this back to false. You could also just query the lock table to see if >> the record is there. If not, below is how to insert it, as well as our >> config... >> >> >> >> > createTablesOnStartup="false" /> >> >> >> >> > destroy-method="close"> >> > value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/> >> > value="jdbc:sqlserver://xxx:1433;databaseName=ActiveMQSmartStudio"/> >> >> >> >> >> >> >> >> >> >> >> INSERT INTO ACTIVEMQ_LOCK(ID) VALUES (1) >> >> >> >> juhasiltanen wrote: >>> >>> Hi, >>> >>> I am trying to get the MasterSlave configuration to work properly using >>> JDBC persistence with C3P0 Connection pool with my Oracle DataSource. >>> >>> I have a single instance of my client application and two ActiveMQ >>> instances on different ports. >>> >>> When I try to start up each of the ActiveMQ instances, the startup >>> fails, because the ActiveMQ can not get a lock on the database. At this >>> point I don't even have my client app running. >>> >>> First the console displays some information during the startup... >>> >>> >>> INFO | A checked-out resource is overdue, and will be destroyed: >>> com.mchange.v2.c3p0.impl.NewPooledConnection@7a4489 | >>> com.mchange.v2.resourcepool.BasicResourcePool | Timer-0 >>> DEBUG | Preparing to destroy resource: >>> com.mchange.v2.c3p0.impl.NewPooledConnection@13f136e | >>> com.mchange.v2.resourcepool.BasicResourcePool | >>> com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1 >>> DEBUG | Preparing to destroy PooledConnection: >>> com.mchange.v2.c3p0.impl.NewPooledConnection@13f136e | >>> com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool | >>> com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1 >>> >>> .... >>> >>> ERROR | Failed to update database lock: java.sql.SQLException: Closed >>> Connection | org.apache.activemq.store.jdbc.DefaultDatabaseLocker | >>> ActiveMQ Cleanup Timer >>> java.sql.SQLException: Closed Connection >>> at >>> oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112) >>> at >>> oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146) >>> at >>> oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208) >>> at >>> oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:868) >>> at >>> oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:787) >>> at >>> com.mchange.v2.c3p0.impl.NewProxyConnection.prepareStatement(NewProxyConnection.java:213) >>> at >>> org.apache.activemq.store.jdbc.DefaultDatabaseLocker.keepAlive(DefaultDatabaseLocker.java:159) >>> at >>> org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.databaseLockKeepAlive(JDBCPersistenceAdapter.java:508) >>> at >>> org.apache.activemq.store.jdbc.JDBCPersistenceAdapter$1.run(JDBCPersistenceAdapter.java:203) >>> at >>> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) >>> at >>> java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) >>> at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) >>> at >>> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98) >>> at >>> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181) >>> at >>> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205) >>> at >>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) >>> at >>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) >>> at java.lang.Thread.run(Thread.java:619) >>> >>> >>> .... >>> >>> >>> INFO | No longer able to keep the exclusive lock so giving up being a >>> master | org.apache.activemq.store.jdbc.JDBCPersistenceAdapter | >>> ActiveMQ Cleanup Timer >>> INFO | ActiveMQ Message Broker (localhost, >>> ID:4FIL46076-4276-1267705377671-0:0) is shutting down | >>> org.apache.activemq.broker.BrokerService | ActiveMQ Cleanup Timer >>> >>> >>> ... >>> >>> And then the AMQ instance shuts down, as expected from the log messages. >>> >>> Here is the DataSource and connector configurations I am using: >>> >>> >> destroy-method="close"> >>> >>> >> value="jdbc:oracle:thin:@111.111.111.111:1521:abcd"/> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> ... >>> >>> >>> >>> >>> >>> ... >>> >>> Has anyone succesfully used C3P0 connection pool with Oracle and >>> ActiveMQ? >>> >>> Does anyone have any idea why this setup does not work? >>> >>> Thank you for your help! >>> >>> >> >> > > -- View this message in context: http://old.nabble.com/MasterSlave-%7C-Spring-%2B-Camel-%2B-ActiveMQ-%2B-C3P0-%2B-Oracle-tp27780184p27795341.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.