Hello Ojb-Users,
I have localized my Problem. In one Plain Object, I have the following
OJB-Request:
public Collection getParts() {
if (parts == null) {
getDataProvider().getBroker().retrieveReference(this, "parts");
}
return parts;
}
In the repository.xml, which describes the Plain Object, I have
auto-retrieve="false", because I want loading the data, whenn calling
getParts() and not before.
Width auto-retrieve="true" and width out the retrieveReference(this,
"parts") request, all works fine :o(
Have I to start a transaction before calling retrieveReference??
Thanks a lot
Josef Wagner
-----Ursprüngliche Nachricht-----
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von
[EMAIL PROTECTED]
Gesendet: Mittwoch, 21. Dezember 2005 10:45
An: [email protected]
Betreff: Addition to -> Problems while Saving with HSQL
I forgot to write. When I do this with postgre, all works fine.
----- Forwarded by Josef Wagner/On-Ergy on 21.12.2005 10:43 -----
Sebastian Mayer/On-Ergy
Sent by: Josef Wagner
21.12.2005 10:42
To
[email protected]
cc
Subject
Problems while Saving with HSQL
Hello,
I'm Saving 9000 entries in blocks of circa. 10 entries in a HSQL DB. After
circa. 10 broker.commitTransaction, i get one of the following two
Exceptions rotational by PersistenceBroker.commitTransaction()
2005-12-21 09:44:58,675 INFO [main] ObjectCacheFactory M[info] - Start
creating new ObjectCache instance
2005-12-21 09:44:58,675 INFO [main] ObjectCacheFactory M[info] -
Instantiate new org.apache.ojb.broker.cache.CacheDistributor for PB
instance [EMAIL PROTECTED]
2005-12-21 09:44:58,675 INFO [main] ObjectCacheFactory M[info] - New
ObjectCache instance was created
2005-12-21 09:47:30,223 ERROR [main] TeilestammBP
M[importiereTeileInLager] -
org.apache.ojb.broker.PersistenceBrokerException: Can't lookup a
connection
2005-12-21 09:47:30,223 ERROR [main] TeilestammBP
M[importiereTeileInLager] -
org.apache.ojb.broker.PersistenceBrokerException: Can't lookup a
connection
OR
2005-12-21 10:20:29,910 INFO [main] ObjectCacheFactory M[info] - Start
creating new ObjectCache instance
2005-12-21 10:20:29,910 INFO [main] ObjectCacheFactory M[info] -
Instantiate new org.apache.ojb.broker.cache.CacheDistributor for PB
instance [EMAIL PROTECTED]
2005-12-21 10:20:29,910 INFO [main] ObjectCacheFactory M[info] - New
ObjectCache instance was created
2005-12-21 10:28:20,607 ERROR [main] StatementsForClassImpl M[error] -
java.sql.SQLException: Connection is closed
2005-12-21 10:28:20,607 ERROR [main] StatementsForClassImpl M[error] -
java.sql.SQLException: Connection is closed
The store-method, i calling in a loop is:
public void save(AbstractPersistenceObjectIfc[] persistenceObjects) {
try {
PersistenceBroker broker =
PersistenceBrokerFactory.createPersistenceBroker(getConnectionDescriptor());
;
broker.beginTransaction();
for (int i = 0; i < persistenceObjects.length; i++) {
broker.store(persistenceObjects[i]);
}
broker.commitTransaction();
} finally {
if (broker != null && broker.isInTransaction()) {
broker.abortTransaction();
}
if (broker != null && !broker.isClosed()) {
broker.close();
}
}
}
HSQL is Running in clientmode
Any proposals?
Thanks a lot
Josef Wagner (Germany)
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]