I´m wondering about persistence aplications using hibernet. I tried
Hibernate configuration with Netbeans but I have some problems. Do you have
some information or documentation about developing applications with
hibernet and netbeans, I´m interested in documentacion about swing
Using Hibernate with non-updatable fields can leave entities in a
Take an Image with a field creationEvent, not updatable. If
Image.creationEvent is set on an instance and passed to session.merge(),
(1) Properly, no UPDATE is issued.
(2) DefaultMergeEventListener.copyValues copies the invalid
creationEvent to the new instance
(3) The client who receives that instance thinks creationEvent has been
What are the semantics here? Should the spec specify this? Max, you
mentioned via irc that this wasn't in the spec, but I assume
@Column( updatable = false )
would cause the same issue.
Currently I'm writing logic in my MergeEventListener to NOT copy these
values (difficult because of the EmbeddedComponentTypes I'm using). It
seems, however, that this should be belong directly to
Redirecting to list.jboss.org from sf.net
> For truly efficient clustering of extended persistence contexts in the
> context of Seam or EJB3, we need a way to propagate unflushed
> changesets. What we need is an SPI like this:
> Serializable changeset = session1.getChangeSet();
> where session2 is an empty session, or perhaps even a session with some
> of the same entities as session1. The only state that needs to be sent
> in the changeset is new entities, unflushed updates to entities and
> deletions of entities.
> Steve, WDYT?
+1 even if my names not Steve. Seems like the same infrastructure would
also be usable in implementing a remote client session. (Discussed in
I wrote (tested and verified with Gavin):
Finally, merging doesn’t allow the following scenario, where two
modifications conflict on one snapshot:
item.getId() // The database identity is "1234"
Session session= sessionFactory.openSession();
Transaction tx = session.beginTransaction();
Item item2 = (Item) session.get(Item.class, new Long(1234));
item2.setDescription(...); // Not allowed!
return session.merge(item); // Throws exception!
The detached object’s description is modified as well as the
persistent object’s. There is no way for Hibernate to determine who
will win in this situation and a StaleObjectStateException is thrown
when you try to merge() onto a dirty persistent instance.
No exception is raised in my tests. The merged state takes precedence
over the initially loaded and modified state (regardless the object
has been versioned or not) AFAIR, the spec does not talk about such
an exception either.
What is it?