Re: JPA in mailreader

2007-11-21 Thread Ted Husted
I very much appreciate the comments, Tom. Right now, I'm retreating into unit tests against the business logic. But once that's done, I'd to revisit your suggestions. I'm tempted to suggest that you go ahead and try some changes, but the application isn't fully functional right now, and we should p

Re: JPA in mailreader

2007-11-21 Thread Tom Schneider
Ted, I finally had a chance to look at your JPA mailreader. I know this was in the original, but I really don't like the way that they have most of the functionality for the actions is in a superclass. To me, that's hiding functionality. (Especially when the domain model is in the super clas

Re: JPA in mailreader

2007-11-20 Thread Ted Husted
The work-in-progress is checked into the sandbox now. * http://svn.apache.org/viewvc/struts/sandbox/trunk/jpa-mailreader/ I'll track further work through https://issues.apache.org/struts/browse/WW-1399 This is still very much a prototype, and I would gladly receive any suggestions. -Ted.

Re: JPA in mailreader

2007-11-15 Thread Ted Husted
I'd be good with introducing optimistic locking, if we can do without complicating the design. It would be fun to have a standard example of doing something fancy like displaying both entries and letting the cilent choose one. The MailReader has always been a useful example, but it has always lack

Re: JPA in mailreader

2007-11-15 Thread Tom Schneider
Are you worried about optimistic locking at all? (I'm guessing not for this simple example) Although I think your technique is clever, in a situation where optimistic locking is used, you should really be editing the object that was originally read from the database. Might I suggest the scope pl

Re: JPA in mailreader

2007-11-15 Thread Ted Husted
I'm starting to make some progress on this again. I having great fun re-discovering how some of the S2 features work together. For example, custom type converters and "persistence URL parameters" are a great "tag team". Given a converter for "user", and a parameter like "?user=husted", S2 can autom

Re: JPA in mailreader

2007-11-12 Thread Adam Hardy
Atomikos was apparently open source, but definitely not community software. I couldn't find any tutorials - presumably the company has a commercial model driven by income from paid-for support which they want everyone to buy, including all of us developers. JOTM is interesting. No fresh news o

Re: JPA in mailreader

2007-11-12 Thread Dave Newton
http://www.atomikos.com/products.html#ate And whatever happened to JOTM, anyway? d. --- Adam Hardy <[EMAIL PROTECTED]> wrote: > Wes Wannemacher on 12/11/07 15:05, wrote: > > I have a judgment call to make now and wanted some > input. At first I > > was hoping to create this in a non-IoC fashion

Re: JPA in mailreader

2007-11-12 Thread Adam Hardy
Wes Wannemacher on 12/11/07 15:05, wrote: I have a judgment call to make now and wanted some input. At first I was hoping to create this in a non-IoC fashion. This was simply to keep the dependencies at a minimum and concentrate on integrating JPA and struts2. But, in many spots, the JPA docs ind

Re: JPA in mailreader

2007-11-12 Thread Ted Husted
wes@ seemed to work. You could just add something off the trunk for now. Just as an aside, in my own stuff, I don't consider serving the current MailReader API unchanged a target goal. The current implementation is working around some arbitrary restictions in the old DAO, and there's no compelling

Re: JPA in mailreader

2007-11-12 Thread Wes Wannemacher
I think [EMAIL PROTECTED] should work as a google Id, if not, use [EMAIL PROTECTED] I don't have much, but it'd be nice to have a repository. -Wes On 11/12/07, Ted Husted <[EMAIL PROTECTED]> wrote: > Quite right. There's a static EntityManagerHelper that returns a fresh > EM for each transaction.

Re: JPA in mailreader

2007-11-12 Thread Ted Husted
Quite right. There's a static EntityManagerHelper that returns a fresh EM for each transaction. I think it would be great to have a couple of implementations to compare! If you'd like to park it at the sq1-struts2 site for now, just let me know your google ID. -Ted. On Nov 12, 2007 10:28 AM, We

Re: JPA in mailreader

2007-11-12 Thread Musachy Barroso
I haven't used JpaTemplate at all so far. musachy On Nov 12, 2007 10:22 AM, Tom Schneider <[EMAIL PROTECTED]> wrote: > Yes, avoid JpaTemplate, just like HibernateTemplate should be avoided. > Shouldn't be necessary with the latest versions of the respective > frameworks. > Tom > > > On Nov 12, 2

Re: JPA in mailreader

2007-11-12 Thread Wes Wannemacher
On 11/12/07, Ted Husted <[EMAIL PROTECTED]> wrote: > > I use Spring and dependency-injection a lot, but I don't know see that > injecting the EntityManager buys us very much, especially now that we > have a standard API. So, I"ve just been using a static class that > instantiates the EM as a single

Re: JPA in mailreader

2007-11-12 Thread Ted Husted
I'll finish up the Plain-Old-JPA version and check it into the sandbox. If someone wants to followup with a "better" Spring version, I'd love to see it :) -Ted. On Nov 12, 2007 10:19 AM, Musachy Barroso <[EMAIL PROTECTED]> wrote: > +1 for using spring, the end result will be a lot better and with

Re: JPA in mailreader

2007-11-12 Thread Tom Schneider
Yes, avoid JpaTemplate, just like HibernateTemplate should be avoided. Shouldn't be necessary with the latest versions of the respective frameworks. Tom On Nov 12, 2007 9:17 AM, Wes Wannemacher <[EMAIL PROTECTED]> wrote: > I can agree with that... I'm still thinking of avoiding JpaTemplate > thou

Re: JPA in mailreader

2007-11-12 Thread Ted Husted
I've also been working on an implementation over here: * http://sq1-struts2.googlecode.com/svn/trunk/articles/smart-urls/ that draws on the Shale MailReader JPA implementation. It's pretty close. I'm just working out a third-level update, where we need to update the Protocol object, which is pa

Re: JPA in mailreader

2007-11-12 Thread Musachy Barroso
+1 for using spring, the end result will be a lot better and with maven the dependencies are not a problem. musachy On Nov 12, 2007 10:17 AM, Wes Wannemacher <[EMAIL PROTECTED]> wrote: > I can agree with that... I'm still thinking of avoiding JpaTemplate > though because they indicate that it onl

Re: JPA in mailreader

2007-11-12 Thread Wes Wannemacher
I can agree with that... I'm still thinking of avoiding JpaTemplate though because they indicate that it only exists to help people used to HibernateTemplate / JdoTemplate. -Wes On 11/12/07, Tom Schneider <[EMAIL PROTECTED]> wrote: > My vote is to just use spring, for both EntityManagerFactory in

RE: JPA in mailreader

2007-11-12 Thread Bob Tiernay
I agree with using Spring. Also, using the jpaTemplate has little value as indicated in the Spring docs. Instead, use the @Repository annotation in your implementation class. > Date: Mon, 12 Nov 2007 09:11:04 -0600 > From: [EMAIL PROTECTED] > To: dev@struts.apache.org > Subject

Re: JPA in mailreader

2007-11-12 Thread Tom Schneider
My vote is to just use spring, for both EntityManagerFactory injection and Transaction Management. As Richard and I were discussing this weekend, Spring is a very common framework when used with Struts. It will also provide a full stack Struts/Spring/JPA example. Tom On Nov 12, 2007 9:05 AM, Wes

JPA in mailreader

2007-11-12 Thread Wes Wannemacher
Hello, I've been quietly learning JPA / implementing a JPA struts2-mailreader. I have a judgment call to make now and wanted some input. At first I was hoping to create this in a non-IoC fashion. This was simply to keep the dependencies at a minimum and concentrate on integrating JPA and struts2.