On Fri, Jan 25, 2013 at 3:55 PM, Chris Wolf <cwolf.a...@gmail.com> wrote:
> I ask because when I use jpa:  in producer mode, I get this error:
> Caused by: oracle.net.ns.NetException: Listener refused the connection
> with the following error:
> ORA-12519, TNS:no appropriate service handler found
>
> Strangely, using  jpa: in consumer mode, this does not happen.  In the
> tnslsnr.log, I observe 120 connections being opened when
> running the route with jpa: in producer mode.  If I instead use a
> custom Processor and do my own JPA persistence code,
> the issue does not occur.
>
> Thanks for any advice,
>
> Chris


I stepped through with the debugger and the problem went away.  The
point at which a lot of connections were opened was
after I stepped over:

                return jpaTemplate.execute(new JpaCallback<Object>() {
                    public Object doInJpa(EntityManager entityManager)
throws PersistenceException {
                        return callback.doInJpa(entityManager);
                    }

..and when running in real time (not debugging) it seems to be running
in an AsyncProcessor - I wonder if it's too many worker
threads eating up the connections?  BTW, this is mt first project
using Camel, so forgive the lack of experience...


[ad #1 - file:///tmp/local/data] UnmarshallingContext           DEBUG
EOF reached at line 2007
[ad #1 - file:///tmp/local/data] SendProcessor                  DEBUG
>>>> Endpoint[jpa://?persistenceUnit=marketdata] Exchange[null]
[ad #1 - file:///tmp/local/data] JpaTransactionManager          DEBUG
Creating new transaction with name [null]:
PROPAGATION_REQUIRED,ISOLATION_DEFAULT
8505  marketdata  INFO   [Camel (camel-1) thread #1 -
file:///tmp/local/data] openjpa.Runtime - Starting OpenJPA 2.2.1
8535  marketdata  INFO   [Camel (camel-1) thread #1 -
file:///tmp/local/data] openjpa.jdbc.JDBC - Using dictionary class
"org.apache.openjpa.jdbc.sql.OracleDictionary".
[ad #1 - file:///tmp/local/data] JpaTransactionManager          DEBUG
Opened new EntityManager
[org.apache.openjpa.persistence.EntityManagerImpl@798b429b] for JPA
transaction
[ad #1 - file:///tmp/local/data] JpaTransactionManager          DEBUG
Initiating transaction commit
[ad #1 - file:///tmp/local/data] JpaTransactionManager          DEBUG
Committing JPA transaction on EntityManager
[org.apache.openjpa.persistence.EntityManagerImpl@798b429b]
[ad #1 - file:///tmp/local/data] JpaTransactionManager          DEBUG
Closing JPA EntityManager
[org.apache.openjpa.persistence.EntityManagerImpl@798b429b] after
transaction
[ad #1 - file:///tmp/local/data] EntityManagerFactoryUtils      DEBUG
Closing JPA EntityManager

Reply via email to