On Monday, October 15, 2012 at 5:58 PM, Marko Strukelj wrote:
We have fixed this very quickly:Regarding serializers, it doesn't actually have to be build-time generation (that usually gives you best performance). There are other options.Curiously, the second fix required after initial one (https://github.com/aerogear/TODO/pull/6) 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.----- Original Message -----These seems like good points for discussion and/or issues for jira.The only one that concerns me with my quick look is generatingserializers at compile time. Build time generation is one of thearea's we wanted to avoid in general.For the other items I think jira's would be appropriate as yourunderstanding of the AS and SLSB's would be useful to capture theseconcerns or potential bugs.-JayOn Oct 9, 2012, at 10:25 AM, Marko Strukelj wrote:I’ve been looking into TODO app to get a better understanding ofhow aerogear.js works in a browser, and how we could abstractserver-side into something we could call ‘aerogear-server’ asopposed to TODO app.Here are some observations:- The *Endpoint classes are SLSB, but use extended persistencecontext [1]Extended persistence context is not supported on Stateless sessionbeans per JPA spec [2].The reason is that stateless beans are not singletons or contextualobjects (i.e. CDI scoped) but are pooled instances, so you canreceive a different one for each call that you make. That wouldmean that you could get a different EntityManager instance eachtime, with possible uncommitted state from another method call byanother client. It would be impossible to do consistentpersistence across multiple invocations with that kind of randombehaviour. Also if ten requests hit at the same time there wouldbe ten instances of EntityManager, and ten separate persistencecontexts, and since they are extended and ‘never’ cleared (EJBcontainer decides, behaviour is unspecified) - we have ten memoryleaks.It looks like AS7 doesn’t much care if you use EXTENDED annotationin a SLSB - it will happily comply (and create a memory leak foryou), whereas some other app servers will break on deployment [3],and Scott Marlow concedes it should probably be a deployment error[4], so maybe one day this would also break on AS7.- Method joinTransaction() only makes sense on application-managedentity managerWe are using container-managed entity manager - one that getsinjected - as opposed to one retrieved by callingEntityManagerFactory.createEntityManager() method (that would beapplication-managed). Call to joinTransaction() is therefore ano-op, and should be removed [5][6][7].- Custom serializers look like plumbingWould be good to have a way to autogenerate them during compilebased on annotations. Also, for the purpose of autogeneratingentities for the client based on server data definitions(metadata) we need to use those same definitions duringserialization. This is the most obvious point whereaerogear-server as a server-side framework comes to play.[1][2][5][7]- marko_______________________________________________aerogear-dev mailing list_______________________________________________aerogear-dev mailing list_______________________________________________aerogear-dev mailing list