cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hans Schmidt" <han...@gmx.net>
Subject random behaviour in Cayenne?
Date Wed, 16 Aug 2006 13:45:18 GMT
Hi,

I am using Cayenne 1.2 final release and the following code:

public AiAboangebot copyToNewAngebot(AiAboangebot toCopy) {
		ctx.commitChanges();
		List ur = new ArrayList();
		Integer nextId = getNextId(toCopy);
		AiAboangebot cop =(AiAboangebot)ctx.createAndRegisterNewObject(AiAboangebot.class);				
		ur.add(cop);
		BeanUtils.copyProperties(toCopy,cop);
		ctx.unregisterObjects(ur);
		cop.setId(nextId);
		ctx.registerNewObject(cop);
		ctx.commitChanges();
		return cop;
	}

the purpose of the code is to copy an existing db-row, assign a new id and edit it.
the code sometimes works but sometimes not.

It seems the relations are sometimes broken so that the generated SQL tries to insert NULL
values into non-nullable columns.

any help would be greatly appreciated.

greetings
Hans
-- 


Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

Mime
View raw message