Hi,
I had the same problem. You have to refetch objects to
update/delete =
them between the begin/close on your database
object.
Objects are not persistent out of the begin/close area.
Hope
this helps.
--
Fr�d�ric Aug� -
mailto:[EMAIL PROTECTED]Ing�nieur
d'�tudes et d�veloppement
Soci�t� IMPROVE - Tel : +33 (0)1 41 97 83
20
<
http://www.improve.fr> <
http://www.application-servers.com>
----- Original Message -----
Sent: Wednesday, November 14, 2001 2:29
PM
Subject: [castor-dev] Error with mapping
?
Hi.
This is a part mapping file:
<class name="artesanos.modelo.Region"
identity="idRegion" key-generator="MAX">
<map-to
table="regionGeografica"/>
<field
name="idRegion"
type="integer"
direct="true"
get-method="getIdRegion"
set-method="setIdRegion"
required="true">
<sql
name="idRegion" type="integer"/>
</field>
<field
name="nombre"
type="java.lang.String"
direct="true"
get-method="getNombre"
set-method="setNombre"
required="true">
<sql name="nombre"
type="varchar"/>
</field>
<field
name="descripcion"
type="java.lang.String"
direct="true"
get-method="getDescripcion"
set-method="setDescripcion"
required="false">
<sql
name="descripcion" type="varchar"/>
</field>
<field
name="provincias"
type="artesanos.modelo.Provincia"
required="false"
collection="vector">
<sql
name="idProvincia" many-table="regionProvincia" many-key="idRegion"
/>
</field>
</class>
The problem is:
When I try add a new province, with the method
addNewProvince(Province p).
I have the next exception:
org.exolab.castor.jdo.ObjectNotPersistentException: The object of type
java.util.Vector is not persistent -- it was not queried or created within
this transaction
at
org.exolab.castor.persist.TransactionContext.writeLock(TransactionContext.java:886)
at
org.exolab.castor.persist.ClassMolder.preStore(ClassMolder.java:1368)
at
org.exolab.castor.persist.LockEngine.preStore(LockEngine.java:697)
at
org.exolab.castor.persist.TransactionContext.prepare(TransactionContext.java:1071)
at
org.exolab.castor.jdo.engine.DatabaseImpl.commit(DatabaseImpl.java:469)
at
artesanos.TestBD.<init> at artesanos.TestBD.main
Some body know what is the problem
??
Thank you for all !!
FEC :))
------------------------------------------------------------
Federico
E. Carpi
LIFIA - Laboratorio de Investigaci�n
y Formaci�n en Inform�tica
Avanzada
Facultad de Inform�tica - UNLP
(54) 221 4228252 int 39
La
Plata - Buenos Aires -
Argentina
------------------------------------------------------------