<div>
                    Awesome! Few free to send more PRs and file Jiras as needed.
                </div>
                <div><div><br></div><div><br></div><div><div>--&nbsp;</div><div>"The measure of a man is what he does with power" - Plato</div><div>-</div><div>@abstractj</div><div>-</div><div>Volenti Nihil Difficile</div></div></div>
                 
                <p style="color: #A0A0A8;">On Monday, October 15, 2012 at 5:58 PM, Marko Strukelj wrote:</p>
                <blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;">
                    <span><div><div><div>We have fixed this very quickly: </div><div><br></div><div> - <a href="https://github.com/aerogear/TODO/pull/4">https://github.com/aerogear/TODO/pull/4</a></div><div> - <a href="https://github.com/aerogear/TODO/pull/6">https://github.com/aerogear/TODO/pull/6</a></div><div><br></div><div>Regarding serializers, it doesn't actually have to be build-time generation (that usually gives you best performance). There are other options.</div><div><br></div><div>Curiously, the second fix required after initial one (<a href="https://github.com/aerogear/TODO/pull/6">https://github.com/aerogear/TODO/pull/6</a>) exposes the need for persistence layer to be in sync with serialization layer, using fine-tuned queries. Seems to me there is some opportunity here for hiding plumbing on both of these layers.</div><div><br></div><div>----- Original Message -----</div><blockquote type="cite"><div><div>These seems like good points for discussion and/or issues for jira.</div><div><br></div><div>The only one that concerns me with my quick look is generating</div><div>serializers at compile time.  Build time generation is one of the</div><div>area's we wanted to avoid in general.</div><div><br></div><div>For the other items I think jira's would be appropriate as your</div><div>understanding of the AS and SLSB's would be useful to capture these</div><div>concerns or potential bugs.</div><div><br></div><div>-Jay</div><div><br></div><div>On Oct 9, 2012, at 10:25 AM, Marko Strukelj wrote:</div><div><br></div><blockquote type="cite"><div><div><br></div><div>I’ve been looking into TODO app to get a better understanding of</div><div>how aerogear.js works in a browser, and how we could abstract</div><div>server-side into something we could call ‘aerogear-server’ as</div><div>opposed to TODO app.</div><div><br></div><div>Here are some observations:</div><div><br></div><div><br></div><div>- The *Endpoint classes are SLSB, but use extended persistence</div><div>context [1]</div><div><br></div><div>Extended persistence context is not supported on Stateless session</div><div>beans per JPA spec [2].</div><div><br></div><div>The reason is that stateless beans are not singletons or contextual</div><div>objects (i.e. CDI scoped) but are pooled instances, so you can</div><div>receive a different one for each call that you make. That would</div><div>mean that you could get a different EntityManager instance each</div><div>time, with possible uncommitted state from another method call by</div><div>another client. It would be impossible to do consistent</div><div>persistence across multiple invocations with that kind of random</div><div>behaviour. Also if ten requests hit at the same time there would</div><div>be ten instances of EntityManager, and ten separate persistence</div><div>contexts, and since they are extended and ‘never’ cleared (EJB</div><div>container decides, behaviour is unspecified) - we have ten memory</div><div>leaks.</div><div><br></div><div>It looks like AS7 doesn’t much care if you use EXTENDED annotation</div><div>in a SLSB - it will happily comply (and create a memory leak for</div><div>you), whereas some other app servers will break on deployment [3],</div><div>and Scott Marlow concedes it should probably be a deployment error</div><div>[4], so maybe one day this would also break on AS7.</div><div><br></div><div><br></div><div><br></div><div>- Method joinTransaction() only makes sense on application-managed</div><div>entity manager</div><div><br></div><div>We are using container-managed entity manager - one that gets</div><div>injected - as opposed to one retrieved by calling</div><div>EntityManagerFactory.createEntityManager() method (that would be</div><div>application-managed). Call to joinTransaction() is therefore a</div><div>no-op, and should be removed [5][6][7].</div><div><br></div><div><br></div><div>- Custom serializers look like plumbing</div><div>Would be good to have a way to autogenerate them during compile</div><div>based on annotations. Also, for the purpose of autogenerating</div><div>entities for the client based on server data definitions</div><div>(metadata) we need to use those same definitions during</div><div>serialization. This is the most obvious point where</div><div>aerogear-server as a server-side framework comes to play.</div><div><br></div><div><br></div><div>[1]</div><div><a href="https://github.com/aerogear/TODO/tree/picketbox/server/src/main/java/org/aerogear/todo/server/rest">https://github.com/aerogear/TODO/tree/picketbox/server/src/main/java/org/aerogear/todo/server/rest</a></div><div>[2]</div><div><a href="http://stackoverflow.com/questions/2547817/what-is-the-difference-between-transaction-scoped-persistence-context-and-extend">http://stackoverflow.com/questions/2547817/what-is-the-difference-between-transaction-scoped-persistence-context-and-extend</a></div><div>[3] <a href="https://community.jboss.org/thread/196404">https://community.jboss.org/thread/196404</a></div><div>[4] <a href="https://community.jboss.org/message/721988#721988">https://community.jboss.org/message/721988#721988</a></div><div>[5]</div><div><a href="http://docs.oracle.com/javaee/6/api/javax/persistence/EntityManager.html#joinTransaction(">http://docs.oracle.com/javaee/6/api/javax/persistence/EntityManager.html#joinTransaction(</a>)</div><div>[6] <a href="http://docs.oracle.com/javaee/5/tutorial/doc/bnbqw.html">http://docs.oracle.com/javaee/5/tutorial/doc/bnbqw.html</a></div><div>[7]</div><div><a href="http://docs.jboss.org/hibernate/orm/4.0/hem/en-US/html/architecture.html#d0e134">http://docs.jboss.org/hibernate/orm/4.0/hem/en-US/html/architecture.html#d0e134</a></div><div><br></div><div><br></div><div>- marko</div><div><br></div><div><br></div><div>_______________________________________________</div><div>aerogear-dev mailing list</div><div><a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a></div><div><a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a></div></div></blockquote><div><br></div><div><br></div><div>_______________________________________________</div><div>aerogear-dev mailing list</div><div><a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a></div><div><a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a></div></div></blockquote><div><br></div><div>_______________________________________________</div><div>aerogear-dev mailing list</div><div><a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a></div><div><a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a></div></div></div></span>
                 
                 
                 
                 
                </blockquote>
                 
                <div>
                    <br>
                </div>