Hi,
I get:
[org.apache.ojb.odmg.TransactionImpl] ERROR: Locking obj
[EMAIL PROTECTED] with lock mode 4 failed
[Lcom.entersys.escds.interfaces.UserRole;
org.odmg.ClassNotPersistenceCapableException:
[Lcom.entersys.escds.interfaces.UserRole;
at org.apache.ojb.odmg.ObjectEnvelope.manage(Unknown Source)
at org.apache.ojb.odmg.ObjectEnvelope.<init>(Unknown Source)
at org.apache.ojb.odmg.TransactionImpl.register(Unknown Source)
at org.apache.ojb.odmg.TransactionImpl.lock(Unknown Source)
at com.entersys.util.DAOHelper.update(DAOHelper.java:159)
at
com.entersys.escds.services.DAOSoapBindingImpl.updateUser(DAOSoapBindingImpl
.java:479)
when I attempt to lock an object that has an array property (1:n and
unidirectional)
What would be the problem? I don't want to use java.util.Collection, as my
User class will serialize/deserialize using SOAP
thanks
my code:
public Object update(Object data) throws Exception {
Transaction tx = odmg.newTransaction();
tx.begin();
try {
Object o = ((HasBroker) tx).getBroker().getObjectByQuery(new
QueryByIdentity(data));
tx.lock(o, Transaction.WRITE); <- throws the exception here
org.apache.commons.beanutils.PropertyUtils.copyProperties(o, data);
tx.commit();
}
catch (Throwable t) {
tx.abort();
throw new Exception(t.getMessage());
}
return data;
}
public class User implements java.io.Serializable {
private java.lang.String userId;
...
private com.entersys.escds.interfaces.UserRole[] userRoles;
public java.lang.String getUserId() {
return userId;
}
public void setUserId(java.lang.String userId) {
this.userId = userId;
}
...
public com.entersys.escds.interfaces.UserRole[] getUserRoles() {
return userRoles;
}
public void setUserRoles(com.entersys.escds.interfaces.UserRole[]
userRoles) {
this.userRoles = userRoles;
}
}
<!-- Definitions for com.entersys.escds.interfaces.User -->
<class-descriptor
class="com.entersys.escds.interfaces.User"
table="Users"
>
<field-descriptor id="1"
name="userId"
column="userId"
jdbc-type="VARCHAR"
primarykey="true"
/>
...
<collection-descriptor
name="userRoles"
element-class-ref="com.entersys.escds.interfaces.UserRole"
auto-retrieve="true"
auto-update="true"
auto-delete="true"
>
<inverse-foreignkey field-id-ref="1"/>
</collection-descriptor>
</class-descriptor>
<!-- Definitions for com.entersys.escds.interfaces.UserRole -->
<class-descriptor
class="com.entersys.escds.interfaces.UserRole"
table="UserRole"
>
<field-descriptor id="1"
name="userId"
column="userId"
jdbc-type="VARCHAR"
primarykey="true"
/>
<field-descriptor id="2"
name="roleId"
column="roleId"
jdbc-type="VARCHAR"
primarykey="true"
/>
</class-descriptor>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]