Hi As you already recognized, if you like to create an entity (note) you have to load all the referenced entities (user) in the same transaction you call create. By design this is the current behaviour of Castor.
Regards Ralf Hard Core schrieb: > Hello, > I don't know if I'm doing something wrong or it's a bug :) > > //I have 2 transactions: > //1st > db.begin(); > Note note = new Note(); > User user = db.load(User.class, 222, AccessMode.ReadOnly); > note.setUser(user); > db.commit(); > > ... > //2nd > db.begin(); > //setting other note fields here and inserting into db > db.create(note) > db.commit(); > > And here new Note is being created but user field is not set... it's null in > db > What should I do to make it work? Right now I made a workaround, in > second tx I'm reloading user object and it works. But maybe there is > some other solution to this? > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > -- Syscon Ingenieurbüro für Meß- und Datentechnik GmbH Ralf Joachim Raiffeisenstraße 11 72127 Kusterdingen Germany Tel. +49 7071 3690 52 Mobil: +49 173 9630135 Fax +49 7071 3690 98 Internet: www.syscon.eu E-Mail: [EMAIL PROTECTED] Sitz der Gesellschaft: D-72127 Kusterdingen Registereintrag: Amtsgericht Stuttgart, HRB 382295 Geschäftsleitung: Jens Joachim, Ralf Joachim --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email

