connection problem with ojb and Sql server

2005-09-22 Thread Davide Emanuele Denicolo
Hi at all!
I have this problem:
I'm using MS SQL Server 2000 as information repository and ojb with java
My problem is that when the connection between tomcat and sql server has
broken or SQL gets down,I receive this message to browser


org.apache.ojb.broker.PersistenceBrokerSQLException: java.sql.SQLException:
[Microsoft][SQLServer 2000 Driver for JDBC]Connection reset by peer: socket
write error
org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeQuery(Unknown
Source)
org.apache.ojb.broker.accesslayer.RsQueryObject.performQuery(Unknown
Source)
org.apache.ojb.broker.accesslayer.RsIterator.init(Unknown Source)

org.apache.ojb.broker.core.RsIteratorFactoryImpl.createRsIterator(Unknown
Source)

org.apache.ojb.broker.core.PersistenceBrokerImpl.getRsIteratorFromQuery(Unkn
own Source)

org.apache.ojb.broker.core.PersistenceBrokerImpl.getIteratorFromQuery(Unknow
n Source)

org.apache.ojb.broker.core.PersistenceBrokerImpl.getObjectByQuery(Unknown
Source)

org.apache.ojb.broker.core.DelegatingPersistenceBroker.getObjectByQuery(Unkn
own Source)

org.apache.ojb.broker.core.DelegatingPersistenceBroker.getObjectByQuery(Unkn
own Source)


How can I to remove this problem so ojb can reset connection automatically?

Thank you

Davide Denicolo


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: connection problem with ojb and Sql server

2005-09-22 Thread Thomas Dudziak
On 9/22/05, Davide Emanuele Denicolo [EMAIL PROTECTED] wrote:
 Hi at all!
 I have this problem:
 I'm using MS SQL Server 2000 as information repository and ojb with java
 My problem is that when the connection between tomcat and sql server has
 broken or SQL gets down,I receive this message to browser


 org.apache.ojb.broker.PersistenceBrokerSQLException: java.sql.SQLException:
 [Microsoft][SQLServer 2000 Driver for JDBC]Connection reset by peer: socket
 write error

This looks like a timeout problem (though it might also be something different).
You could try to configure the connection timeout (refer to the SQLServer doc).
Or you could try a different jdbc driver, eg. jTDS http://jtds.sourceforge.net/.
One other thing to try is to configure OJB to use a poolable data
source (jndi) instead of the jdbc driver directly.

Tom

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Advice needed: conf of cache locking in non-clustered webapp with Spring PB-Api

2005-09-22 Thread Thomas Dudziak
Hi folks,

has anybody some advice as to how to best configure Spring  OJB
(1.0.3) with regard to caching and locking ?
My thoughts were to use either the 2-level or the oscache impl, and
use pessimistic read-committed locking (how to do that with spring
transactions and the PB-Api ?)

ideas, comments, hints ?

regards,
Tom

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: connection problem with ojb and Sql server

2005-09-22 Thread Thomas Franke
Davide Emanuele Denicolo wrote:

 My problem is that when the connection between tomcat and sql server has 
 broken or SQL gets down,I receive this message to browser
How about to use the validationQuery attribute in the connection-pool element of
the repository_database.xml like this:

connection-pool whenExhaustedAction=2 maxActive=21 validationQuery=select
count(*) from datenklasse /

Since we use this solution we solved our problem with lost connections.


Regards,

Thomas

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: connection problem with ojb and Sql server

2005-09-22 Thread Davide Emanuele Denicolo


-Messaggio originale-
Da: Thomas Franke [xxx]
Inviato: giovedì 22 settembre 2005 13.20
A: OJB Users List
Oggetto: Re: connection problem with ojb and Sql server


Thomas Franke wrote:

How about to use the validationQuery attribute in the connection-pool
element of
the repository_database.xml like this:

connection-pool whenExhaustedAction=2 maxActive=21
validationQuery=select
count(*) from datenklasse /

I've tried it, but i receive the same problem!

In my OJB.properties I've this path configuration :

ConnectionFactoryClass=org.apache.ojb.broker.accesslayer.ConnectionFactoryPo
oledImpl

Some idea?
Thank you

Davide


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: connection problem with ojb and Sql server

2005-09-22 Thread Thomas Franke
Davide Emanuele Denicolo wrote:

 I've tried it, but i receive the same problem!
OK, did you change datenklasse with a table of your database?

Regards,

Thomas

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: connection problem with ojb and Sql server

2005-09-22 Thread Davide Emanuele Denicolo

-Messaggio originale-
Da: Thomas Franke [xxx]
Inviato: giovedì 22 settembre 2005 15.26
A: OJB Users List
Oggetto: Re: connection problem with ojb and Sql server


Thomas Franke wrote:

OK, did you change datenklasse with a table of your database?

o...soorry ;)
Yes, I have changed query as :
 connection-pool whenExhaustedAction=2 maxActive=21
validationQuery=select 1 /

but the problem is the same!!!


Davide


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



R: connection problem with ojb and Sql server

2005-09-22 Thread Davide Emanuele Denicolo


-Messaggio originale-
Da: Thomas Franke [xxx]
Inviato: giovedì 22 settembre 2005 15.26
A: OJB Users List
Oggetto: Re: connection problem with ojb and Sql server


Thomas Franke wrote:

OK, did you change datenklasse with a table of your database?

o...soorry ;)
Yes, I have changed query as :
 connection-pool whenExhaustedAction=2 maxActive=21
validationQuery=select 1 /

but the problem is the same!!!


Davide


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



ojb-blank.jar

2005-09-22 Thread Thomas Franke
Hello,

I downloaded the ojb-blank.jar from
'http://mirrorspace.org/apache/db/ojb/db-ojb-1.0.3/'.
But I'm missing the profile directory with the database profiles in it. I
thought this is necessary. What does that mean?

Regards,

Thomas

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: ojb-blank.jar

2005-09-22 Thread Thomas Dudziak
On 9/22/05, Thomas Franke [EMAIL PROTECTED] wrote:

 I downloaded the ojb-blank.jar from
 'http://mirrorspace.org/apache/db/ojb/db-ojb-1.0.3/'.
 But I'm missing the profile directory with the database profiles in it. I
 thought this is necessary. What does that mean?

Nope, the profiles are actually only required if you adapt your
project from the main OJB dist (which uses the profiles for
configuring against which database to run the test).
Please follow the steps outlined in:

http://db.apache.org/ojb/docu/getting-started.html

Tom

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Advice needed: conf of cache locking in non-clustered webapp with Spring PB-Api

2005-09-22 Thread Jason McKerr

Thomas,

I wrote the following article which should allow you to use locking and 
2-level caching with Spring and OJB quite easily.  My implementation is 
simple, but you should be able to change it to use whatever you want.


http://staff.osuosl.org/~mckerrj/?p=8

J


Thomas Dudziak wrote:


Hi folks,

has anybody some advice as to how to best configure Spring  OJB
(1.0.3) with regard to caching and locking ?
My thoughts were to use either the 2-level or the oscache impl, and
use pessimistic read-committed locking (how to do that with spring
transactions and the PB-Api ?)

ideas, comments, hints ?

regards,
Tom

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

 




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Advice needed: conf of cache locking in non-clustered webapp with Spring PB-Api

2005-09-22 Thread Thomas Dudziak
On 9/22/05, Jason McKerr [EMAIL PROTECTED] wrote:

 I wrote the following article which should allow you to use locking and
 2-level caching with Spring and OJB quite easily.  My implementation is
 simple, but you should be able to change it to use whatever you want.

 http://staff.osuosl.org/~mckerrj/?p=8

thanks, but my question was aimed rather for a discussion what would
be best suited and how to use locking effectively in a spring-managed
environment. FYI, I currently use the high-low sequence manager and
the two-level cache impl.

regards,
Tom

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: connection problem with ojb and Sql server

2005-09-22 Thread Thomas Franke
Davide Emanuele Denicolo wrote:

 but the problem is the same!!!
strange. Could you send your repository_database.xml and ojb.properties? Or I
send you mine and you can compare your settings. I think it is a good idea to
align both files. I have heard sometimes there are problems if in both files
differences.

CU,

Thomas

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Joining a subquery to parent across non-decomposed m:n

2005-09-22 Thread Steve_Clark
I have a query that I can't figure out how to write.  I'm using 1.0.4 and 
PersistenceBroker.  Here's my situation:

Project has a Collection of Activities; this is a non-decomposed m:n via 
ACTIVITY_PROJECT.
Activity has attribute 'conclusionDate'.

I want to find all Projects for which every Activity has a non-null 
conclusionDate.  In SQL, here's the query I'm aiming for:

SELECT DISTINCT A0.PROJECT_ID, count(A2.ACTIVITY_ID)
  FROM PROJECT A0
INNER JOIN ACTIVITY_PROJECT A1 ON A0.PROJECT_ID=A1.PROJECT_ID
INNER JOIN ACTIVITY A2 ON A1.ACTIVITY_ID=A2.ACTIVITY_ID
  WHERE NOT EXISTS
(SELECT B0.ACTIVITY_ID FROM ACTIVITY B0, ACTIVITY_PROJECT B1
  WHERE B0.ACTIVITY_ID=B1.ACTIVITY_ID
AND B1.PROJECT_ID=A1.PROJECT_ID
AND B0.CONCLUSION_DATE IS NULL);

Here's pseudocode for what I'm trying to do:
subCrit = conclusionDate is not null

// This is the problematic line - how to join to the parent query?
subCrit.addEqualToField(activityId, Criteria.PARENT_QUERY_PREFIX 
+ activityId)

ReportQueryByCriteria subQuery =
QueryFactory.newReportQuery(Activity.class, subCrit);
subQuery.setAttributes({ activityId });

crit = new Criteria();
crit.addNotExists(subQuery);

What I can't figure out is how to get the join right in the subquery.

Any suggestions?

thanks,
-steve

Steve Clark
ECOS Development Group
[EMAIL PROTECTED]
(970)226-9291


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]