<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Convenient does not mean it should be default.<br>
<br>
Anyway, for GA we will keep the "old" default since it was discovered
too late.<br>
<br>
Then when we do have the ui for controlling the default I would just
have a few options but <br>
let none be the default since it is the less risky one and you can set
the default option in persistence.xml<br>
instead of going set it on every single entity.<br>
<br>
/max<br>
<blockquote
cite="mid:19758da0903041211y4ed6ec19hea2ea72d640bb53f@mail.gmail.com"
type="cite">
<div class="gmail_quote">On Wed, Mar 4, 2009 at 2:59 PM, Emmanuel
Bernard <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:emmanuel@hibernate.org">emmanuel@hibernate.org</a>></span>
wrote:<br>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div style="">class Address {
<div> @ManyToOne Country country;</div>
<div> @ManyToOne State state;</div>
<div> @ManyToMany Set<Person> inhabitants;</div>
<div>}</div>
<div><br>
</div>
<div>It generally makes no sense to cascade persist for these three
associations. Even if your app has 80 entities, it's very likely that
half of the associations should not be cascaded :)</div>
<div><br>
</div>
<div>Let's take your proposal</div>
<div>PERSIST, DELETE, REFRESH</div>
<div><br>
</div>
<div>I REFRESH address and changes on Person are lost, doh!</div>
</div>
</blockquote>
<div><br>
True. I was on the fence about REFRESH. I think you convinced me.<br>
</div>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div style="">
<div>PERSIST, do I really save an address and expect the person
living there to be added to the system. Surely not, the person is very
likely to have been built beforehand. Same for Country and State.</div>
</div>
</blockquote>
<div><br>
Not a problem if County and State are managed, which is likely how you
attach them anyway. It will even work if they are a non-managed entity
with a valid ID. If neither of those are the case, then yes, I want the
persist to add them to the database. That's the whole point of the
cascade.<br>
</div>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div style="">
<div>MERGE Do I really want to update a country when an address
changes? I can't find a system that would do that.</div>
</div>
</blockquote>
<div><br>
I don't do MERGE, so I don't care.<br>
</div>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div style="">
<div>Cascade has performance consequences. The more cascades the
slower your app will be at flush time. Especially on applications with
a lot of entities.</div>
<div><br>
</div>
<div>NONE is a good default, that's why it's the default we have
chosen :)</div>
</div>
</blockquote>
<div><br>
I'm still don't agree. I like PERSIST and DELETE. DELETE can be
dangerous, but it's also extremely convenient.<br>
<br>
-Dan<br>
</div>
</div>
<br>
-- <br>
Dan Allen<br>
Senior Software Engineer, Red Hat | Author of Seam in Action<br>
<br>
<a moz-do-not-send="true" href="http://mojavelinux.com">http://mojavelinux.com</a><br>
<a moz-do-not-send="true" href="http://mojavelinux.com/seaminaction">http://mojavelinux.com/seaminaction</a><br>
<br>
NOTE: While I make a strong effort to keep up with my email on a daily<br>
basis, personal or other work matters can sometimes keep me away<br>
from my email. If you contact me, but don't hear back for more than a
week,<br>
it is very likely that I am excessively backlogged or the message was<br>
caught in the spam filters. Please don't hesitate to resend a message
if<br>
you feel that it did not reach my attention.<br>
<pre wrap="">
<hr width="90%" size="4">
_______________________________________________
seam-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:seam-dev@lists.jboss.org">seam-dev@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/seam-dev">https://lists.jboss.org/mailman/listinfo/seam-dev</a>
</pre>
</blockquote>
<br>
</body>
</html>