[Lift] Re: Great pictures from the Scala Lift Off
On Tue, Jun 9, 2009 at 1:01 AM, David Pollak feeder.of.the.be...@gmail.comwrote: On Mon, Jun 8, 2009 at 12:37 PM, Viktor Klang viktor.kl...@gmail.comwrote: On Mon, Jun 8, 2009 at 8:09 PM, Timothy Perrett timo...@getintheloop.euwrote: w00t!! Marius, Viktor, Heiko... You think you guys will be able to make the trip to EPFL? I'll be there with bells on! I'll check the budget! ;) The beer budget or the travel budget? Like there was ever a shadow of a doubt that the beer budget was insufficient... ;) Cheers, Tim Sent from my iPhone On 8 Jun 2009, at 18:43, David Pollak feeder.of.the.be...@gmail.com wrote: On Mon, Jun 8, 2009 at 10:29 AM, Derek Chen-Becker dchenbec...@gmail.com dchenbec...@gmail.com wrote: I'm still pushing for a Scala on Skis conference out here in Colorado ;) It's looking like Scala on Skis will be held in Lausanne, Switzerland in Spring 2010. We'll also have a Scala Lift Off in the Washington, DC area in October 2009. Maybe we'll have a Denver-based conference in 2010. Derek On Mon, Jun 8, 2009 at 11:14 AM, Timothy Perrett timo...@getintheloop.eu wrote: Sweet! So jeleous of you guys cant wait to have a EMEA scala geek meet! Then myself, Viktor and Heiko can really hit the beers ;-) Cheers, Tim On Jun 8, 5:53 pm, David Pollak feeder.of.the.be...@gmail.com wrote: Folks, Ilya not only writes great IDE plugins, he takes good pictures:http://picasaweb.google.com/ilyas239/Scalaliftoff09# http://picasaweb.google.com/ilyas239/Scalaliftoff09# Thanks, David -- Lift, the simply functional web frameworkhttp://lifthttp://liftweb.net web.net Beginning Scalahttp:// http://www.apress.com/book/view/1430219890 www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpphttp://twitter.com/dpp Git some: http://github.com/dpphttp://github.com/dpp -- Lift, the simply functional web framework http://liftweb.net http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpphttp://twitter.com/dpp Git some: http://github.com/dpphttp://github.com/dpp -- Viktor Klang Rockstar Developer -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp -- Viktor Klang Rockstar Developer --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
Re: [scala] Re: [Lift] Programming in Scala #5, Lift Book #8, Beginning Scala #9
2009/6/9 Viktor Klang viktor.kl...@gmail.com Awesome idea. Would be great to establish some kind of curriculum with joint teaching material to be able to offer courses worldwide. +1 We have been doing something similar with Eclipse = www.eclipse-training.net And very recently we also started with courses on Scala and Lift, still flagged Eclipse Training Alliance. But we would like to go for some kind of world wide Scala Training network. What do you guys think? Interested? Heiko --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
Re: [scala] Re: [Lift] Programming in Scala #5, Lift Book #8, Beginning Scala #9
On Tue, Jun 9, 2009 at 9:43 AM, Heiko Seeberger heiko.seeber...@googlemail.com wrote: 2009/6/9 Viktor Klang viktor.kl...@gmail.com Awesome idea. Would be great to establish some kind of curriculum with joint teaching material to be able to offer courses worldwide. +1 We have been doing something similar with Eclipse = www.eclipse-training.net And very recently we also started with courses on Scala and Lift, still flagged Eclipse Training Alliance. But we would like to go for some kind of world wide Scala Training network. What do you guys think? Interested? Very! Heiko -- Viktor Klang Rockstar Developer --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
Re: [scala] Re: [Lift] Programming in Scala #5, Lift Book #8, Beginning Scala #9
Luc, Jorge, Kaliya and I did a LiftWorkshop in November. We had 6 people at the workshop. We tried to pack in Scala and Lift all into a day... it didn't work. Jorge and I have done some review and we figure there's 3 days of Scala training and 2-3 days of Lift training that would be a minimum for folks to be able to go home and build Lift apps. The To Do example (see http://liftweb.net/docs/getting_started.html ) would be one of the days (we gave it about an hour during the workshop and that was not nearly enough.) Thanks, David On Tue, Jun 9, 2009 at 1:23 AM, Luc Duponcheel luc.duponch...@gmail.comwrote: here are some thoughts: - agreeing upon the *what* is probably easier than agreeing upon the *how * for example: which IDE to use (if any) during the labs [ Eclipse, Netbeans, ... ] . My experience is that the description of how to do labs should be independent of any tools (it does not make sense to explicitely state things like: in Netbeans go to this submenu and select that choice and ... ). - I think we should go for 'extreme course development' in the sense that changes can be incorporated quickly (any text based format that can (in a moderated way) be edited by many people is good (e.g. LaTeX, assuming the existence of templates)) [ maybe git would be a perfect candidate for doing version management ] Another advantage of using text based development is that consistency can be automated: for example, code excerpts in slides can be extracted programmatically from the code proper so that all changes to that code are automatically propagated [ and also propagated in the embedded slides of student guides ]. I have some LateX templates (and Scala code) to automate all this. [ I have to agree that there is much room for improvement of the look-and-feel (it has been some time since I played around with LaTeX, and I'm not a specialist of LaTeX's beamer package) ] - About the financial model: if it is joint work, then I do not think it makes much sense to ask companies like Sun (or Oracle) money for the * development* of the material. If they are willing to make the material part of their curriculum (which implies: visibility via their catalogs), then we can make money by *delivering* the material. Whether or not the material itself should be freely downoadable by anyone in the world is yet another matter. Again, maybe there should be some moderated group of people having access to the material. ... Luc On Tue, Jun 9, 2009 at 9:25 AM, Viktor Klang viktor.kl...@gmail.comwrote: On Tue, Jun 9, 2009 at 8:21 AM, Luc Duponcheel luc.duponch...@gmail.com wrote: Hi all, I attended the talk on Scala and the talk on Lift. Both excellent talks! [ I did not attend the talk on Actors (I was cycling on the other side of the Golden Gate Bridge (Mt Tamalpais)) ] ... Those talks act as 'teasers' to make developers 'eager to know more about Scala'. This is great! But, sometimes, I also have the impression that those talks 'preach for those that are already converted'. The point I want to make is the following: when talking to developers about Scala, I am almost always confronted with the fact that they still think it has a 'steep learning curve'. I tell them that 'once you have climbed the mountain, you can enjoy the view over the landscape' (cfr Mt Tamalpais). So, I really think there is this need for *hands on training*. Maybe some of you folks should try to convince Sun (or Oracle) Education to invest in training courses. Not a simple task indeed, but, worth the effort (helps Scala becoming mainstream). ps: I agree that I'm partially saying this out of pure opportunism (I'm delivering Java courses for Sun Education, and, of course, I would be the first one to deliver Scala courses). Awesome idea. Would be great to establish some kind of curriculum with joint teaching material to be able to offer courses worldwide. Luc On Mon, Jun 8, 2009 at 5:40 PM, David Pollak feeder.of.the.be...@gmail.com wrote: A big congratulations to the authors as well as the whole Scala community... Yet another proof point that 2009 is the year of Scala. Rock On! On Mon, Jun 8, 2009 at 7:34 AM, TylerWeir tyler.w...@gmail.comwrote: http://www.theserverside.com/news/thread.tss?thread_id=54862 Quote: Here are the top 10 selling books at the JavaOne Bookstore. Are these a trend? You decide. 1. JavaFX: Building Rich Internet Applications - Addison Wesley ISBN: 013701287X 2. Essential JavaFX - PTR (out June 11, 2009) ISBN: 0137042795 3. Effective Java 2nd ed. - PTR ISBN: 0321356683 4. Java Puzzlers - Addison Wesley ISBN: 032133678X 5. Programming in Scala - Artima ISBN: 0981531601 6. Java Concurrency in Practice - Addison Wesley ISBN:0321349601 7. Beginning Java EE 5: From Novice to Professional - Apress ISBN: 1590594703 8. The Definitive Guide
Re: [scala] Re: [Lift] Programming in Scala #5, Lift Book #8, Beginning Scala #9
In addition to the Lift Workshop, I also co-taught a ten-week (1.5hrs/wk) course at Stanford on Scala. It was targeted at advanced undergrads and graduate students. Most were programming language enthusiasts, so the course focused more on the interesting parts of Scala from a programming language perspective, rather than a more practical here's-how-you-get-stuff-done course (like the Lift Workshop). --j On Tue, Jun 9, 2009 at 2:33 AM, David Pollak feeder.of.the.be...@gmail.comwrote: Luc, Jorge, Kaliya and I did a LiftWorkshop in November. We had 6 people at the workshop. We tried to pack in Scala and Lift all into a day... it didn't work. Jorge and I have done some review and we figure there's 3 days of Scala training and 2-3 days of Lift training that would be a minimum for folks to be able to go home and build Lift apps. The To Do example (see http://liftweb.net/docs/getting_started.html ) would be one of the days (we gave it about an hour during the workshop and that was not nearly enough.) Thanks, David On Tue, Jun 9, 2009 at 1:23 AM, Luc Duponcheel luc.duponch...@gmail.comwrote: here are some thoughts: - agreeing upon the *what* is probably easier than agreeing upon the * how* for example: which IDE to use (if any) during the labs [ Eclipse, Netbeans, ... ] . My experience is that the description of how to do labs should be independent of any tools (it does not make sense to explicitely state things like: in Netbeans go to this submenu and select that choice and ... ). - I think we should go for 'extreme course development' in the sense that changes can be incorporated quickly (any text based format that can (in a moderated way) be edited by many people is good (e.g. LaTeX, assuming the existence of templates)) [ maybe git would be a perfect candidate for doing version management ] Another advantage of using text based development is that consistency can be automated: for example, code excerpts in slides can be extracted programmatically from the code proper so that all changes to that code are automatically propagated [ and also propagated in the embedded slides of student guides ]. I have some LateX templates (and Scala code) to automate all this. [ I have to agree that there is much room for improvement of the look-and-feel (it has been some time since I played around with LaTeX, and I'm not a specialist of LaTeX's beamer package) ] - About the financial model: if it is joint work, then I do not think it makes much sense to ask companies like Sun (or Oracle) money for the * development* of the material. If they are willing to make the material part of their curriculum (which implies: visibility via their catalogs), then we can make money by *delivering* the material. Whether or not the material itself should be freely downoadable by anyone in the world is yet another matter. Again, maybe there should be some moderated group of people having access to the material. ... Luc On Tue, Jun 9, 2009 at 9:25 AM, Viktor Klang viktor.kl...@gmail.comwrote: On Tue, Jun 9, 2009 at 8:21 AM, Luc Duponcheel luc.duponch...@gmail.com wrote: Hi all, I attended the talk on Scala and the talk on Lift. Both excellent talks! [ I did not attend the talk on Actors (I was cycling on the other side of the Golden Gate Bridge (Mt Tamalpais)) ] ... Those talks act as 'teasers' to make developers 'eager to know more about Scala'. This is great! But, sometimes, I also have the impression that those talks 'preach for those that are already converted'. The point I want to make is the following: when talking to developers about Scala, I am almost always confronted with the fact that they still think it has a 'steep learning curve'. I tell them that 'once you have climbed the mountain, you can enjoy the view over the landscape' (cfr Mt Tamalpais). So, I really think there is this need for *hands on training*. Maybe some of you folks should try to convince Sun (or Oracle) Education to invest in training courses. Not a simple task indeed, but, worth the effort (helps Scala becoming mainstream). ps: I agree that I'm partially saying this out of pure opportunism (I'm delivering Java courses for Sun Education, and, of course, I would be the first one to deliver Scala courses). Awesome idea. Would be great to establish some kind of curriculum with joint teaching material to be able to offer courses worldwide. Luc On Mon, Jun 8, 2009 at 5:40 PM, David Pollak feeder.of.the.be...@gmail.com wrote: A big congratulations to the authors as well as the whole Scala community... Yet another proof point that 2009 is the year of Scala. Rock On! On Mon, Jun 8, 2009 at 7:34 AM, TylerWeir tyler.w...@gmail.comwrote: http://www.theserverside.com/news/thread.tss?thread_id=54862 Quote: Here are the top 10 selling books at the JavaOne
[Lift] More compact validation
Hi. In my lift application using Mapper, I'm doing this all the time: object name extends MappedPoliteString(this, 16) { override def validations = Validate.notEmpty(this) _ :: super.validations } where Validate is defined: object Validate { val valid = List[FieldError]() def notEmpty(fi: FieldIdentifier)(field: String) = { if (field.length == 0) List(FieldError(fi, Text(Field cannot be empty))) else valid } This code works, but is a bit verbose, especially when there are 10 or more strings in a class. I guess I could define a new class MappedPoliteNonEmptyString, but are there other (better) alternatives? -Magnus --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: JTA Transaction Monad - Early Access Program
Sweet looking stuff! On Tue, Jun 9, 2009 at 6:18 AM, Jonas Bonér jbo...@gmail.com wrote: Hey guys. I have hacked together an early draft of the JTA transaction stuff. I have wrapped it up in a monad. Here are some examples of usage: for { ctx - TransactionContext.Required entity - updatedEntities if !ctx.isRollbackOnly } { // transactional stuff ctx.getEntityManager.merge(entity) } val users = for { ctx - TransactionContext.Required name - userNames } yield { // transactional stuff val query = ctx.getEntityManager.createNamedQuery(findUserByName) query.setParameter(userName, name) query.getSingleResult } If you don't like the monadic approach you can just use the high-order functions: TransactionContext.withTxRequired { ... // REQUIRED semantics TransactionContext.withTxRequiresNew { ... // REQUIRES_NEW semantics } } I have implemented the same semantics as used in the EJB spec. Required, RequiresNew, Mandatory, Supports, Never. All these are monadic objects in the TransactionContext object. I don't have a webapp to try this out, so I would be happy to get all kinds of feedback, but API wise and bug reports or fixes. This API is hooked into Derek's Scala-JPA stuff. I had my own impl of this but replaced it with Derek's work. Derek, please go through the integration to see if I have done it correctly, and where things code be improved. All committers, feel free to hack and change this code anyway you want. The code is in a branch (wip-jta-jonas), you can find it here: http://github.com/dpp/liftweb/tree/3783b9e2200cc57dd72baa1bd8cabdb1365ee923/lift-jta Check the ScalaDoc (or the source) for the documentation on usage, semantics etc. Also see the README for configuration in persistence.xml etc. Currently it is hard-coded to use the Atomikos Transaction library and Hibernate JPA, that would have to be configurable + some other options as well. See the TODOs in the code. As I said, this needs feedback and testing. Thanks. -- Jonas Bonér twitter: @jboner blog:http://jonasboner.com work: http://crisp.se work: http://scalablesolutions.se code: http://github.com/jboner -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: More compact validation
If you have a common pattern, reducing it to a subclass makes sense. But if you don't want to do that, here's some shortening: object Validate { def notEmpty(fi: FieldIdentifier)(value: String) = List(FieldError(fo, Text(...)).filter(x = value.length == 0) } import Validate._ object name extends MappedPoliteString(this, 16) { override def validations = notEmpty(this) _ :: super.validations } By importing the object, you save the text of retyping the Validate. stuff over and over again. Thanks, David On Tue, Jun 9, 2009 at 6:40 AM, Magnus Alvestad magnus.alves...@gmail.comwrote: Hi. In my lift application using Mapper, I'm doing this all the time: object name extends MappedPoliteString(this, 16) { override def validations = Validate.notEmpty(this) _ :: super.validations } where Validate is defined: object Validate { val valid = List[FieldError]() def notEmpty(fi: FieldIdentifier)(field: String) = { if (field.length == 0) List(FieldError(fi, Text(Field cannot be empty))) else valid } This code works, but is a bit verbose, especially when there are 10 or more strings in a class. I guess I could define a new class MappedPoliteNonEmptyString, but are there other (better) alternatives? -Magnus -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: JTA Transaction Monad - Early Access Program
2009/6/9 David Pollak feeder.of.the.be...@gmail.com: Sweet looking stuff! Thanks. On Tue, Jun 9, 2009 at 6:18 AM, Jonas Bonér jbo...@gmail.com wrote: Hey guys. I have hacked together an early draft of the JTA transaction stuff. I have wrapped it up in a monad. Here are some examples of usage: for { ctx - TransactionContext.Required entity - updatedEntities if !ctx.isRollbackOnly } { // transactional stuff ctx.getEntityManager.merge(entity) } val users = for { ctx - TransactionContext.Required name - userNames } yield { // transactional stuff val query = ctx.getEntityManager.createNamedQuery(findUserByName) query.setParameter(userName, name) query.getSingleResult } If you don't like the monadic approach you can just use the high-order functions: TransactionContext.withTxRequired { ... // REQUIRED semantics TransactionContext.withTxRequiresNew { ... // REQUIRES_NEW semantics } } I have implemented the same semantics as used in the EJB spec. Required, RequiresNew, Mandatory, Supports, Never. All these are monadic objects in the TransactionContext object. I don't have a webapp to try this out, so I would be happy to get all kinds of feedback, but API wise and bug reports or fixes. This API is hooked into Derek's Scala-JPA stuff. I had my own impl of this but replaced it with Derek's work. Derek, please go through the integration to see if I have done it correctly, and where things code be improved. All committers, feel free to hack and change this code anyway you want. The code is in a branch (wip-jta-jonas), you can find it here: http://github.com/dpp/liftweb/tree/3783b9e2200cc57dd72baa1bd8cabdb1365ee923/lift-jta Check the ScalaDoc (or the source) for the documentation on usage, semantics etc. Also see the README for configuration in persistence.xml etc. Currently it is hard-coded to use the Atomikos Transaction library and Hibernate JPA, that would have to be configurable + some other options as well. See the TODOs in the code. As I said, this needs feedback and testing. Thanks. -- Jonas Bonér twitter: @jboner blog: http://jonasboner.com work: http://crisp.se work: http://scalablesolutions.se code: http://github.com/jboner -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp -- Jonas Bonér twitter: @jboner blog:http://jonasboner.com work: http://crisp.se work: http://scalablesolutions.se code: http://github.com/jboner --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: JTA Transaction Monad - Early Access Program
Starkt jobbat Jonas! I'll have a look at it asap :) On Tue, Jun 9, 2009 at 4:27 PM, Jonas Bonér jbo...@gmail.com wrote: 2009/6/9 David Pollak feeder.of.the.be...@gmail.com: Sweet looking stuff! Thanks. On Tue, Jun 9, 2009 at 6:18 AM, Jonas Bonér jbo...@gmail.com wrote: Hey guys. I have hacked together an early draft of the JTA transaction stuff. I have wrapped it up in a monad. Here are some examples of usage: for { ctx - TransactionContext.Required entity - updatedEntities if !ctx.isRollbackOnly } { // transactional stuff ctx.getEntityManager.merge(entity) } val users = for { ctx - TransactionContext.Required name - userNames } yield { // transactional stuff val query = ctx.getEntityManager.createNamedQuery(findUserByName) query.setParameter(userName, name) query.getSingleResult } If you don't like the monadic approach you can just use the high-order functions: TransactionContext.withTxRequired { ... // REQUIRED semantics TransactionContext.withTxRequiresNew { ... // REQUIRES_NEW semantics } } I have implemented the same semantics as used in the EJB spec. Required, RequiresNew, Mandatory, Supports, Never. All these are monadic objects in the TransactionContext object. I don't have a webapp to try this out, so I would be happy to get all kinds of feedback, but API wise and bug reports or fixes. This API is hooked into Derek's Scala-JPA stuff. I had my own impl of this but replaced it with Derek's work. Derek, please go through the integration to see if I have done it correctly, and where things code be improved. All committers, feel free to hack and change this code anyway you want. The code is in a branch (wip-jta-jonas), you can find it here: http://github.com/dpp/liftweb/tree/3783b9e2200cc57dd72baa1bd8cabdb1365ee923/lift-jta Check the ScalaDoc (or the source) for the documentation on usage, semantics etc. Also see the README for configuration in persistence.xml etc. Currently it is hard-coded to use the Atomikos Transaction library and Hibernate JPA, that would have to be configurable + some other options as well. See the TODOs in the code. As I said, this needs feedback and testing. Thanks. -- Jonas Bonér twitter: @jboner blog:http://jonasboner.com work: http://crisp.se work: http://scalablesolutions.se code: http://github.com/jboner -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp -- Jonas Bonér twitter: @jboner blog:http://jonasboner.com work: http://crisp.se work: http://scalablesolutions.se code: http://github.com/jboner -- Viktor Klang Rockstar Developer --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: JTA Transaction Monad - Early Access Program
Wow, this is very nice! Kudos Jonas! Cheers, Tim On 09/06/2009 14:18, Jonas Bonér jbo...@gmail.com wrote: Hey guys. I have hacked together an early draft of the JTA transaction stuff. I have wrapped it up in a monad. Here are some examples of usage: for { ctx - TransactionContext.Required entity - updatedEntities if !ctx.isRollbackOnly } { // transactional stuff ctx.getEntityManager.merge(entity) } val users = for { ctx - TransactionContext.Required name - userNames } yield { // transactional stuff val query = ctx.getEntityManager.createNamedQuery(findUserByName) query.setParameter(userName, name) query.getSingleResult } If you don't like the monadic approach you can just use the high-order functions: TransactionContext.withTxRequired { ... // REQUIRED semantics TransactionContext.withTxRequiresNew { ... // REQUIRES_NEW semantics } } I have implemented the same semantics as used in the EJB spec. Required, RequiresNew, Mandatory, Supports, Never. All these are monadic objects in the TransactionContext object. I don't have a webapp to try this out, so I would be happy to get all kinds of feedback, but API wise and bug reports or fixes. This API is hooked into Derek's Scala-JPA stuff. I had my own impl of this but replaced it with Derek's work. Derek, please go through the integration to see if I have done it correctly, and where things code be improved. All committers, feel free to hack and change this code anyway you want. The code is in a branch (wip-jta-jonas), you can find it here: http://github.com/dpp/liftweb/tree/3783b9e2200cc57dd72baa1bd8cabdb1365ee923/li ft-jta Check the ScalaDoc (or the source) for the documentation on usage, semantics etc. Also see the README for configuration in persistence.xml etc. Currently it is hard-coded to use the Atomikos Transaction library and Hibernate JPA, that would have to be configurable + some other options as well. See the TODOs in the code. As I said, this needs feedback and testing. Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Great pictures from the Scala Lift Off
I wish I could actually discover LSUG meets! I signed up on (the extremely minimalist) http://lsug.org/ but the only other hits I get are fleeting references to old meets on nabble and flickr Where's the google group? The mailing list? On Mon, Jun 8, 2009 at 11:10 PM, Timothy Perrett timo...@getintheloop.euwrote: That would be good but it's probally not going to happen. Do you get along to the LSUG meets? It would be good to catch up with more lift users at a meet sometime - I'll check with mr mclaver when the next one is and perhaps try to make it along. Cheers Tim Sent from my iPhone On 8 Jun 2009, at 22:26, KWright kev.lee.wri...@googlemail.com wrote: Something in london! please anyone... On Jun 8, 10:25 pm, TylerWeir tyler.w...@gmail.com wrote: Washington, DC area in October 2009. Road trip! I plan on attending LiftOffEast. On Jun 8, 4:06 pm, Dean Wampler deanwamp...@gmail.com wrote: Is the date set for the Washington, DC meeting? On Mon, Jun 8, 2009 at 12:43 PM, David Pollak feeder.of.the.be...@gmail.com wrote: On Mon, Jun 8, 2009 at 10:29 AM, Derek Chen-Becker dchenbec...@gmail.comwrote: I'm still pushing for a Scala on Skis conference out here in Colorado ;) It's looking like Scala on Skis will be held in Lausanne, Switzerland in Spring 2010. We'll also have a Scala Lift Off in the Washington, DC area in October 2009. Maybe we'll have a Denver-based conference in 2010. Derek On Mon, Jun 8, 2009 at 11:14 AM, Timothy Perrett timo...@getintheloop.eu wrote: Sweet! So jeleous of you guys cant wait to have a EMEA scala geek meet! Then myself, Viktor and Heiko can really hit the beers ;-) Cheers, Tim On Jun 8, 5:53 pm, David Pollak feeder.of.the.be...@gmail.com wrote: Folks, Ilya not only writes great IDE plugins, he takes good pictures: http://picasaweb.google.com/ilyas239/Scalaliftoff09# Thanks, David -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp -- Dean Wampler coauthor of Programming Scala (O'Reilly) twitter: @deanwampler, @chicagoscala Chicago-Area Scala Enthusiasts (CASE): - http://groups.google.com/group/chicagoscala - http://www.meetup.com/chicagoscala/(Meetings)http://www.objectmentorhttp://www.meetup.com/chicagoscala/%28Meetings%29http://www.objectmentor --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] How to prevent OutOfMemory while compiling Lift project?
Hi : When my project grows, it seems a mvn clean following a mvn test would generally causes OutOfMemoryException, even with a set MAVEN_OPTS=-Xms512M -Xmx1024M. I got this error : [WARNING] Exception in thread main java.lang.OutOfMemoryError: Java heap space [WARNING] at scala.StringBuilder$.scala$StringBuilder$$copyOf (StringBuilde r.scala:867) [WARNING] at scala.StringBuilder.expandCapacity (StringBuilder.scala:112) [WARNING] at scala.StringBuilder.append(StringBuilder.scala:246) [WARNING] at scala.StringBuilder.append(StringBuilder.scala:234) [WARNING] at scala.tools.nsc.symtab.Symbols$Symbol.fullNameString (Symbols. scala:1241) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM $BytecodeGenerator.javaName (GenJVM.scala:1583) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator $$anonfun $genBlock$1$1.apply(GenJVM.scala:971) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator $$anonfun $genBlock$1$1.apply(GenJVM.scala:868) [WARNING] at scala.Iterator$class.foreach(Iterator.scala:414) [WARNING] at scala.runtime.BoxedArray$AnyIterator.foreach (BoxedArray.scala :45) [WARNING] at scala.Iterable$class.foreach(Iterable.scala:256) [WARNING] at scala.runtime.BoxedArray.foreach(BoxedArray.scala: 24) [WARNING] at scala.tools.nsc.backend.icode.BasicBlocks $BasicBlock.foreach( BasicBlocks.scala:130) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM $BytecodeGenerator.genBlock $1(GenJVM.scala:868) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM $BytecodeGenerator.genBlock s$1(GenJVM.scala:791) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM $BytecodeGenerator.genCode( GenJVM.scala:1415) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM $BytecodeGenerator.genMetho d(GenJVM.scala:594) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator $$anonfun $genClass$4.apply(GenJVM.scala:216) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator $$anonfun $genClass$4.apply(GenJVM.scala:216) [WARNING] at scala.List.foreach(List.scala:841) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM $BytecodeGenerator.genClass (GenJVM.scala:216) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM$JvmPhase$$anonfun $run$2.ap ply(GenJVM.scala:55) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM$JvmPhase$$anonfun $run$2.ap ply(GenJVM.scala:55) [WARNING] at scala.Iterator$class.foreach(Iterator.scala:414) [WARNING] at scala.collection.Map$$anon$6.foreach(Map.scala:123) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM$JvmPhase.run (GenJVM.scala: 55) [WARNING] at scala.tools.nsc.Global$Run.compileSources (Global.scala:574) [WARNING] at scala.tools.nsc.Global$Run.compile(Global.scala: 667) [WARNING] at scala.tools.nsc.Main$.process(Main.scala:73) [WARNING] at scala.tools.nsc.Main$.main(Main.scala:87) [WARNING] at scala.tools.nsc.Main.main(Main.scala) [INFO] [ERROR] BUILD FAILURE [INFO] [INFO] command line returned non-zero value:1 [INFO] [INFO] For more information, run Maven with the -e switch [INFO] [INFO] Total time: 1 minute 4 seconds [INFO] Finished at: Tue Jun 09 23:10:56 CST 2009 [INFO] Final Memory: 16M/508M [INFO] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: How to prevent OutOfMemory while compiling Lift project?
I don't know if the Maven Scala plugin picks up MavenOpts... please try this in your pom.xml file: plugin groupIdorg.scala-tools/groupId artifactIdmaven-scala-plugin/artifactId version2.10/version executions execution goals goalcompile/goal goaltestCompile/goal /goals /execution /executions configuration jvmArgs jvmArg-Xmx1024m/jvmArg /jvmArgs scalaVersion${scala.version}/scalaVersion /configuration /plugin On Tue, Jun 9, 2009 at 8:14 AM, sailormoo...@gmail.com sailormoo...@gmail.com wrote: Hi : When my project grows, it seems a mvn clean following a mvn test would generally causes OutOfMemoryException, even with a set MAVEN_OPTS=-Xms512M -Xmx1024M. I got this error : [WARNING] Exception in thread main java.lang.OutOfMemoryError: Java heap space [WARNING] at scala.StringBuilder$.scala$StringBuilder$$copyOf (StringBuilde r.scala:867) [WARNING] at scala.StringBuilder.expandCapacity (StringBuilder.scala:112) [WARNING] at scala.StringBuilder.append(StringBuilder.scala:246) [WARNING] at scala.StringBuilder.append(StringBuilder.scala:234) [WARNING] at scala.tools.nsc.symtab.Symbols$Symbol.fullNameString (Symbols. scala:1241) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM $BytecodeGenerator.javaName (GenJVM.scala:1583) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator $$anonfun $genBlock$1$1.apply(GenJVM.scala:971) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator $$anonfun $genBlock$1$1.apply(GenJVM.scala:868) [WARNING] at scala.Iterator$class.foreach(Iterator.scala:414) [WARNING] at scala.runtime.BoxedArray$AnyIterator.foreach (BoxedArray.scala :45) [WARNING] at scala.Iterable$class.foreach(Iterable.scala:256) [WARNING] at scala.runtime.BoxedArray.foreach(BoxedArray.scala: 24) [WARNING] at scala.tools.nsc.backend.icode.BasicBlocks $BasicBlock.foreach( BasicBlocks.scala:130) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM $BytecodeGenerator.genBlock $1(GenJVM.scala:868) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM $BytecodeGenerator.genBlock s$1(GenJVM.scala:791) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM $BytecodeGenerator.genCode( GenJVM.scala:1415) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM $BytecodeGenerator.genMetho d(GenJVM.scala:594) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator $$anonfun $genClass$4.apply(GenJVM.scala:216) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator $$anonfun $genClass$4.apply(GenJVM.scala:216) [WARNING] at scala.List.foreach(List.scala:841) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM $BytecodeGenerator.genClass (GenJVM.scala:216) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM$JvmPhase$$anonfun $run$2.ap ply(GenJVM.scala:55) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM$JvmPhase$$anonfun $run$2.ap ply(GenJVM.scala:55) [WARNING] at scala.Iterator$class.foreach(Iterator.scala:414) [WARNING] at scala.collection.Map$$anon$6.foreach(Map.scala:123) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM$JvmPhase.run (GenJVM.scala: 55) [WARNING] at scala.tools.nsc.Global$Run.compileSources (Global.scala:574) [WARNING] at scala.tools.nsc.Global$Run.compile(Global.scala: 667) [WARNING] at scala.tools.nsc.Main$.process(Main.scala:73) [WARNING] at scala.tools.nsc.Main$.main(Main.scala:87) [WARNING] at scala.tools.nsc.Main.main(Main.scala) [INFO] [ERROR] BUILD FAILURE [INFO] [INFO] command line returned non-zero value:1 [INFO] [INFO] For more information, run Maven with the -e switch [INFO] [INFO] Total time: 1 minute 4 seconds [INFO] Finished at: Tue Jun 09 23:10:56 CST 2009 [INFO] Final Memory: 16M/508M [INFO] -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en
[Lift] Re: JTA Transaction Monad - Early Access Program
Awesome! I'll take a look at the code. If you're basing this on ScalaJPA, would it be preferable to add the functionality there, or is there anything Lift-specific? Derek On Tue, Jun 9, 2009 at 7:18 AM, Jonas Bonér jbo...@gmail.com wrote: Hey guys. I have hacked together an early draft of the JTA transaction stuff. I have wrapped it up in a monad. Here are some examples of usage: for { ctx - TransactionContext.Required entity - updatedEntities if !ctx.isRollbackOnly } { // transactional stuff ctx.getEntityManager.merge(entity) } val users = for { ctx - TransactionContext.Required name - userNames } yield { // transactional stuff val query = ctx.getEntityManager.createNamedQuery(findUserByName) query.setParameter(userName, name) query.getSingleResult } If you don't like the monadic approach you can just use the high-order functions: TransactionContext.withTxRequired { ... // REQUIRED semantics TransactionContext.withTxRequiresNew { ... // REQUIRES_NEW semantics } } I have implemented the same semantics as used in the EJB spec. Required, RequiresNew, Mandatory, Supports, Never. All these are monadic objects in the TransactionContext object. I don't have a webapp to try this out, so I would be happy to get all kinds of feedback, but API wise and bug reports or fixes. This API is hooked into Derek's Scala-JPA stuff. I had my own impl of this but replaced it with Derek's work. Derek, please go through the integration to see if I have done it correctly, and where things code be improved. All committers, feel free to hack and change this code anyway you want. The code is in a branch (wip-jta-jonas), you can find it here: http://github.com/dpp/liftweb/tree/3783b9e2200cc57dd72baa1bd8cabdb1365ee923/lift-jta Check the ScalaDoc (or the source) for the documentation on usage, semantics etc. Also see the README for configuration in persistence.xml etc. Currently it is hard-coded to use the Atomikos Transaction library and Hibernate JPA, that would have to be configurable + some other options as well. See the TODOs in the code. As I said, this needs feedback and testing. Thanks. -- Jonas Bonér twitter: @jboner blog:http://jonasboner.com work: http://crisp.se work: http://scalablesolutions.se code: http://github.com/jboner --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: How to prevent OutOfMemory while compiling Lift project?
It might be permgen space, I'm currently using: MAVEN_OPTS=-Xms1024m -Xmx1024m -XX:MaxPermSize=256m -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC *-Xms1024m -Xmx1024m* set the min and max the same, so no dynamic reallocation will happen, should be faster :) *-XX:MaxPermSize=256m* sets the size of the permenant generation, you usually need this if you have a large heap *-XX:+UnlockExperimentalVMOptions -XX:+UseG1GC* enables the G1 garbage collector (this need the LATEST java update), which seems to be a bit faster. On Tue, Jun 9, 2009 at 4:14 PM, sailormoo...@gmail.com sailormoo...@gmail.com wrote: Hi : When my project grows, it seems a mvn clean following a mvn test would generally causes OutOfMemoryException, even with a set MAVEN_OPTS=-Xms512M -Xmx1024M. I got this error : [WARNING] Exception in thread main java.lang.OutOfMemoryError: Java heap space [WARNING] at scala.StringBuilder$.scala$StringBuilder$$copyOf (StringBuilde r.scala:867) [WARNING] at scala.StringBuilder.expandCapacity (StringBuilder.scala:112) [WARNING] at scala.StringBuilder.append(StringBuilder.scala:246) [WARNING] at scala.StringBuilder.append(StringBuilder.scala:234) [WARNING] at scala.tools.nsc.symtab.Symbols$Symbol.fullNameString (Symbols. scala:1241) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM $BytecodeGenerator.javaName (GenJVM.scala:1583) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator $$anonfun $genBlock$1$1.apply(GenJVM.scala:971) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator $$anonfun $genBlock$1$1.apply(GenJVM.scala:868) [WARNING] at scala.Iterator$class.foreach(Iterator.scala:414) [WARNING] at scala.runtime.BoxedArray$AnyIterator.foreach (BoxedArray.scala :45) [WARNING] at scala.Iterable$class.foreach(Iterable.scala:256) [WARNING] at scala.runtime.BoxedArray.foreach(BoxedArray.scala: 24) [WARNING] at scala.tools.nsc.backend.icode.BasicBlocks $BasicBlock.foreach( BasicBlocks.scala:130) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM $BytecodeGenerator.genBlock $1(GenJVM.scala:868) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM $BytecodeGenerator.genBlock s$1(GenJVM.scala:791) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM $BytecodeGenerator.genCode( GenJVM.scala:1415) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM $BytecodeGenerator.genMetho d(GenJVM.scala:594) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator $$anonfun $genClass$4.apply(GenJVM.scala:216) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator $$anonfun $genClass$4.apply(GenJVM.scala:216) [WARNING] at scala.List.foreach(List.scala:841) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM $BytecodeGenerator.genClass (GenJVM.scala:216) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM$JvmPhase$$anonfun $run$2.ap ply(GenJVM.scala:55) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM$JvmPhase$$anonfun $run$2.ap ply(GenJVM.scala:55) [WARNING] at scala.Iterator$class.foreach(Iterator.scala:414) [WARNING] at scala.collection.Map$$anon$6.foreach(Map.scala:123) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM$JvmPhase.run (GenJVM.scala: 55) [WARNING] at scala.tools.nsc.Global$Run.compileSources (Global.scala:574) [WARNING] at scala.tools.nsc.Global$Run.compile(Global.scala: 667) [WARNING] at scala.tools.nsc.Main$.process(Main.scala:73) [WARNING] at scala.tools.nsc.Main$.main(Main.scala:87) [WARNING] at scala.tools.nsc.Main.main(Main.scala) [INFO] [ERROR] BUILD FAILURE [INFO] [INFO] command line returned non-zero value:1 [INFO] [INFO] For more information, run Maven with the -e switch [INFO] [INFO] Total time: 1 minute 4 seconds [INFO] Finished at: Tue Jun 09 23:10:56 CST 2009 [INFO] Final Memory: 16M/508M [INFO] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Great pictures from the Scala Lift Off
Miles Sabin is presenting the Scala* *Eclipse plug-in at the ThoughtWorks offices in London on July the 2nd. http://www.nabble.com/Scala-talk-in-London-td23726579.html If you come along to that I'm sure you'd be able to discover LSUG's mailing list. Like you I've failed to find it so far. -- Sam On Tue, Jun 9, 2009 at 3:57 PM, Kevin Wright kev.lee.wri...@googlemail.comwrote: I wish I could actually discover LSUG meets! I signed up on (the extremely minimalist) http://lsug.org/ but the only other hits I get are fleeting references to old meets on nabble and flickr Where's the google group? The mailing list? On Mon, Jun 8, 2009 at 11:10 PM, Timothy Perrett timo...@getintheloop.euwrote: That would be good but it's probally not going to happen. Do you get along to the LSUG meets? It would be good to catch up with more lift users at a meet sometime - I'll check with mr mclaver when the next one is and perhaps try to make it along. Cheers Tim Sent from my iPhone On 8 Jun 2009, at 22:26, KWright kev.lee.wri...@googlemail.com wrote: Something in london! please anyone... On Jun 8, 10:25 pm, TylerWeir tyler.w...@gmail.com wrote: Washington, DC area in October 2009. Road trip! I plan on attending LiftOffEast. On Jun 8, 4:06 pm, Dean Wampler deanwamp...@gmail.com wrote: Is the date set for the Washington, DC meeting? On Mon, Jun 8, 2009 at 12:43 PM, David Pollak feeder.of.the.be...@gmail.com wrote: On Mon, Jun 8, 2009 at 10:29 AM, Derek Chen-Becker dchenbec...@gmail.comwrote: I'm still pushing for a Scala on Skis conference out here in Colorado ;) It's looking like Scala on Skis will be held in Lausanne, Switzerland in Spring 2010. We'll also have a Scala Lift Off in the Washington, DC area in October 2009. Maybe we'll have a Denver-based conference in 2010. Derek On Mon, Jun 8, 2009 at 11:14 AM, Timothy Perrett timo...@getintheloop.eu wrote: Sweet! So jeleous of you guys cant wait to have a EMEA scala geek meet! Then myself, Viktor and Heiko can really hit the beers ;-) Cheers, Tim On Jun 8, 5:53 pm, David Pollak feeder.of.the.be...@gmail.com wrote: Folks, Ilya not only writes great IDE plugins, he takes good pictures: http://picasaweb.google.com/ilyas239/Scalaliftoff09# Thanks, David -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp -- Dean Wampler coauthor of Programming Scala (O'Reilly) twitter: @deanwampler, @chicagoscala Chicago-Area Scala Enthusiasts (CASE): - http://groups.google.com/group/chicagoscala - http://www.meetup.com/chicagoscala/(Meetings)http://www.objectmentorhttp://www.meetup.com/chicagoscala/%28Meetings%29http://www.objectmentor --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: How to prevent OutOfMemory while compiling Lift project?
maven fork a new jvm to run scalac (by default) so MAVEN_OPTS is not used to launch scalac you need to define the (like David P said) configuration jvmArgs jvmArg-Xmx1024m/jvmArg /jvmArgs if you want to customize the jvm args /davidB On Tue, Jun 9, 2009 at 17:45, Kevin Wright kev.lee.wri...@googlemail.comwrote: It might be permgen space, I'm currently using: MAVEN_OPTS=-Xms1024m -Xmx1024m -XX:MaxPermSize=256m -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC *-Xms1024m -Xmx1024m* set the min and max the same, so no dynamic reallocation will happen, should be faster :) *-XX:MaxPermSize=256m* sets the size of the permenant generation, you usually need this if you have a large heap *-XX:+UnlockExperimentalVMOptions -XX:+UseG1GC* enables the G1 garbage collector (this need the LATEST java update), which seems to be a bit faster. On Tue, Jun 9, 2009 at 4:14 PM, sailormoo...@gmail.com sailormoo...@gmail.com wrote: Hi : When my project grows, it seems a mvn clean following a mvn test would generally causes OutOfMemoryException, even with a set MAVEN_OPTS=-Xms512M -Xmx1024M. I got this error : [WARNING] Exception in thread main java.lang.OutOfMemoryError: Java heap space [WARNING] at scala.StringBuilder$.scala$StringBuilder$$copyOf (StringBuilde r.scala:867) [WARNING] at scala.StringBuilder.expandCapacity (StringBuilder.scala:112) [WARNING] at scala.StringBuilder.append(StringBuilder.scala:246) [WARNING] at scala.StringBuilder.append(StringBuilder.scala:234) [WARNING] at scala.tools.nsc.symtab.Symbols$Symbol.fullNameString (Symbols. scala:1241) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM $BytecodeGenerator.javaName (GenJVM.scala:1583) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator $$anonfun $genBlock$1$1.apply(GenJVM.scala:971) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator $$anonfun $genBlock$1$1.apply(GenJVM.scala:868) [WARNING] at scala.Iterator$class.foreach(Iterator.scala:414) [WARNING] at scala.runtime.BoxedArray$AnyIterator.foreach (BoxedArray.scala :45) [WARNING] at scala.Iterable$class.foreach(Iterable.scala:256) [WARNING] at scala.runtime.BoxedArray.foreach(BoxedArray.scala: 24) [WARNING] at scala.tools.nsc.backend.icode.BasicBlocks $BasicBlock.foreach( BasicBlocks.scala:130) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM $BytecodeGenerator.genBlock $1(GenJVM.scala:868) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM $BytecodeGenerator.genBlock s$1(GenJVM.scala:791) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM $BytecodeGenerator.genCode( GenJVM.scala:1415) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM $BytecodeGenerator.genMetho d(GenJVM.scala:594) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator $$anonfun $genClass$4.apply(GenJVM.scala:216) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator $$anonfun $genClass$4.apply(GenJVM.scala:216) [WARNING] at scala.List.foreach(List.scala:841) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM $BytecodeGenerator.genClass (GenJVM.scala:216) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM$JvmPhase$$anonfun $run$2.ap ply(GenJVM.scala:55) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM$JvmPhase$$anonfun $run$2.ap ply(GenJVM.scala:55) [WARNING] at scala.Iterator$class.foreach(Iterator.scala:414) [WARNING] at scala.collection.Map$$anon$6.foreach(Map.scala:123) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM$JvmPhase.run (GenJVM.scala: 55) [WARNING] at scala.tools.nsc.Global$Run.compileSources (Global.scala:574) [WARNING] at scala.tools.nsc.Global$Run.compile(Global.scala: 667) [WARNING] at scala.tools.nsc.Main$.process(Main.scala:73) [WARNING] at scala.tools.nsc.Main$.main(Main.scala:87) [WARNING] at scala.tools.nsc.Main.main(Main.scala) [INFO] [ERROR] BUILD FAILURE [INFO] [INFO] command line returned non-zero value:1 [INFO] [INFO] For more information, run Maven with the -e switch [INFO] [INFO] Total time: 1 minute 4 seconds [INFO] Finished at: Tue Jun 09 23:10:56 CST 2009 [INFO] Final Memory: 16M/508M [INFO] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com
[Lift] Re: Great pictures from the Scala Lift Off
On 9 Jun 2009, at 15:57, Kevin Wright wrote: I wish I could actually discover LSUG meets! I signed up on (the extremely minimalist) http://lsug.org/ but the only other hits I get are fleeting references to old meets on nabble and flickr Ah, good point. For London Scala User group announcements you need to subscribe to the LSUG mailing list. You can do that by sending a blank email to lsug+subscr...@lists.scalaforge.org Hmm... might be an idea if we actually add that info to lsug.org :-/ Returning to the subject: My photos from liftoff are http://www.flickr.com/photos/d6y/sets/72157619282779995/ Cheers Richard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: JTA Transaction Monad - Early Access Program
OK, one quick comment before I dive in: we generally want to depend on Maven to grab dependencies. Right now you have a lib folder checked into git that appears to hold the JTA libs and Atomikos. If that's the Sun JTA libs then we can't distribute them. We generally use the geronimo JTA API, so you could instead add dependencies to your pom.xml from the following: http://mvnrepository.com/artifact/com.atomikos dependency groupIdorg.apache.geronimo.specs/groupId artifactIdgeronimo-jta_1.1_spec/artifactId version1.1.1/version /dependency Let me know if you have any problems with that. Now, on to the code! Derek On Tue, Jun 9, 2009 at 9:44 AM, Derek Chen-Becker dchenbec...@gmail.comwrote: Awesome! I'll take a look at the code. If you're basing this on ScalaJPA, would it be preferable to add the functionality there, or is there anything Lift-specific? Derek On Tue, Jun 9, 2009 at 7:18 AM, Jonas Bonér jbo...@gmail.com wrote: Hey guys. I have hacked together an early draft of the JTA transaction stuff. I have wrapped it up in a monad. Here are some examples of usage: for { ctx - TransactionContext.Required entity - updatedEntities if !ctx.isRollbackOnly } { // transactional stuff ctx.getEntityManager.merge(entity) } val users = for { ctx - TransactionContext.Required name - userNames } yield { // transactional stuff val query = ctx.getEntityManager.createNamedQuery(findUserByName) query.setParameter(userName, name) query.getSingleResult } If you don't like the monadic approach you can just use the high-order functions: TransactionContext.withTxRequired { ... // REQUIRED semantics TransactionContext.withTxRequiresNew { ... // REQUIRES_NEW semantics } } I have implemented the same semantics as used in the EJB spec. Required, RequiresNew, Mandatory, Supports, Never. All these are monadic objects in the TransactionContext object. I don't have a webapp to try this out, so I would be happy to get all kinds of feedback, but API wise and bug reports or fixes. This API is hooked into Derek's Scala-JPA stuff. I had my own impl of this but replaced it with Derek's work. Derek, please go through the integration to see if I have done it correctly, and where things code be improved. All committers, feel free to hack and change this code anyway you want. The code is in a branch (wip-jta-jonas), you can find it here: http://github.com/dpp/liftweb/tree/3783b9e2200cc57dd72baa1bd8cabdb1365ee923/lift-jta Check the ScalaDoc (or the source) for the documentation on usage, semantics etc. Also see the README for configuration in persistence.xml etc. Currently it is hard-coded to use the Atomikos Transaction library and Hibernate JPA, that would have to be configurable + some other options as well. See the TODOs in the code. As I said, this needs feedback and testing. Thanks. -- Jonas Bonér twitter: @jboner blog:http://jonasboner.com work: http://crisp.se work: http://scalablesolutions.se code: http://github.com/jboner --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: How to prevent OutOfMemory while compiling Lift project?
Thanks for the help, the jvmArgs works, and I added Kevin's Suggestions too. On 6月9日, 下午11時54分, David Bernard david.bernard...@gmail.com wrote: maven fork a new jvm to run scalac (by default) so MAVEN_OPTS is not used to launch scalac you need to define the (like David P said) configuration jvmArgs jvmArg-Xmx1024m/jvmArg /jvmArgs if you want to customize the jvm args /davidB On Tue, Jun 9, 2009 at 17:45, Kevin Wright kev.lee.wri...@googlemail.comwrote: It might be permgen space, I'm currently using: MAVEN_OPTS=-Xms1024m -Xmx1024m -XX:MaxPermSize=256m -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC *-Xms1024m -Xmx1024m* set the min and max the same, so no dynamic reallocation will happen, should be faster :) *-XX:MaxPermSize=256m* sets the size of the permenant generation, you usually need this if you have a large heap *-XX:+UnlockExperimentalVMOptions -XX:+UseG1GC* enables the G1 garbage collector (this need the LATEST java update), which seems to be a bit faster. On Tue, Jun 9, 2009 at 4:14 PM, sailormoo...@gmail.com sailormoo...@gmail.com wrote: Hi : When my project grows, it seems a mvn clean following a mvn test would generally causes OutOfMemoryException, even with a set MAVEN_OPTS=-Xms512M -Xmx1024M. I got this error : [WARNING] Exception in thread main java.lang.OutOfMemoryError: Java heap space [WARNING] at scala.StringBuilder$.scala$StringBuilder$$copyOf (StringBuilde r.scala:867) [WARNING] at scala.StringBuilder.expandCapacity (StringBuilder.scala:112) [WARNING] at scala.StringBuilder.append(StringBuilder.scala:246) [WARNING] at scala.StringBuilder.append(StringBuilder.scala:234) [WARNING] at scala.tools.nsc.symtab.Symbols$Symbol.fullNameString (Symbols. scala:1241) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM $BytecodeGenerator.javaName (GenJVM.scala:1583) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator $$anonfun $genBlock$1$1.apply(GenJVM.scala:971) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator $$anonfun $genBlock$1$1.apply(GenJVM.scala:868) [WARNING] at scala.Iterator$class.foreach(Iterator.scala:414) [WARNING] at scala.runtime.BoxedArray$AnyIterator.foreach (BoxedArray.scala :45) [WARNING] at scala.Iterable$class.foreach(Iterable.scala:256) [WARNING] at scala.runtime.BoxedArray.foreach(BoxedArray.scala: 24) [WARNING] at scala.tools.nsc.backend.icode.BasicBlocks $BasicBlock.foreach( BasicBlocks.scala:130) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM $BytecodeGenerator.genBlock $1(GenJVM.scala:868) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM $BytecodeGenerator.genBlock s$1(GenJVM.scala:791) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM $BytecodeGenerator.genCode( GenJVM.scala:1415) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM $BytecodeGenerator.genMetho d(GenJVM.scala:594) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator $$anonfun $genClass$4.apply(GenJVM.scala:216) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator $$anonfun $genClass$4.apply(GenJVM.scala:216) [WARNING] at scala.List.foreach(List.scala:841) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM $BytecodeGenerator.genClass (GenJVM.scala:216) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM$JvmPhase$$anonfun $run$2.ap ply(GenJVM.scala:55) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM$JvmPhase$$anonfun $run$2.ap ply(GenJVM.scala:55) [WARNING] at scala.Iterator$class.foreach(Iterator.scala:414) [WARNING] at scala.collection.Map$$anon$6.foreach(Map.scala:123) [WARNING] at scala.tools.nsc.backend.jvm.GenJVM$JvmPhase.run (GenJVM.scala: 55) [WARNING] at scala.tools.nsc.Global$Run.compileSources (Global.scala:574) [WARNING] at scala.tools.nsc.Global$Run.compile(Global.scala: 667) [WARNING] at scala.tools.nsc.Main$.process(Main.scala:73) [WARNING] at scala.tools.nsc.Main$.main(Main.scala:87) [WARNING] at scala.tools.nsc.Main.main(Main.scala) [INFO] [ERROR] BUILD FAILURE [INFO] [INFO] command line returned non-zero value:1 [INFO] [INFO] For more information, run Maven with the -e switch [INFO] [INFO] Total time: 1 minute 4 seconds [INFO] Finished at: Tue Jun 09 23:10:56 CST 2009 [INFO] Final Memory: 16M/508M [INFO] - 隱藏被引用文字 - - 顯示被引用文字 -
[Lift] Re: Great pictures from the Scala Lift Off
Haha yeah LSUG is like a secret society or something... They always appear to happen at the last min as well. Something like are people up for an LSUG next Tuesday Cheers, Tim On 09/06/2009 16:58, Richard Dallaway dalla...@gmail.com wrote: On 9 Jun 2009, at 15:57, Kevin Wright wrote: I wish I could actually discover LSUG meets! I signed up on (the extremely minimalist) http://lsug.org/ but the only other hits I get are fleeting references to old meets on nabble and flickr Ah, good point. For London Scala User group announcements you need to subscribe to the LSUG mailing list. You can do that by sending a blank email to lsug+subscr...@lists.scalaforge.org Hmm... might be an idea if we actually add that info to lsug.org :-/ Returning to the subject: My photos from liftoff are http://www.flickr.com/photos/d6y/sets/72157619282779995/ Cheers Richard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Great pictures from the Scala Lift Off
BTW, are you in need of someone to actually add a bit of content to that site? On Tue, Jun 9, 2009 at 4:58 PM, Richard Dallaway dalla...@gmail.com wrote: On 9 Jun 2009, at 15:57, Kevin Wright wrote: I wish I could actually discover LSUG meets! I signed up on (the extremely minimalist) http://lsug.org/ but the only other hits I get are fleeting references to old meets on nabble and flickr Ah, good point. For London Scala User group announcements you need to subscribe to the LSUG mailing list. You can do that by sending a blank email to lsug+subscr...@lists.scalaforge.orglsug%2bsubscr...@lists.scalaforge.org Hmm... might be an idea if we actually add that info to lsug.org :-/ Returning to the subject: My photos from liftoff are http://www.flickr.com/photos/d6y/sets/72157619282779995/ Cheers Richard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: JTA Transaction Monad - Early Access Program
I added the lib folder only since I have not been able to find the atomikos and deps in any maven repo. Now the user can install them in their private repo. If they exist in a public repo then I will remove the lib folder. Will switch to the apache libs. Thanks, Jonas. 2009/6/9 Derek Chen-Becker dchenbec...@gmail.com: OK, one quick comment before I dive in: we generally want to depend on Maven to grab dependencies. Right now you have a lib folder checked into git that appears to hold the JTA libs and Atomikos. If that's the Sun JTA libs then we can't distribute them. We generally use the geronimo JTA API, so you could instead add dependencies to your pom.xml from the following: http://mvnrepository.com/artifact/com.atomikos dependency groupIdorg.apache.geronimo.specs/groupId artifactIdgeronimo-jta_1.1_spec/artifactId version1.1.1/version /dependency Let me know if you have any problems with that. Now, on to the code! Derek On Tue, Jun 9, 2009 at 9:44 AM, Derek Chen-Becker dchenbec...@gmail.com wrote: Awesome! I'll take a look at the code. If you're basing this on ScalaJPA, would it be preferable to add the functionality there, or is there anything Lift-specific? Derek On Tue, Jun 9, 2009 at 7:18 AM, Jonas Bonér jbo...@gmail.com wrote: Hey guys. I have hacked together an early draft of the JTA transaction stuff. I have wrapped it up in a monad. Here are some examples of usage: for { ctx - TransactionContext.Required entity - updatedEntities if !ctx.isRollbackOnly } { // transactional stuff ctx.getEntityManager.merge(entity) } val users = for { ctx - TransactionContext.Required name - userNames } yield { // transactional stuff val query = ctx.getEntityManager.createNamedQuery(findUserByName) query.setParameter(userName, name) query.getSingleResult } If you don't like the monadic approach you can just use the high-order functions: TransactionContext.withTxRequired { ... // REQUIRED semantics TransactionContext.withTxRequiresNew { ... // REQUIRES_NEW semantics } } I have implemented the same semantics as used in the EJB spec. Required, RequiresNew, Mandatory, Supports, Never. All these are monadic objects in the TransactionContext object. I don't have a webapp to try this out, so I would be happy to get all kinds of feedback, but API wise and bug reports or fixes. This API is hooked into Derek's Scala-JPA stuff. I had my own impl of this but replaced it with Derek's work. Derek, please go through the integration to see if I have done it correctly, and where things code be improved. All committers, feel free to hack and change this code anyway you want. The code is in a branch (wip-jta-jonas), you can find it here: http://github.com/dpp/liftweb/tree/3783b9e2200cc57dd72baa1bd8cabdb1365ee923/lift-jta Check the ScalaDoc (or the source) for the documentation on usage, semantics etc. Also see the README for configuration in persistence.xml etc. Currently it is hard-coded to use the Atomikos Transaction library and Hibernate JPA, that would have to be configurable + some other options as well. See the TODOs in the code. As I said, this needs feedback and testing. Thanks. -- Jonas Bonér twitter: @jboner blog: http://jonasboner.com work: http://crisp.se work: http://scalablesolutions.se code: http://github.com/jboner -- Jonas Bonér twitter: @jboner blog:http://jonasboner.com work: http://crisp.se work: http://scalablesolutions.se code: http://github.com/jboner --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: JTA Transaction Monad - Early Access Program
Isnt LiftLogger extensible? Perhaps there would be some way to integrate it with LiftLogger so it was an optional logger just like Log4J, SL4J etc Disclaimer: I know nothing about Configgy! Cheers, Tim On 09/06/2009 17:34, Jonas Bonér jbo...@gmail.com wrote: I am only depending on Lift through the Lift logger (switched from Configgy, which I actually like better). I am only depending on ScalaJPA through one single 'with ScalaEntityManager'. I could move it. What do the rest of you guys think? 2009/6/9 Derek Chen-Becker dchenbec...@gmail.com: Awesome! I'll take a look at the code. If you're basing this on ScalaJPA, would it be preferable to add the functionality there, or is there anything Lift-specific? Derek On Tue, Jun 9, 2009 at 7:18 AM, Jonas Bonér jbo...@gmail.com wrote: Hey guys. I have hacked together an early draft of the JTA transaction stuff. I have wrapped it up in a monad. Here are some examples of usage: for { ctx - TransactionContext.Required entity - updatedEntities if !ctx.isRollbackOnly } { // transactional stuff ctx.getEntityManager.merge(entity) } val users = for { ctx - TransactionContext.Required name - userNames } yield { // transactional stuff val query = ctx.getEntityManager.createNamedQuery(findUserByName) query.setParameter(userName, name) query.getSingleResult } If you don't like the monadic approach you can just use the high-order functions: TransactionContext.withTxRequired { ... // REQUIRED semantics TransactionContext.withTxRequiresNew { ... // REQUIRES_NEW semantics } } I have implemented the same semantics as used in the EJB spec. Required, RequiresNew, Mandatory, Supports, Never. All these are monadic objects in the TransactionContext object. I don't have a webapp to try this out, so I would be happy to get all kinds of feedback, but API wise and bug reports or fixes. This API is hooked into Derek's Scala-JPA stuff. I had my own impl of this but replaced it with Derek's work. Derek, please go through the integration to see if I have done it correctly, and where things code be improved. All committers, feel free to hack and change this code anyway you want. The code is in a branch (wip-jta-jonas), you can find it here: http://github.com/dpp/liftweb/tree/3783b9e2200cc57dd72baa1bd8cabdb1365ee923/ lift-jta Check the ScalaDoc (or the source) for the documentation on usage, semantics etc. Also see the README for configuration in persistence.xml etc. Currently it is hard-coded to use the Atomikos Transaction library and Hibernate JPA, that would have to be configurable + some other options as well. See the TODOs in the code. As I said, this needs feedback and testing. Thanks. -- Jonas Bonér twitter: @jboner blog: http://jonasboner.com work: http://crisp.se work: http://scalablesolutions.se code: http://github.com/jboner --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: JTA Transaction Monad - Early Access Program
Jonas, We always use Maven to load dependencies. We never use GPL dependencies. If you have a question about the license of a dependency and its use in Lift, please ping me privately. What does Configgy have that Lift's Props and Logger doesn't? I'm all for enhancing Lift to be as good as Configgy (and Robey didn't have the bandwidth to integrate Configgy into Lift, thus our own config management). Thanks, David On Tue, Jun 9, 2009 at 9:34 AM, Jonas Bonér jbo...@gmail.com wrote: I am only depending on Lift through the Lift logger (switched from Configgy, which I actually like better). I am only depending on ScalaJPA through one single 'with ScalaEntityManager'. I could move it. What do the rest of you guys think? 2009/6/9 Derek Chen-Becker dchenbec...@gmail.com: Awesome! I'll take a look at the code. If you're basing this on ScalaJPA, would it be preferable to add the functionality there, or is there anything Lift-specific? Derek On Tue, Jun 9, 2009 at 7:18 AM, Jonas Bonér jbo...@gmail.com wrote: Hey guys. I have hacked together an early draft of the JTA transaction stuff. I have wrapped it up in a monad. Here are some examples of usage: for { ctx - TransactionContext.Required entity - updatedEntities if !ctx.isRollbackOnly } { // transactional stuff ctx.getEntityManager.merge(entity) } val users = for { ctx - TransactionContext.Required name - userNames } yield { // transactional stuff val query = ctx.getEntityManager.createNamedQuery(findUserByName) query.setParameter(userName, name) query.getSingleResult } If you don't like the monadic approach you can just use the high-order functions: TransactionContext.withTxRequired { ... // REQUIRED semantics TransactionContext.withTxRequiresNew { ... // REQUIRES_NEW semantics } } I have implemented the same semantics as used in the EJB spec. Required, RequiresNew, Mandatory, Supports, Never. All these are monadic objects in the TransactionContext object. I don't have a webapp to try this out, so I would be happy to get all kinds of feedback, but API wise and bug reports or fixes. This API is hooked into Derek's Scala-JPA stuff. I had my own impl of this but replaced it with Derek's work. Derek, please go through the integration to see if I have done it correctly, and where things code be improved. All committers, feel free to hack and change this code anyway you want. The code is in a branch (wip-jta-jonas), you can find it here: http://github.com/dpp/liftweb/tree/3783b9e2200cc57dd72baa1bd8cabdb1365ee923/lift-jta Check the ScalaDoc (or the source) for the documentation on usage, semantics etc. Also see the README for configuration in persistence.xml etc. Currently it is hard-coded to use the Atomikos Transaction library and Hibernate JPA, that would have to be configurable + some other options as well. See the TODOs in the code. As I said, this needs feedback and testing. Thanks. -- Jonas Bonér twitter: @jboner blog:http://jonasboner.com work: http://crisp.se work: http://scalablesolutions.se code: http://github.com/jboner -- Jonas Bonér twitter: @jboner blog:http://jonasboner.com work: http://crisp.se work: http://scalablesolutions.se code: http://github.com/jboner -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: JTA Transaction Monad - Early Access Program
2009/6/9 David Pollak feeder.of.the.be...@gmail.com: Jonas, We always use Maven to load dependencies. We never use GPL dependencies. If you have a question about the license of a dependency and its use in Lift, please ping me privately. I am using Maven. But as I said I could not find the Atomikos in any public library, putting them in lib will let the user easily install them in their local repo. Do you know if they are in any public repo? Sorry about the license issues, didn't think about that. I can remove them all in any case, even though that would make it harder to use. What does Configgy have that Lift's Props and Logger doesn't? I'm all for enhancing Lift to be as good as Configgy (and Robey didn't have the bandwidth to integrate Configgy into Lift, thus our own config management). First I like the printf-style logging API, similar to slf4j. Nice to use plus better performance. Second I really like Configgys configuration API, plus that it is integrated with the logging. But this was just a comment from my side, I have no problem whatsoever to use Lift logger. /Jonas Thanks, David On Tue, Jun 9, 2009 at 9:34 AM, Jonas Bonér jbo...@gmail.com wrote: I am only depending on Lift through the Lift logger (switched from Configgy, which I actually like better). I am only depending on ScalaJPA through one single 'with ScalaEntityManager'. I could move it. What do the rest of you guys think? 2009/6/9 Derek Chen-Becker dchenbec...@gmail.com: Awesome! I'll take a look at the code. If you're basing this on ScalaJPA, would it be preferable to add the functionality there, or is there anything Lift-specific? Derek On Tue, Jun 9, 2009 at 7:18 AM, Jonas Bonér jbo...@gmail.com wrote: Hey guys. I have hacked together an early draft of the JTA transaction stuff. I have wrapped it up in a monad. Here are some examples of usage: for { ctx - TransactionContext.Required entity - updatedEntities if !ctx.isRollbackOnly } { // transactional stuff ctx.getEntityManager.merge(entity) } val users = for { ctx - TransactionContext.Required name - userNames } yield { // transactional stuff val query = ctx.getEntityManager.createNamedQuery(findUserByName) query.setParameter(userName, name) query.getSingleResult } If you don't like the monadic approach you can just use the high-order functions: TransactionContext.withTxRequired { ... // REQUIRED semantics TransactionContext.withTxRequiresNew { ... // REQUIRES_NEW semantics } } I have implemented the same semantics as used in the EJB spec. Required, RequiresNew, Mandatory, Supports, Never. All these are monadic objects in the TransactionContext object. I don't have a webapp to try this out, so I would be happy to get all kinds of feedback, but API wise and bug reports or fixes. This API is hooked into Derek's Scala-JPA stuff. I had my own impl of this but replaced it with Derek's work. Derek, please go through the integration to see if I have done it correctly, and where things code be improved. All committers, feel free to hack and change this code anyway you want. The code is in a branch (wip-jta-jonas), you can find it here: http://github.com/dpp/liftweb/tree/3783b9e2200cc57dd72baa1bd8cabdb1365ee923/lift-jta Check the ScalaDoc (or the source) for the documentation on usage, semantics etc. Also see the README for configuration in persistence.xml etc. Currently it is hard-coded to use the Atomikos Transaction library and Hibernate JPA, that would have to be configurable + some other options as well. See the TODOs in the code. As I said, this needs feedback and testing. Thanks. -- Jonas Bonér twitter: @jboner blog: http://jonasboner.com work: http://crisp.se work: http://scalablesolutions.se code: http://github.com/jboner -- Jonas Bonér twitter: @jboner blog: http://jonasboner.com work: http://crisp.se work: http://scalablesolutions.se code: http://github.com/jboner -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp -- Jonas Bonér twitter: @jboner blog:http://jonasboner.com work: http://crisp.se work: http://scalablesolutions.se code: http://github.com/jboner --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: JTA Transaction Monad - Early Access Program
On Tue, Jun 9, 2009 at 10:13 AM, Jonas Bonér jbo...@gmail.com wrote: 2009/6/9 David Pollak feeder.of.the.be...@gmail.com: Jonas, We always use Maven to load dependencies. We never use GPL dependencies. If you have a question about the license of a dependency and its use in Lift, please ping me privately. I am using Maven. But as I said I could not find the Atomikos in any public library, putting them in lib will let the user easily install them in their local repo. I understand why you did it and that you had the goal of making it easier for developers. Do you know if they are in any public repo? I don't... but if they are not in a public repo, we have two choices: hosting the JAR files on scala-tools.org (as long as the license allows us to do that) or finding an alternative that is hosted in a public repo. I'm dealing with similar issues right now with ZooKeeper. Sorry about the license issues, didn't think about that. I can remove them all in any case, even though that would make it harder to use. What does Configgy have that Lift's Props and Logger doesn't? I'm all for enhancing Lift to be as good as Configgy (and Robey didn't have the bandwidth to integrate Configgy into Lift, thus our own config management). First I like the printf-style logging API, similar to slf4j. Nice to use plus better performance. We can add that to Lift's logger (which can sit on top of slf4j) Also, note that all of Lift's logger parameters are call-by-name so there's no evaluation unless the log level is met. Second I really like Configgys configuration API, Can you tell me what you specifically like about it? Thanks, David plus that it is integrated with the logging. But this was just a comment from my side, I have no problem whatsoever to use Lift logger. /Jonas Thanks, David On Tue, Jun 9, 2009 at 9:34 AM, Jonas Bonér jbo...@gmail.com wrote: I am only depending on Lift through the Lift logger (switched from Configgy, which I actually like better). I am only depending on ScalaJPA through one single 'with ScalaEntityManager'. I could move it. What do the rest of you guys think? 2009/6/9 Derek Chen-Becker dchenbec...@gmail.com: Awesome! I'll take a look at the code. If you're basing this on ScalaJPA, would it be preferable to add the functionality there, or is there anything Lift-specific? Derek On Tue, Jun 9, 2009 at 7:18 AM, Jonas Bonér jbo...@gmail.com wrote: Hey guys. I have hacked together an early draft of the JTA transaction stuff. I have wrapped it up in a monad. Here are some examples of usage: for { ctx - TransactionContext.Required entity - updatedEntities if !ctx.isRollbackOnly } { // transactional stuff ctx.getEntityManager.merge(entity) } val users = for { ctx - TransactionContext.Required name - userNames } yield { // transactional stuff val query = ctx.getEntityManager.createNamedQuery(findUserByName) query.setParameter(userName, name) query.getSingleResult } If you don't like the monadic approach you can just use the high-order functions: TransactionContext.withTxRequired { ... // REQUIRED semantics TransactionContext.withTxRequiresNew { ... // REQUIRES_NEW semantics } } I have implemented the same semantics as used in the EJB spec. Required, RequiresNew, Mandatory, Supports, Never. All these are monadic objects in the TransactionContext object. I don't have a webapp to try this out, so I would be happy to get all kinds of feedback, but API wise and bug reports or fixes. This API is hooked into Derek's Scala-JPA stuff. I had my own impl of this but replaced it with Derek's work. Derek, please go through the integration to see if I have done it correctly, and where things code be improved. All committers, feel free to hack and change this code anyway you want. The code is in a branch (wip-jta-jonas), you can find it here: http://github.com/dpp/liftweb/tree/3783b9e2200cc57dd72baa1bd8cabdb1365ee923/lift-jta Check the ScalaDoc (or the source) for the documentation on usage, semantics etc. Also see the README for configuration in persistence.xml etc. Currently it is hard-coded to use the Atomikos Transaction library and Hibernate JPA, that would have to be configurable + some other options as well. See the TODOs in the code. As I said, this needs feedback and testing. Thanks. -- Jonas Bonér twitter: @jboner blog:http://jonasboner.com work: http://crisp.se work: http://scalablesolutions.se code: http://github.com/jboner -- Jonas Bonér twitter: @jboner blog:http://jonasboner.com work: http://crisp.se work: http://scalablesolutions.se code: http://github.com/jboner
[Lift] Re: JTA Transaction Monad - Early Access Program
First I like the printf-style logging API, similar to slf4j. Nice to use plus better performance. We can add that to Lift's logger (which can sit on top of slf4j) That would be great. Also, note that all of Lift's logger parameters are call-by-name so there's no evaluation unless the log level is met. Ok, I didn't know that. Great. That's the way to do it. -- Jonas Bonér twitter: @jboner blog:http://jonasboner.com work: http://crisp.se work: http://scalablesolutions.se code: http://github.com/jboner --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: JTA Transaction Monad - Early Access Program
Re configgy. I think it is a great balance between properties and xml, like pragmatic xml. Simple as properties but with nesting, hierarchies, type conversions, good override and defaults system (inheritance). It also has notification of changes and a JMX API for management (which I have not used yet). /Jonas 2009/6/9 Jonas Bonér jbo...@gmail.com: First I like the printf-style logging API, similar to slf4j. Nice to use plus better performance. We can add that to Lift's logger (which can sit on top of slf4j) That would be great. Also, note that all of Lift's logger parameters are call-by-name so there's no evaluation unless the log level is met. Ok, I didn't know that. Great. That's the way to do it. -- Jonas Bonér twitter: @jboner blog: http://jonasboner.com work: http://crisp.se work: http://scalablesolutions.se code: http://github.com/jboner -- Jonas Bonér twitter: @jboner blog:http://jonasboner.com work: http://crisp.se work: http://scalablesolutions.se code: http://github.com/jboner --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: JTA Transaction Monad - Early Access Program
Jonas, Awesome! i look forward to digging into this stuff! Best wishes, --greg On Tue, Jun 9, 2009 at 6:18 AM, Jonas Bonér jbo...@gmail.com wrote: Hey guys. I have hacked together an early draft of the JTA transaction stuff. I have wrapped it up in a monad. Here are some examples of usage: for { ctx - TransactionContext.Required entity - updatedEntities if !ctx.isRollbackOnly } { // transactional stuff ctx.getEntityManager.merge(entity) } val users = for { ctx - TransactionContext.Required name - userNames } yield { // transactional stuff val query = ctx.getEntityManager.createNamedQuery(findUserByName) query.setParameter(userName, name) query.getSingleResult } If you don't like the monadic approach you can just use the high-order functions: TransactionContext.withTxRequired { ... // REQUIRED semantics TransactionContext.withTxRequiresNew { ... // REQUIRES_NEW semantics } } I have implemented the same semantics as used in the EJB spec. Required, RequiresNew, Mandatory, Supports, Never. All these are monadic objects in the TransactionContext object. I don't have a webapp to try this out, so I would be happy to get all kinds of feedback, but API wise and bug reports or fixes. This API is hooked into Derek's Scala-JPA stuff. I had my own impl of this but replaced it with Derek's work. Derek, please go through the integration to see if I have done it correctly, and where things code be improved. All committers, feel free to hack and change this code anyway you want. The code is in a branch (wip-jta-jonas), you can find it here: http://github.com/dpp/liftweb/tree/3783b9e2200cc57dd72baa1bd8cabdb1365ee923/lift-jta Check the ScalaDoc (or the source) for the documentation on usage, semantics etc. Also see the README for configuration in persistence.xml etc. Currently it is hard-coded to use the Atomikos Transaction library and Hibernate JPA, that would have to be configurable + some other options as well. See the TODOs in the code. As I said, this needs feedback and testing. Thanks. -- Jonas Bonér twitter: @jboner blog:http://jonasboner.com work: http://crisp.se work: http://scalablesolutions.se code: http://github.com/jboner -- L.G. Meredith Managing Partner Biosimilarity LLC 1219 NW 83rd St Seattle, WA 98117 +1 206.650.3740 http://biosimilarity.blogspot.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: JTA Transaction Monad - Early Access Program
In my email above I have the link to the Maven artifacts for Atomikos: http://mvnrepository.com/artifact/com.atomikos I think that the dependency you want is: dependency groupIdcom.atomikos/groupId artifactIdtransactions-jta/artifactId version3.2.3/version /dependency Derek On Tue, Jun 9, 2009 at 12:54 PM, Meredith Gregory lgreg.mered...@gmail.comwrote: Jonas, Awesome! i look forward to digging into this stuff! Best wishes, --greg On Tue, Jun 9, 2009 at 6:18 AM, Jonas Bonér jbo...@gmail.com wrote: Hey guys. I have hacked together an early draft of the JTA transaction stuff. I have wrapped it up in a monad. Here are some examples of usage: for { ctx - TransactionContext.Required entity - updatedEntities if !ctx.isRollbackOnly } { // transactional stuff ctx.getEntityManager.merge(entity) } val users = for { ctx - TransactionContext.Required name - userNames } yield { // transactional stuff val query = ctx.getEntityManager.createNamedQuery(findUserByName) query.setParameter(userName, name) query.getSingleResult } If you don't like the monadic approach you can just use the high-order functions: TransactionContext.withTxRequired { ... // REQUIRED semantics TransactionContext.withTxRequiresNew { ... // REQUIRES_NEW semantics } } I have implemented the same semantics as used in the EJB spec. Required, RequiresNew, Mandatory, Supports, Never. All these are monadic objects in the TransactionContext object. I don't have a webapp to try this out, so I would be happy to get all kinds of feedback, but API wise and bug reports or fixes. This API is hooked into Derek's Scala-JPA stuff. I had my own impl of this but replaced it with Derek's work. Derek, please go through the integration to see if I have done it correctly, and where things code be improved. All committers, feel free to hack and change this code anyway you want. The code is in a branch (wip-jta-jonas), you can find it here: http://github.com/dpp/liftweb/tree/3783b9e2200cc57dd72baa1bd8cabdb1365ee923/lift-jta Check the ScalaDoc (or the source) for the documentation on usage, semantics etc. Also see the README for configuration in persistence.xml etc. Currently it is hard-coded to use the Atomikos Transaction library and Hibernate JPA, that would have to be configurable + some other options as well. See the TODOs in the code. As I said, this needs feedback and testing. Thanks. -- Jonas Bonér twitter: @jboner blog:http://jonasboner.com work: http://crisp.se work: http://scalablesolutions.se code: http://github.com/jboner -- L.G. Meredith Managing Partner Biosimilarity LLC 1219 NW 83rd St Seattle, WA 98117 +1 206.650.3740 http://biosimilarity.blogspot.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Great pictures from the Scala Lift Off
On 9 Jun 2009, at 17:21, Kevin Wright wrote: BTW, are you in need of someone to actually add a bit of content to that site? lsug.org is Aaron's site, and the code is: http://code.google.com/p/lsug-website/ -- I suspect it's very close to a default Lift Hello World site. I'd say it's something to just hack on for an evening, or something to chat about over a beer sometime. Richard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: JTA Transaction Monad - Early Access Program
Thanks Derek. I missed that. I will fix the pom.xml. 2009/6/9 Derek Chen-Becker dchenbec...@gmail.com: In my email above I have the link to the Maven artifacts for Atomikos: http://mvnrepository.com/artifact/com.atomikos I think that the dependency you want is: dependency groupIdcom.atomikos/groupId artifactIdtransactions-jta/artifactId version3.2.3/version /dependency Derek On Tue, Jun 9, 2009 at 12:54 PM, Meredith Gregory lgreg.mered...@gmail.com wrote: Jonas, Awesome! i look forward to digging into this stuff! Best wishes, --greg On Tue, Jun 9, 2009 at 6:18 AM, Jonas Bonér jbo...@gmail.com wrote: Hey guys. I have hacked together an early draft of the JTA transaction stuff. I have wrapped it up in a monad. Here are some examples of usage: for { ctx - TransactionContext.Required entity - updatedEntities if !ctx.isRollbackOnly } { // transactional stuff ctx.getEntityManager.merge(entity) } val users = for { ctx - TransactionContext.Required name - userNames } yield { // transactional stuff val query = ctx.getEntityManager.createNamedQuery(findUserByName) query.setParameter(userName, name) query.getSingleResult } If you don't like the monadic approach you can just use the high-order functions: TransactionContext.withTxRequired { ... // REQUIRED semantics TransactionContext.withTxRequiresNew { ... // REQUIRES_NEW semantics } } I have implemented the same semantics as used in the EJB spec. Required, RequiresNew, Mandatory, Supports, Never. All these are monadic objects in the TransactionContext object. I don't have a webapp to try this out, so I would be happy to get all kinds of feedback, but API wise and bug reports or fixes. This API is hooked into Derek's Scala-JPA stuff. I had my own impl of this but replaced it with Derek's work. Derek, please go through the integration to see if I have done it correctly, and where things code be improved. All committers, feel free to hack and change this code anyway you want. The code is in a branch (wip-jta-jonas), you can find it here: http://github.com/dpp/liftweb/tree/3783b9e2200cc57dd72baa1bd8cabdb1365ee923/lift-jta Check the ScalaDoc (or the source) for the documentation on usage, semantics etc. Also see the README for configuration in persistence.xml etc. Currently it is hard-coded to use the Atomikos Transaction library and Hibernate JPA, that would have to be configurable + some other options as well. See the TODOs in the code. As I said, this needs feedback and testing. Thanks. -- Jonas Bonér twitter: @jboner blog: http://jonasboner.com work: http://crisp.se work: http://scalablesolutions.se code: http://github.com/jboner -- L.G. Meredith Managing Partner Biosimilarity LLC 1219 NW 83rd St Seattle, WA 98117 +1 206.650.3740 http://biosimilarity.blogspot.com -- Jonas Bonér twitter: @jboner blog:http://jonasboner.com work: http://crisp.se work: http://scalablesolutions.se code: http://github.com/jboner --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: JTA Transaction Monad - Early Access Program
Thanks Greg. And thanks for the suggestion to see transactions as monadic. All feedback is more than welcome. /Jonas 2009/6/9 Meredith Gregory lgreg.mered...@gmail.com: Jonas, Awesome! i look forward to digging into this stuff! Best wishes, --greg On Tue, Jun 9, 2009 at 6:18 AM, Jonas Bonér jbo...@gmail.com wrote: Hey guys. I have hacked together an early draft of the JTA transaction stuff. I have wrapped it up in a monad. Here are some examples of usage: for { ctx - TransactionContext.Required entity - updatedEntities if !ctx.isRollbackOnly } { // transactional stuff ctx.getEntityManager.merge(entity) } val users = for { ctx - TransactionContext.Required name - userNames } yield { // transactional stuff val query = ctx.getEntityManager.createNamedQuery(findUserByName) query.setParameter(userName, name) query.getSingleResult } If you don't like the monadic approach you can just use the high-order functions: TransactionContext.withTxRequired { ... // REQUIRED semantics TransactionContext.withTxRequiresNew { ... // REQUIRES_NEW semantics } } I have implemented the same semantics as used in the EJB spec. Required, RequiresNew, Mandatory, Supports, Never. All these are monadic objects in the TransactionContext object. I don't have a webapp to try this out, so I would be happy to get all kinds of feedback, but API wise and bug reports or fixes. This API is hooked into Derek's Scala-JPA stuff. I had my own impl of this but replaced it with Derek's work. Derek, please go through the integration to see if I have done it correctly, and where things code be improved. All committers, feel free to hack and change this code anyway you want. The code is in a branch (wip-jta-jonas), you can find it here: http://github.com/dpp/liftweb/tree/3783b9e2200cc57dd72baa1bd8cabdb1365ee923/lift-jta Check the ScalaDoc (or the source) for the documentation on usage, semantics etc. Also see the README for configuration in persistence.xml etc. Currently it is hard-coded to use the Atomikos Transaction library and Hibernate JPA, that would have to be configurable + some other options as well. See the TODOs in the code. As I said, this needs feedback and testing. Thanks. -- Jonas Bonér twitter: @jboner blog: http://jonasboner.com work: http://crisp.se work: http://scalablesolutions.se code: http://github.com/jboner -- L.G. Meredith Managing Partner Biosimilarity LLC 1219 NW 83rd St Seattle, WA 98117 +1 206.650.3740 http://biosimilarity.blogspot.com -- Jonas Bonér twitter: @jboner blog:http://jonasboner.com work: http://crisp.se work: http://scalablesolutions.se code: http://github.com/jboner --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: JTA Transaction Monad - Early Access Program
Thanks Derek. Thanks for taking time to do a code review. I'll add that to the README. /Jonas 2009/6/9 Derek Chen-Becker dchenbec...@gmail.com: Jonas, the code looks great! I don't see any issues with how ScalaJPA is used. It's nice to see that this fits what you're doing well and I really like how this lets one use transactions without having to go with a full-blown JEE container. One thing that you might want to put into the README is a reminder that if you're going to be using JNDI along with an EntityManager then JTA is not only required, but should be handled automatically by the container. The only valid operation on a Container-managed EM (as pointed out by mrxtravis yesterday when he found a bug in ScalaJPA) is to set the TX as rollback-only. Derek On Tue, Jun 9, 2009 at 1:10 PM, Derek Chen-Becker dchenbec...@gmail.com wrote: In my email above I have the link to the Maven artifacts for Atomikos: http://mvnrepository.com/artifact/com.atomikos I think that the dependency you want is: dependency groupIdcom.atomikos/groupId artifactIdtransactions-jta/artifactId version3.2.3/version /dependency Derek On Tue, Jun 9, 2009 at 12:54 PM, Meredith Gregory lgreg.mered...@gmail.com wrote: Jonas, Awesome! i look forward to digging into this stuff! Best wishes, --greg On Tue, Jun 9, 2009 at 6:18 AM, Jonas Bonér jbo...@gmail.com wrote: Hey guys. I have hacked together an early draft of the JTA transaction stuff. I have wrapped it up in a monad. Here are some examples of usage: for { ctx - TransactionContext.Required entity - updatedEntities if !ctx.isRollbackOnly } { // transactional stuff ctx.getEntityManager.merge(entity) } val users = for { ctx - TransactionContext.Required name - userNames } yield { // transactional stuff val query = ctx.getEntityManager.createNamedQuery(findUserByName) query.setParameter(userName, name) query.getSingleResult } If you don't like the monadic approach you can just use the high-order functions: TransactionContext.withTxRequired { ... // REQUIRED semantics TransactionContext.withTxRequiresNew { ... // REQUIRES_NEW semantics } } I have implemented the same semantics as used in the EJB spec. Required, RequiresNew, Mandatory, Supports, Never. All these are monadic objects in the TransactionContext object. I don't have a webapp to try this out, so I would be happy to get all kinds of feedback, but API wise and bug reports or fixes. This API is hooked into Derek's Scala-JPA stuff. I had my own impl of this but replaced it with Derek's work. Derek, please go through the integration to see if I have done it correctly, and where things code be improved. All committers, feel free to hack and change this code anyway you want. The code is in a branch (wip-jta-jonas), you can find it here: http://github.com/dpp/liftweb/tree/3783b9e2200cc57dd72baa1bd8cabdb1365ee923/lift-jta Check the ScalaDoc (or the source) for the documentation on usage, semantics etc. Also see the README for configuration in persistence.xml etc. Currently it is hard-coded to use the Atomikos Transaction library and Hibernate JPA, that would have to be configurable + some other options as well. See the TODOs in the code. As I said, this needs feedback and testing. Thanks. -- Jonas Bonér twitter: @jboner blog: http://jonasboner.com work: http://crisp.se work: http://scalablesolutions.se code: http://github.com/jboner -- L.G. Meredith Managing Partner Biosimilarity LLC 1219 NW 83rd St Seattle, WA 98117 +1 206.650.3740 http://biosimilarity.blogspot.com -- Jonas Bonér twitter: @jboner blog:http://jonasboner.com work: http://crisp.se work: http://scalablesolutions.se code: http://github.com/jboner --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: JTA Transaction Monad - Early Access Program
Now I have deleted the lib dir with all jars and fixed the POM. 2009/6/9 Derek Chen-Becker dchenbec...@gmail.com: In my email above I have the link to the Maven artifacts for Atomikos: http://mvnrepository.com/artifact/com.atomikos I think that the dependency you want is: dependency groupIdcom.atomikos/groupId artifactIdtransactions-jta/artifactId version3.2.3/version /dependency Derek On Tue, Jun 9, 2009 at 12:54 PM, Meredith Gregory lgreg.mered...@gmail.com wrote: Jonas, Awesome! i look forward to digging into this stuff! Best wishes, --greg On Tue, Jun 9, 2009 at 6:18 AM, Jonas Bonér jbo...@gmail.com wrote: Hey guys. I have hacked together an early draft of the JTA transaction stuff. I have wrapped it up in a monad. Here are some examples of usage: for { ctx - TransactionContext.Required entity - updatedEntities if !ctx.isRollbackOnly } { // transactional stuff ctx.getEntityManager.merge(entity) } val users = for { ctx - TransactionContext.Required name - userNames } yield { // transactional stuff val query = ctx.getEntityManager.createNamedQuery(findUserByName) query.setParameter(userName, name) query.getSingleResult } If you don't like the monadic approach you can just use the high-order functions: TransactionContext.withTxRequired { ... // REQUIRED semantics TransactionContext.withTxRequiresNew { ... // REQUIRES_NEW semantics } } I have implemented the same semantics as used in the EJB spec. Required, RequiresNew, Mandatory, Supports, Never. All these are monadic objects in the TransactionContext object. I don't have a webapp to try this out, so I would be happy to get all kinds of feedback, but API wise and bug reports or fixes. This API is hooked into Derek's Scala-JPA stuff. I had my own impl of this but replaced it with Derek's work. Derek, please go through the integration to see if I have done it correctly, and where things code be improved. All committers, feel free to hack and change this code anyway you want. The code is in a branch (wip-jta-jonas), you can find it here: http://github.com/dpp/liftweb/tree/3783b9e2200cc57dd72baa1bd8cabdb1365ee923/lift-jta Check the ScalaDoc (or the source) for the documentation on usage, semantics etc. Also see the README for configuration in persistence.xml etc. Currently it is hard-coded to use the Atomikos Transaction library and Hibernate JPA, that would have to be configurable + some other options as well. See the TODOs in the code. As I said, this needs feedback and testing. Thanks. -- Jonas Bonér twitter: @jboner blog: http://jonasboner.com work: http://crisp.se work: http://scalablesolutions.se code: http://github.com/jboner -- L.G. Meredith Managing Partner Biosimilarity LLC 1219 NW 83rd St Seattle, WA 98117 +1 206.650.3740 http://biosimilarity.blogspot.com -- Jonas Bonér twitter: @jboner blog:http://jonasboner.com work: http://crisp.se work: http://scalablesolutions.se code: http://github.com/jboner --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
Re: [scala] Re: [Lift] Programming in Scala #5, Lift Book #8, Beginning Scala #9
Since the topic seems to have morphed into learning Scala and Lift by immersion in a day, as a recent Scala convert, I can't begin to emphasize how important it is to have the build infrastructure all done in a simple way to let novices focus on Scala. Lift is a good example where you have no choice and just follow magic Maven incantations. Another is Processing in Scala, where you can just do small sketches. If the assumption is that it is the Java crowd which comes to JVM mostly, it doesn't bootstrap non-JVM folks like those coming from Ruby and Haskell/OCaml. So I'm glad David covers the build systems in his book; there should really be an easier way to begin without making choices between Maven, SBT, Buildr, Ant, etc.! Nothing more complex than a good old command line and a Makefile in the same directory... Ideally SBT becomes a part of Scala and you'll have a --make option, or something like that. Cheers, Alexy --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: JTA Transaction Monad - Early Access Program
On Tue, Jun 9, 2009 at 1:08 PM, Jonas Bonér jbo...@gmail.com wrote: Now I have deleted the lib dir with all jars and fixed the POM. Thanks! 2009/6/9 Derek Chen-Becker dchenbec...@gmail.com: In my email above I have the link to the Maven artifacts for Atomikos: http://mvnrepository.com/artifact/com.atomikos I think that the dependency you want is: dependency groupIdcom.atomikos/groupId artifactIdtransactions-jta/artifactId version3.2.3/version /dependency Derek On Tue, Jun 9, 2009 at 12:54 PM, Meredith Gregory lgreg.mered...@gmail.com wrote: Jonas, Awesome! i look forward to digging into this stuff! Best wishes, --greg On Tue, Jun 9, 2009 at 6:18 AM, Jonas Bonér jbo...@gmail.com wrote: Hey guys. I have hacked together an early draft of the JTA transaction stuff. I have wrapped it up in a monad. Here are some examples of usage: for { ctx - TransactionContext.Required entity - updatedEntities if !ctx.isRollbackOnly } { // transactional stuff ctx.getEntityManager.merge(entity) } val users = for { ctx - TransactionContext.Required name - userNames } yield { // transactional stuff val query = ctx.getEntityManager.createNamedQuery(findUserByName) query.setParameter(userName, name) query.getSingleResult } If you don't like the monadic approach you can just use the high-order functions: TransactionContext.withTxRequired { ... // REQUIRED semantics TransactionContext.withTxRequiresNew { ... // REQUIRES_NEW semantics } } I have implemented the same semantics as used in the EJB spec. Required, RequiresNew, Mandatory, Supports, Never. All these are monadic objects in the TransactionContext object. I don't have a webapp to try this out, so I would be happy to get all kinds of feedback, but API wise and bug reports or fixes. This API is hooked into Derek's Scala-JPA stuff. I had my own impl of this but replaced it with Derek's work. Derek, please go through the integration to see if I have done it correctly, and where things code be improved. All committers, feel free to hack and change this code anyway you want. The code is in a branch (wip-jta-jonas), you can find it here: http://github.com/dpp/liftweb/tree/3783b9e2200cc57dd72baa1bd8cabdb1365ee923/lift-jta Check the ScalaDoc (or the source) for the documentation on usage, semantics etc. Also see the README for configuration in persistence.xml etc. Currently it is hard-coded to use the Atomikos Transaction library and Hibernate JPA, that would have to be configurable + some other options as well. See the TODOs in the code. As I said, this needs feedback and testing. Thanks. -- Jonas Bonér twitter: @jboner blog:http://jonasboner.com work: http://crisp.se work: http://scalablesolutions.se code: http://github.com/jboner -- L.G. Meredith Managing Partner Biosimilarity LLC 1219 NW 83rd St Seattle, WA 98117 +1 206.650.3740 http://biosimilarity.blogspot.com -- Jonas Bonér twitter: @jboner blog:http://jonasboner.com work: http://crisp.se work: http://scalablesolutions.se code: http://github.com/jboner -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: fall-through redirect
Joe, See the enclosed code. The menu last menu item (see Boot.scala) is a fall through menu item that will intercept any request. The code is not as concise as Rails, but it's a corner case. Hope this helps. Thanks, David On Fri, Jun 5, 2009 at 10:37 AM, Joe Wass j...@folktunefinder.com wrote: I'm after re-writing, not a re-direct (although I'd compromise to a redirect if re-writing isn't possible). In Rails I seem to recall it wasn't re-writing but binding after all other attempts to bind had failed. For comparison, here's the Rails version: [rails routes.rb] # normal mappings etc map.connect '/search', :controller = 'view', :action = 'search' ... # fallback find member after everything else has failed map.connect /:tag, :controller = view, :action = member [/rails] which would bind the portion after the slash to 'tag' Sorry to drag another framework into it, but I think it's the best way to explain. Joe On Jun 5, 3:13 pm, David Pollak feeder.of.the.be...@gmail.com wrote: Joe, Do you want a redirect (HTTP 304) or do you want the URL rewritten so that Lift sees site.com/user/member, but the browser still thinks in sent site.com/member ? Thanks, David On Fri, Jun 5, 2009 at 1:47 AM, Joe Wass j...@folktunefinder.com wrote: Hello everyone, I want to be able to handle requests that don't fall within the sitemap. I have a site with members, and, providing that a user id doesn't conflict with any part of a sitemap path, I want site.com/ member to redirect to site.com/user/member. I've done this kind with Rails, but the Lift model doesn't quite seem to match Rails so I'm a little unsure about how to go about doing it... suggestions? TIA! Joe -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~--- menu.tgz Description: GNU Zip compressed data
Re: [scala] Re: [Lift] Programming in Scala #5, Lift Book #8, Beginning Scala #9
I must say, I have not met a build system (besides automake) that exceeded make in complexity. The amount of funny exceptions to rules is astounding. I had far less trouble learning maven (in all its complexity) Sent from my iPhone On Jun 9, 2009, at 4:56 PM, Alexy Khrabrov delivera...@gmail.com wrote: Since the topic seems to have morphed into learning Scala and Lift by immersion in a day, as a recent Scala convert, I can't begin to emphasize how important it is to have the build infrastructure all done in a simple way to let novices focus on Scala. Lift is a good example where you have no choice and just follow magic Maven incantations. Another is Processing in Scala, where you can just do small sketches. If the assumption is that it is the Java crowd which comes to JVM mostly, it doesn't bootstrap non-JVM folks like those coming from Ruby and Haskell/OCaml. So I'm glad David covers the build systems in his book; there should really be an easier way to begin without making choices between Maven, SBT, Buildr, Ant, etc.! Nothing more complex than a good old command line and a Makefile in the same directory... Ideally SBT becomes a part of Scala and you'll have a --make option, or something like that. Cheers, Alexy --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---