db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamh <...@bccampus.ca>
Subject Strange problem: timeout first time, then ok
Date Tue, 09 Dec 2008 20:11:01 GMT

Hello,

I am running into something quite odd, and wanted to see if anyone could
shed light on this.  I have defined two persistence beans as:

<spring:bean id="certPersistFactory" scope="singleton"
class="org.springframework.orm.jdo.LocalPersistenceManagerFactoryBean">
          <spring:property name="jdoProperties">
            <spring:props>
                <spring:prop
key="javax.jdo.PersistenceManagerFactoryClass">org.jpox.jdo.JDOPersistenceManagerFactory
</spring:prop>
                <spring:prop
key="javax.jdo.option.ConnectionURL">jdbc:sqlserver://1.2.3.4:1433;DatabaseName=dbcert;SelectMethod=cursor</spring:prop>
                <spring:prop
key="javax.jdo.option.ConnectionUserName">user1</spring:prop>
                <spring:prop
key="javax.jdo.option.ConnectionPassword">passwd1</spring:prop>
                <spring:prop
key="javax.jdo.option.ConnectionDriverName">com.microsoft.sqlserver.jdbc.SQLServerDriver
</spring:prop>
                <spring:prop
key="javax.jdo.option.NontransactionalWrite">true</spring:prop>
                <spring:prop
key="org.jpox.identifier.case">PreserveCase</spring:prop>
                <spring:prop
key="org.jpox.fixedDatastore">true</spring:prop>
                <spring:prop
key="org.jpox.validateTables">false</spring:prop>
            </spring:props>
          </spring:property>
        </spring:bean>

<spring:bean id="prodPersistFactory" scope="singleton"
class="org.springframework.orm.jdo.LocalPersistenceManagerFactoryBean">
          <spring:property name="jdoProperties">
            <spring:props>
                <spring:prop
key="javax.jdo.PersistenceManagerFactoryClass">org.jpox.jdo.JDOPersistenceManagerFactory
</spring:prop>
                <spring:prop
key="javax.jdo.option.ConnectionURL">jdbc:sqlserver://1.2.3.4:9546;DatabaseName=dbcert;SelectMethod=cursor</spring:prop>
                <spring:prop
key="javax.jdo.option.ConnectionUserName">user2</spring:prop>
                <spring:prop
key="javax.jdo.option.ConnectionPassword">passwd2</spring:prop>
                <spring:prop
key="javax.jdo.option.ConnectionDriverName">com.microsoft.sqlserver.jdbc.SQLServerDriver
</spring:prop>
                <spring:prop
key="javax.jdo.option.NontransactionalWrite">true</spring:prop>
                <spring:prop
key="org.jpox.identifier.case">PreserveCase</spring:prop>
                <spring:prop
key="org.jpox.fixedDatastore">true</spring:prop>
                <spring:prop
key="org.jpox.validateTables">false</spring:prop>
            </spring:props>
          </spring:property>
        </spring:bean>

So the first strange thing is that if I reverse their order, ie. if I have
the prod bean precede the cert bean, the app won't start, ie. it gives me a
socket error.

The second strange thing is that with the above, all operations to the cert
bean work flawlessly, but operations to the prod bean give me a timeout the
first time, but then after that, they work ever after.

If I restart the app, again the first operation on the prod bean times out,
and after that it works.

PS: if I have two beans that both run on the same port but different hosts,
everything works fine.  The two databases are set up identically.

What is going on?
Any help is appreciated.
-- 
View this message in context: http://www.nabble.com/Strange-problem%3A-timeout-first-time%2C-then-ok-tp20922247p20922247.html
Sent from the JDO - Development mailing list archive at Nabble.com.


Mime
View raw message