I don't know if this affects you, but I have serious trouble with
maxIdle < 2... So I always set it to 2 or greather...
Since you configured to use TestOnBorrow, check query you are using to
make this test. I use something like "select 1 from DUAL" in Oracle
databases, and "select 1" in MS SQL. I don't know what you can do in
MySQL, but choose one very fast, because it could has heavy impact on
your app later...
<intl lang='pt_BR'>
Olá!
Marcel, eu trabalho com o OJB a uns 4 anos... e não tenho problemas com
beginTransaction. Porém, com o SapDB, notadamente, eu tinha problemas
para obter conexões se eu deixasse o parametro maxIdle = 1 ou maxIdle =
0... E o SapDB também tinha o péssimo hábito de fechar minhas conexões e
não re-abrí-las. Então, eu sempre usei maxIdle = 2, e TestOnBorrow=true
e ainda a query que eu usava para o teste (que não ví na tua
configuração) era "select 1 from DUAL", e no MS SQL é simplesmente
"select 1".
Eu até tinha esquecido deste parametro (maxIdle), e não mudei quando
migrei de SapDB para Oracle e posteriormente para MS SQL...
Espero que isto ajude.
</intl>
Richter
Marcel Souza escreveu:
Hello folks,
I am stucked in a problem using OJB.
I am trying to use MySQL and OJB but it always happens an error during
broker.beginTransaction() that says "Can't lookup a connection".
Anyone has a sugestion to solve it???
Thanks in advance, Marcel.
15:33:01,390 INFO [ObjectCacheFactory] Start creating new ObjectCache instance
15:33:01,390 INFO [ObjectCacheFactory] Default ObjectCache class was org.apache
.ojb.broker.cache.ObjectCacheDefaultImpl
15:33:01,390 INFO [CacheDistributor] Use property 'descriptorBasedCaches' is se
t 'false'
15:33:01,390 INFO [ObjectCacheFactory] Instantiate new org.apache.ojb.broker.ca
che.CacheDistributor class object
15:33:01,390 INFO [ObjectCacheFactory] New ObjectCache instance was created
15:33:01,390 INFO [ConnectionFactoryPooledImpl] Create new connection pool:org.
[EMAIL PROTECTED]
jcd-alias=mysql
default-connection=false
dbms=MySQL
jdbc-level=2.0
driver=com.mysql.jdbc.Driver
protocol=jdbc
sub-protocol=mysql
db-alias=//localhost:3306/lportal
user=root
password=*****
eager-release=false
ConnectionPoolDescriptor={whenExhaustedAction=0, maxIdle=-1, maxActive=21, max
Wait=5000, removeAbandoned=false, numTestsPerEvictionRun=10, testWhileIdle=false
, minEvictableIdleTimeMillis=600000, testOnReturn=false, logAbandoned=false, rem
oveAbandonedTimeout=300, timeBetweenEvictionRunsMillis=-1, testOnBorrow=true}
batchMode=false
useAutoCommit=AUTO_COMMIT_SET_TRUE_AND_TEMPORARY_FALSE
ignoreAutoCommitExceptions=false
sequenceDescriptor=<null>
]
15:33:01,390 INFO [STDOUT] javax.portlet.PortletException: Erro DoViewPadrao -
Can't lookup a connection
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]