Re: Tapestry-hibernate module seemingly leaking connections

2024-06-13 Thread Christopher Dodunski (Tapestry)
Hi Ben, Your "educated guess" proved to be entirely correct! I added the below method to my RegistryProxy class, and calling it from the @OnMessage annotated method of the WebSocket server endpoint ensures Hibernate sessions get closed on completion and associated DB connections are released

Re: Tapestry-hibernate module seemingly leaking connections

2024-06-11 Thread Ben Weidig
Hi Chris, the RegistryProxy should work, we use something similar for a script editor component with access to the Registry. We don't use WebSockets, though, so the normal lifecycle applies. With WebSockets, however, someone has to handle it manually. Beware, I don't have any experience with Tape

Re: Tapestry-hibernate module seemingly leaking connections

2024-06-11 Thread Christopher Dodunski (Tapestry)
Hi Ben, Thank you for those helpful suggestions! You're right... debugging is tricky given the large number of moving parts. 😊 I've made some progress since last writing. By activating "hibernate.c3p0.debugUnreturnedConnectionStackTraces" within my Hibernate configuration I've been able to

Re: Tapestry-hibernate module seemingly leaking connections

2024-06-09 Thread Ben Weidig
Hi Chris, debugging Hibernate connection problems is no fun at all... You're correct that org.apache.tapestry5.hibernate.HibernateSessionManager is thread-scoped and is supposed to clean up after itself by rolling back any uncommitted transaction and closing the session. Hibernate/Connection iss

Re: tapestry-hibernate + tapestry-cdi

2016-09-23 Thread Adam X
Problem solved. Just to give back to the community here is how I solved it and what I've learned. First, it looks like when using tapestry-cdi in the project, tapestry-hibernate becomes completely unnecessary. In fact, it cannot and should not be used. In general, with JSR-330 (tapestry even imple

Re: tapestry-hibernate + tapestry-cdi

2016-09-23 Thread Qbyte Consulting
Ive been using tapestry jpa on an application that accesses 3 databases, 1 Postgres and 2 mssql. It's just fine. Surprised tapestry hibernate doesn't support this. Sent from my iPhone > On 23 Sep 2016, at 09:36, Adam X wrote: > > Yes, JPA should an option. I don't think foo uses a single hibe

Re: tapestry-hibernate + tapestry-cdi

2016-09-23 Thread Adam X
Yes, JPA should an option. I don't think foo uses a single hibernate annotation and our foo team often brags how they code to the spec :) So I will try tapestry-jpa (didn't even know about it). If that doesn't solve the problem I will try implementing @Session. I may come back with this if I stil

Re: tapestry-hibernate + tapestry-cdi

2016-09-23 Thread Kalle Korhonen
AFAIK, tapestry-hibernate simply doesn't support it. However, is switching to JPA an option? You could still be using Hibernate as the provider. tapestry-jpa merrily supports multi tenancy (and more). If JPA is not an option, I'd look into implementing your own custom @Session - may not be too bad

Re: tapestry-hibernate + tapestry-cdi

2016-09-23 Thread Adam X
Yep, like I said, that part is easy and I believe I can get that resolved. My question is how to tell Tapestry that @Inject Session is done by foo+tapestry-cdi and it should use @Inject @Named Session instead? On Fri, Sep 23, 2016 at 10:13 AM, Qbyte Consulting wrote: > What about exclude tapestri

Re: tapestry-hibernate + tapestry-cdi

2016-09-23 Thread Qbyte Consulting
What about exclude tapestries default hibernate dependency with Maven exclude? Sent from my iPhone > On 23 Sep 2016, at 09:05, Adam X wrote: > > Hi, > > I have what seems like a major collision problem and don't know how to > solve this. My current architecture is as following: > > foo > weld

Re: tapestry-hibernate session.save not working in service

2014-11-21 Thread George Christman
On Fri, Nov 21, 2014 at 9:54 AM, Thiago H de Paula Figueiredo < thiag...@gmail.com> wrote: > On Fri, 21 Nov 2014 12:50:11 -0200, George Christman < > gchrist...@cardaddy.com> wrote: > > I tried those Lance with the exception of @CommitAfter do to the fact I >> thought that @CommitAfter needed to

Re: tapestry-hibernate session.save not working in service

2014-11-21 Thread Thiago H de Paula Figueiredo
On Fri, 21 Nov 2014 12:50:11 -0200, George Christman wrote: I tried those Lance with the exception of @CommitAfter do to the fact I thought that @CommitAfter needed to be used in the interface. Before the latest 5.4 betas yes, but not anymore. I even went as far as passing the save off to

Re: tapestry-hibernate session.save not working in service

2014-11-21 Thread George Christman
I tried those Lance with the exception of @CommitAfter do to the fact I thought that @CommitAfter needed to be used in the interface. I even went as far as passing the save off to my DAO that has been configured to use HibernateTransactionAdvisor. I thought for sure this would resolve the issue, bu

Re: tapestry-hibernate session.save not working in service

2014-11-21 Thread Thiago H de Paula Figueiredo
@CommitAfter will only work on service methods if you applied the HibernateTransactionAdvisor or HibernateTransactionDecorator to the service. On Fri, 21 Nov 2014 06:47:43 -0200, Lance Java wrote: I'm guessing you need to commit a transaction. Either: HibernateSessionManager.commit()

Re: tapestry-hibernate session.save not working in service

2014-11-21 Thread Lance Java
I'm guessing you need to commit a transaction. Either: HibernateSessionManager.commit() Or: Session.getTransaction().commit() Or: @CommitAfter

Re: Tapestry-Hibernate unable to convert to client value

2014-11-13 Thread George Christman
Nah it was on my local machine. Strangly the page loads without issue too. On Thursday, November 13, 2014, Lance Java wrote: > Is 115185 an id that used to exist in the database? Perhaps it's a bot > that's hitting an old id that was deleted? > > Or maybe a bot trying to just hit a random id? >

Re: Tapestry-Hibernate unable to convert to client value

2014-11-13 Thread Lance Java
Is 115185 an id that used to exist in the database? Perhaps it's a bot that's hitting an old id that was deleted? Or maybe a bot trying to just hit a random id? On 13 Nov 2014 20:44, "George Christman" wrote: > Hi guys, I'm seeing this error in my logs, but everything appears to be > working fi

Re: Tapestry-hibernate / hibernate-search java.lang.Object is not an indexed entity or a subclass of an indexed entity

2014-02-12 Thread George Christman
Thanks Thiago, I'll run it by the hibernate-search team next. On Wed, Feb 12, 2014 at 12:59 PM, Thiago H de Paula Figueiredo < thiag...@gmail.com> wrote: > I'd check the Hibernate Search part. The stack trace doesn't look like a > Tapestry issue to me. > > > On Wed, 12 Feb 2014 15:02:32 -0200, G

Re: Tapestry-hibernate / hibernate-search java.lang.Object is not an indexed entity or a subclass of an indexed entity

2014-02-12 Thread Thiago H de Paula Figueiredo
I'd check the Hibernate Search part. The stack trace doesn't look like a Tapestry issue to me. On Wed, 12 Feb 2014 15:02:32 -0200, George Christman wrote: Hi Guys, I'm seeing the following exception in my logs when I try to start my app. It appears to be random and only during startup.

Re: tapestry-hibernate upgrade version?

2014-02-04 Thread Thiago H de Paula Figueiredo
JIRA ticket please! On Tue, 04 Feb 2014 19:17:49 -0200, George Christman wrote: Thanks Lance. On Tue, Feb 4, 2014 at 3:22 PM, Lance Java wrote: > If I upgraded it in my pom, would this cause issues else where? Not making any guarantees but it shouldn't be a problem (unless the hiber

Re: tapestry-hibernate upgrade version?

2014-02-04 Thread George Christman
Thanks Lance. On Tue, Feb 4, 2014 at 3:22 PM, Lance Java wrote: > > If I upgraded it in my pom, would this cause issues else where? > > Not making any guarantees but it shouldn't be a problem (unless the > hibernate api has changed, which I doubt) > -- George Christman www.CarDaddy.com P.O.

Re: tapestry-hibernate upgrade version?

2014-02-04 Thread Lance Java
> If I upgraded it in my pom, would this cause issues else where? Not making any guarantees but it shouldn't be a problem (unless the hibernate api has changed, which I doubt)

Re: Tapestry Hibernate

2013-11-11 Thread Boris Horvat
Removed a few transitive dependencies and got it to work. YEY :) Now I need to figure out why my jquery wont work out of the box (probably conflict) TypeError: Property '$' of object [object Object] is not a function On Mon, Nov 11, 2013 at 12:26 PM, Boris Horvat wrote: > When jetty runs this

Re: Tapestry Hibernate

2013-11-11 Thread Boris Horvat
When jetty runs this is the output Configuring Jetty for project: flow blackbox webAppSourceDirectory not set. Defaulting to C:\Users\borish\Documents\NetBeansProjects\flow\src\main\webapp Reload Mechanic: automatic Classes = C:\Users\borish\Documents\NetBeansProjects\flow\target\classes Context p

Re: Tapestry-Hibernate using sessions inside of scheduler or threads.

2013-11-01 Thread George Christman
Thanks dmitry, I was a little misguided on SO, resulting in this question, but it looks as if the issue had to do with me not closing my session after the thread completed. I've been spoiled with tapestry-hibernate doing that for me on non threaded transactions :) Anyhow Lance also pointed out I ne

Re: Tapestry-Hibernate using sessions inside of scheduler or threads.

2013-11-01 Thread Dmitry Gusev
Creating new connections per thread/request is the right way. But you should close your sessions when your thread/request completed. Just make sure that you have enough connections in your connection pool (i.e. pool size >= threads/requests count), and things will work fine. On Fri, Nov 1, 2013 a

Re: Tapestry + Hibernate + Testing

2013-10-20 Thread Boris Horvat
It seems that the problem is that I needed to have both annotations import org.testng.annotations.BeforeMethod; import org.testng.annotations.BeforeTest; not sure why. but I will try to read the documentation cheers On Sun, Oct 20, 2013 at 11:10 AM, Boris Horvat wrote: > Hi everyone, > > Lanc

Re: Tapestry + Hibernate + Testing

2013-10-20 Thread Boris Horvat
Hi everyone, Lance I have a question for you (though anyone can answer it). You suggested to use something like http://stackoverflow.com/questions/15664815/how-to-test-dao-layer-in-tapestry-dependent-projects/15671034#15671034 I was expecting that my db will be rebuild before every test? Is this

Re: Tapestry + Hibernate + Testing

2013-09-27 Thread Martin Kersten
I always start simple first and most simply is without tapestry. When you deal with 3 or 4 services at once you feel the need to go for IOC. Then you want to test a single page and thats when you use tapestry-test and then you go for full scale testing and you find yourself using htmlunit or seleni

Re: Tapestry + Hibernate + Testing

2013-09-26 Thread Boris Horvat
I guess for now I will proceed with using code that is not tapestry related inside my test classes though that is likely to change in the future. Thanks for you suggestions I will keep them in my head when the time for them arises :) Cheers On Thu, Sep 26, 2013 at 9:40 AM, Lance Java wrote: >

Re: Tapestry + Hibernate + Testing

2013-09-26 Thread Lance Java
HibernateEntityPackageManager only has one method which gets the list of hibernate entity package names. You might find it more lightweight to create mock this rather than including HibernateModule. On 26 Sep 2013 01:30, "Thiago H de Paula Figueiredo" wrote: > On Wed, 25 Sep 2013 20:01:14 -0300,

Re: Tapestry + Hibernate + Testing

2013-09-25 Thread Thiago H de Paula Figueiredo
On Wed, 25 Sep 2013 20:01:14 -0300, Boris Horvat wrote: Is there a list like the default services that should be added. For example if I add my configuration of the hibernate it complains HibernateEntityPackageManager doesn't exist In this case, you need the HibernateModule added to the r

Re: Tapestry + Hibernate + Testing

2013-09-25 Thread Boris Horvat
Ah sorry for spam this is the last one for the day. Is there a list like the default services that should be added. For example if I add my configuration of the hibernate it complains HibernateEntityPackageManager doesn't exist On Thu, Sep 26, 2013 at 12:56 AM, Boris Horvat wrote: > ah I think

Re: Tapestry + Hibernate + Testing

2013-09-25 Thread Boris Horvat
ah I think I see RegistryBuilder b = new RegistryBuilder(); b.add(HibernateModule.class); Registry r = b.build(); r.getService(MyService.class); that makes sense Cheers On Thu, Sep 26, 2013 at 12:55 AM, Boris Horvat wrote: > Thanks for the detail replay it helps

Re: Tapestry + Hibernate + Testing

2013-09-25 Thread Boris Horvat
Thanks for the detail replay it helps me to figure out the best way to organise everything. btw once you have everything registered how do you get a service? cheers On Thu, Sep 26, 2013 at 12:38 AM, Martin Kersten < martin.kersten...@gmail.com> wrote: > Hi Boris, > >I just use a registery

Re: Tapestry + Hibernate + Testing

2013-09-25 Thread Martin Kersten
Hi Boris, I just use a registery builder and add the sub modules I need to test (as already mentioned). Often I use public TestModule static classes that reside into the TestCase class. Then I just use those TestModule classes to build the registry. They contain often only the services needed u

Re: Tapestry + Hibernate + Testing

2013-09-25 Thread Boris Horvat
btw PackageNameHibernateConfigurer uses AnnotationConfiguration that has been deprecated any plans to change this class? On Wed, Sep 25, 2013 at 11:36 PM, Boris Horvat wrote: > I use Submodule but I guess for the tests I need RegistryBuilder. Will try > that > > Thanks > > > On Wed, Sep 25, 2013

Re: Tapestry + Hibernate + Testing

2013-09-25 Thread Boris Horvat
I use Submodule but I guess for the tests I need RegistryBuilder. Will try that Thanks On Wed, Sep 25, 2013 at 10:55 PM, Thiago H de Paula Figueiredo < thiag...@gmail.com> wrote: > On Wed, 25 Sep 2013 17:17:22 -0300, Boris Horvat > wrote: > > My config is already split in that way. But I cant

Re: Tapestry + Hibernate + Testing

2013-09-25 Thread Thiago H de Paula Figueiredo
On Wed, 25 Sep 2013 17:17:22 -0300, Boris Horvat wrote: My config is already split in that way. But I cant find a code that I can check to see how to load DAOModule :( @Submodule({DAOModule.class}) in another modules that is already loaded or RegistryBuilder.add(DDAOModule.class) or addin

Re: Tapestry + Hibernate + Testing

2013-09-25 Thread Boris Horvat
My config is already split in that way. But I cant find a code that I can check to see how to load DAOModule :( Any hints? :) On Wed, Sep 25, 2013 at 11:08 AM, Lance Java wrote: > > Is it possible somehow to automate this? > > Have you read Howard's answer on the Stack Overflow question? He sug

Re: Tapestry + Hibernate + Testing

2013-09-25 Thread Lance Java
> Is it possible somehow to automate this? Have you read Howard's answer on the Stack Overflow question? He suggests splitting your AppModules in such a way that you can load a DAOModule together with HibernateCoreModule for testing.

Re: Tapestry + Hibernate + Testing

2013-09-25 Thread Lance Java
It's in tapestry-hibernate-core https://git-wip-us.apache.org/repos/asf?p=tapestry-5.git;a=blob;f=tapestry-hibernate-core/src/main/java/org/apache/tapestry5/internal/hibernate/PackageNameHibernateConfigurer.java

Re: Tapestry + Hibernate + Testing

2013-09-24 Thread Boris Horvat
Hi Lance, Can you please share PackageNameHibernateConfigurer assuming that it is open source code (and that it is your code)? Thanks On Sun, Sep 22, 2013 at 10:43 PM, Boris Horvat wrote: > Well ideally I would like to avoid setting up the abstract class but at > lest I have a starting point t

Re: Tapestry + Hibernate + Testing

2013-09-22 Thread Boris Horvat
Well ideally I would like to avoid setting up the abstract class but at lest I have a starting point that I believe I can make it to work. I do have one more question though. Is it possible somehow to automate this? I have my business class that recieves hibernate classes vie a constructor and eac

Re: Tapestry + Hibernate + Testing

2013-09-22 Thread Lance Java
I do this http://stackoverflow.com/questions/15664815/how-to-test-dao-layer-in-tapestry-dependent-projects/15671034#15671034 On 22 September 2013 19:16, Boris Horvat wrote: > Hi all, > > How does one make a proper testing of the business layer in tapestry that I > inject into the page as a serv

Re: Tapestry Hibernate Session usage

2013-05-14 Thread Boris Horvat
Well thanks for help this makes my understating of the tapestry hibernate a lot better :) Cheers On Tue, May 14, 2013 at 4:38 PM, Lance Java wrote: > Questions about the 'magic' hibernate session proxy seem to crop up a bit > so I've raised a Jira to improve the docs. > > https://issues.apache.

Re: Tapestry Hibernate Session usage

2013-05-14 Thread Lance Java
Questions about the 'magic' hibernate session proxy seem to crop up a bit so I've raised a Jira to improve the docs. https://issues.apache.org/jira/browse/TAP5-2115

Re: Tapestry Hibernate Session usage

2013-05-13 Thread Dmitry Gusev
On Tue, May 14, 2013 at 12:05 AM, Boris Horvat wrote: > Hi Dmitry > > Please ignore the naming as I haven't really user he real names here as > this is just an example (the project also has nothing to do with Students > but it is easier for the explanations :) ). In all fairness though I do > pref

Re: Tapestry Hibernate Session usage

2013-05-13 Thread Boris Horvat
Hi Dmitry Please ignore the naming as I haven't really user he real names here as this is just an example (the project also has nothing to do with Students but it is easier for the explanations :) ). In all fairness though I do prefer to append DAOService in front as it allows me to search for the

Re: Tapestry Hibernate Session usage

2013-05-13 Thread Dmitry Gusev
On Mon, May 13, 2013 at 2:59 AM, Boris Horvat wrote: > Hi all, > > Hi! > I have a question about what should be the best way to use hibernate > session in tapestry. > > My environment consists of 2 layers (relevant to this). > > The first one would be a group of classes that represent an access

Re: Tapestry-Hibernate configure to work with both Tomcat and Jetty

2013-05-01 Thread Dmitry Gusev
On Wed, May 1, 2013 at 12:03 AM, George Christman wrote: > I'm still not having any success :-/ I've followed all your instructions > plus attempted in both Tomcat6 and 7. > > I just want to verify this is the correct spot for resource-ref and that > it's written correctly. > > That is correct.

Re: Tapestry-Hibernate configure to work with both Tomcat and Jetty

2013-04-30 Thread George Christman
I'm still not having any success :-/ I've followed all your instructions plus attempted in both Tomcat6 and 7. I just want to verify this is the correct spot for resource-ref and that it's written correctly. http://java.sun.com/dtd/web-app_2_3.dtd";> rolemanager Tapestry 5 Application

Re: Tapestry-Hibernate configure to work with both Tomcat and Jetty

2013-04-30 Thread Dmitry Gusev
I don't have anything related to this datasource in TOMCAT_HOME/conf/context.xml nor in TOMCAT_HOME/conf/server.xml Note that context file name will be ROOT.xml only if you deploy to root context, that is your application url will be http://localhost:8080/ If you deploy to custom context, then co

Re: Tapestry-Hibernate configure to work with both Tomcat and Jetty

2013-04-30 Thread George Christman
Well I thought I was using ROOT.xml, but it was overwritten during deployment. "I created the file manually on the server", I guess the question is where should I be creating ROOT.xml? should this be done in app? After manually creating it, I still have the same error. What I had after manually cr

Re: Tapestry-Hibernate configure to work with both Tomcat and Jetty

2013-04-30 Thread Dmitry Gusev
I don't use tapestry-hibernate, I use tapestry-jpa with Hibernate as JPA implementation. persistence.xml -- is a JPA specific file, I don't think you need it for tapestry-hibernate. Looking at your exception: > javax.naming.NameNotFoundException: Name [jdbc/rolemanager] is not bound in this Conte

Re: Tapestry-Hibernate configure to work with both Tomcat and Jetty

2013-04-30 Thread George Christman
Thanks Dmitry, it sounds like we are at the tail end of this issue. :) My only question left is in regards to your persistence.xml file. I use tapestry-hibernate, however I do not have a persistence.xml file present in my app. I'm not really sure what it's purpose is, but without it and changing my

Re: Tapestry-Hibernate configure to work with both Tomcat and Jetty

2013-04-29 Thread Dmitry Gusev
On Mon, Apr 29, 2013 at 11:33 PM, George Christman wrote: > So as it turns out, the issue was caused by tapestry-test adding an older > tomcat files to the class path. I'll need to somehow figure out how to > exclude them from the class path. > > > org.apache.tapestry >

Re: Tapestry-Hibernate configure to work with both Tomcat and Jetty

2013-04-29 Thread George Christman
So as it turns out, the issue was caused by tapestry-test adding an older tomcat files to the class path. I'll need to somehow figure out how to exclude them from the class path. org.apache.tapestry tapestry-test 5.3.6

Re: Tapestry-Hibernate configure to work with both Tomcat and Jetty

2013-04-29 Thread Lenny Primak
Netbeans runs just under plane maven, just like from the command line. There maybe stale files in WEB-INF/lib, but if you run mvn clean, they will be gone. maven directive is your friend here On Apr 29, 2013, at 2:38 PM, Dmitry Gusev wrote: > They will be present in classpath if you won't excl

Re: Tapestry-Hibernate configure to work with both Tomcat and Jetty

2013-04-29 Thread Dmitry Gusev
They will be present in classpath if you won't exclude them. I'm not familiar with Netbeans, but in Eclipse Sysdeo Plugin I have to manually remove them, so you should check your runtime classpath. You can also try to build a war and look at WEB-INF/lib folder to check if these files not there. O

Re: Tapestry-Hibernate configure to work with both Tomcat and Jetty

2013-04-29 Thread George Christman
I was wondering the same thing about those files, but as you said they shouldn't. On Mon, Apr 29, 2013 at 2:23 PM, George Christman wrote: > I run my project from Netbeans, locally with jetty, and deployed as a war. > > > On Mon, Apr 29, 2013 at 2:21 PM, Dmitry Gusev wrote: > >> How do you run y

Re: Tapestry-Hibernate configure to work with both Tomcat and Jetty

2013-04-29 Thread George Christman
I run my project from Netbeans, locally with jetty, and deployed as a war. On Mon, Apr 29, 2013 at 2:21 PM, Dmitry Gusev wrote: > How do you run your project? Is it from within eclipse? Or you're deploying > a *.war file? > > Could it be that these files getting into classpath? > > [INFO] +- org

Re: Tapestry-Hibernate configure to work with both Tomcat and Jetty

2013-04-29 Thread Dmitry Gusev
How do you run your project? Is it from within eclipse? Or you're deploying a *.war file? Could it be that these files getting into classpath? [INFO] +- org.apache.tapestry:tapestry-test:jar:5.3.6:compile ... [INFO] | +- org.apache.tomcat:dbcp:jar:6.0.30:compile [INFO] | +- org.apache.tomcat:co

Re: Tapestry-Hibernate configure to work with both Tomcat and Jetty

2013-04-29 Thread Michael Prescott
You could also (if you're using Eclipse) use Ctrl-Shift-T to see what jar(s) might be containing the org.apache.catalina.deploy.WebXml class (which seems to be the offending duplicate). On 29 April 2013 14:10, George Christman wrote: > Here's my mvn dependency tree, thanks for your help. > > [W

Re: Tapestry-Hibernate configure to work with both Tomcat and Jetty

2013-04-29 Thread Lenny Primak
Not sure (I don't use hibernate) but hibernate-jta and geronimo-jta stuff may conflict. On Apr 29, 2013, at 2:10 PM, George Christman wrote: > Here's my mvn dependency tree, thanks for your help. > > [WARNING] Failed to retrieve plugin descriptor for > org.codehaus.mojo:hibernate3- > maven-plugi

Re: Tapestry-Hibernate configure to work with both Tomcat and Jetty

2013-04-29 Thread George Christman
Here's my mvn dependency tree, thanks for your help. [WARNING] Failed to retrieve plugin descriptor for org.codehaus.mojo:hibernate3- maven-plugin:2.2: Failed to parse plugin descriptor for org.codehaus.mojo:hibern ate3-maven-plugin:2.2 (C:\Users\gmc07\.m2\repository\org\codehaus\mojo\hibernate 3-

Re: Tapestry-Hibernate configure to work with both Tomcat and Jetty

2013-04-29 Thread Dmitry Gusev
Lenny is right, you have some jars in your classpath that conflicting with tomcat's libraries. Can you show output of "mvn dependency:tree" or "gradle dependencies" ? On Mon, Apr 29, 2013 at 9:04 PM, Lenny Primak wrote: > Sounds like you are mixing up your dependencies. Perhaps an incompatible

Re: Tapestry-Hibernate configure to work with both Tomcat and Jetty

2013-04-29 Thread Lenny Primak
Sounds like you are mixing up your dependencies. Perhaps an incompatible or duplicated version of some JARs somewhere. Sorry I can't be anymore specific. On Apr 29, 2013, at 1:00 PM, George Christman wrote: > Hi everyone, I'm now getting back to this issue and I'd like to say I > honestly stil

Re: Tapestry-Hibernate configure to work with both Tomcat and Jetty

2013-04-29 Thread George Christman
Hi everyone, I'm now getting back to this issue and I'd like to say I honestly still don't understand it. I posted my config on stack overflow with a little more detail. If any tapestry tomcat users would like to take a look at it and tell me what I might be doing wrong, I'd appreciate it. Thanks

Re: Tapestry-Hibernate outside of web requests

2013-04-01 Thread Michael Prescott
Okay, I assume this is because of how the CommitAfter advise is applied - when I write my own advice, I have no trouble finding methods that only declare the annotation on the service method implementation. This method, for example, will successfully advise service implementations even when there'

Re: Tapestry-Hibernate outside of web requests

2013-04-01 Thread Thiago H de Paula Figueiredo
On Mon, 01 Apr 2013 13:36:39 -0300, Michael Prescott wrote: How do I make @CommitAfter work outside of a normal web request? public class PeerMessageProcessorImpl implements PeerMessageProcessor { @Inject private Session session; @CommitAfter public void receive(Message message) { Objec

Re: Tapestry-Hibernate configure to work with both Tomcat and Jetty

2013-03-26 Thread Dmitry Gusev
I don't like to use server.xml for JNDI configuration for several reasons, but the main is that JDBC driver classes should be on server classpath, which means you have to manually put them there. Which personally I don't like because driver jar usually specified at pom.xml/build.gradle and this is

Re: Tapestry-Hibernate configure to work with both Tomcat and Jetty

2013-03-26 Thread Barry Books
I also host on Amazon with Tomcat and develop with Jetty. Hibernate just gets the datasource from the container. When running locally that's Jetty and Jetty reads the jetty-web.xml file to build the connection. When deployed under Tomcat that would most likely be the server.xml file in the Tomcat

Re: Tapestry-Hibernate configure to work with both Tomcat and Jetty

2013-03-25 Thread George Christman
Hi Lenny, I don't really want to detrail this topic, but I'm very interested. Would you mind sending me a brief email describing your experiences with Jelastic, cost etc. Thanks. On Mon, Mar 25, 2013 at 1:08 PM, Lenny Primak wrote: > Have you considered Jelastic? We are using it with great succ

Re: Tapestry-Hibernate configure to work with both Tomcat and Jetty

2013-03-25 Thread Thiago H de Paula Figueiredo
On Mon, 25 Mar 2013 13:13:56 -0300, George Christman wrote: My question is if I use this configuration, how does Hibernate know to use Jetty locally? I'm not a server expert by any means, so please forgive my ignorance. Does Tapestry tell Hibernate about the local environment and know to

Re: Tapestry-Hibernate configure to work with both Tomcat and Jetty

2013-03-25 Thread Lenny Primak
Have you considered Jelastic? We are using it with great success. On Mar 25, 2013, at 12:39 PM, George Christman wrote: > I like Glassfish much better do to my limited linux knowledge and it's nice > gui, but I would like to try and use bean stalk with amazon and I haven't > seen much docume

Re: Tapestry-Hibernate configure to work with both Tomcat and Jetty

2013-03-25 Thread George Christman
I like Glassfish much better do to my limited linux knowledge and it's nice gui, but I would like to try and use bean stalk with amazon and I haven't seen much documentation on setting it up with Glassfish. Seems as if everything points towards Tomcat which is the only reason I would consider the s

Re: Tapestry-Hibernate configure to work with both Tomcat and Jetty

2013-03-25 Thread Lenny Primak
Why? Glassfish is a superset of tomcat and 1000% better IMHO On Mar 25, 2013, at 12:13 PM, George Christman wrote: > Hello, I'm currently moving my Tapestry5.3 app away from Glassfish in favor > of Tomcat7 on the amazon cloud for my production env. As for my development > env, I'd like to c

Re: Tapestry + Hibernate optimistic locking

2012-12-05 Thread Geoff Callender
So your situation is that you are updating non-detached entities and usually (but possibly not always) want optimistic locking. This can be handled on a case-by-case basis without altering Hibernate's internals. Look for "bulkEditPersonsByDTOs" in: http://jumpstart.doublenegative.com.au

Re: Tapestry + Hibernate optimistic locking

2012-12-05 Thread nquirynen
Just for the interested: After some more research I found that setting the version manually (which is not recommended by Hibernate) didn't work because of what is described here: https://forum.hibernate.org/viewtopic.php?p=2293177&sid=2969aa867c7086b4a3c7a68bda853690#p2293177 It's a really old p

Re: Tapestry + Hibernate optimistic locking

2012-12-03 Thread nquirynen
Thanks for the example (and JumpStart in general). You point on doing the commit in onValidate makes sense, so i changed that. I removed the manual version check as you suggest (which ofcourse makes sense). So I actually ended up having what I had at the start of making this mail thread. So I e

Re: Tapestry + Hibernate optimistic locking

2012-11-30 Thread Geoff Callender
The following is a working example. It uses hidden version. Try opening in two browsers and changing the person in both - you'll get the optimistic lock exception. Don't check the versions yourself - leave that to Hibernate. http://jumpstart.doublenegative.com.au/jumpstart/examples/inpu

Re: Tapestry + Hibernate optimistic locking

2012-11-30 Thread nquirynen
Thanks for the ideas, I will look into this :) -- View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-Hibernate-optimistic-locking-tp5718413p5718431.html Sent from the Tapestry - User mailing list archive at Nabble.com. -

Re: Tapestry + Hibernate optimistic locking

2012-11-30 Thread nquirynen
Doesn't seem to work. It does work if I do the following: .tml - .class -- @Property private Integer version; void setupRender() { version = person.getVersion() } void onSuccess() { if(version == person.getVersion) { // do update } else { // don't do

Re: Tapestry + Hibernate optimistic locking

2012-11-30 Thread Taha Siddiqi
If you ready to go deeper, you can change a bit of tapestry-hibernate source code to implement it (NOT TESTED) 1. Add a version field (annotated with @Version) to your entity. 2. Add a field version to PersistedEntity. 3. In EntityPersistentFieldStrategy, store version along with id and entity-t

Re: Tapestry + Hibernate optimistic locking

2012-11-30 Thread nquirynen
Nice idea and seems to work. I changed to Integer version, because as you all said it is recommended and timestamp is sligthly less safe. So I have this now: Index.class public class Index { @Inject private PersonRepository personRepo; @Property private

Re: Tapestry + Hibernate optimistic locking

2012-11-30 Thread Thiago H de Paula Figueiredo
On Fri, 30 Nov 2012 10:08:54 -0200, nquirynen wrote: Hi, Hi! Thanks for the explanation. Yes with "I understand its not working" I meant my approach is failing. I understand optimistic locking is working, but just don't know how to make use of it. So you mean I have to use Persist ins

Re: Tapestry + Hibernate optimistic locking

2012-11-30 Thread Taha Siddiqi
I don't think @Persist will work. If you ready to go deeper, you can change a bit of tapestry-hibernate source code to implement it (NOT TESTED) 1. Add a version field (annotated with @Version) to your entity. 2. Add a field version to PersistedEntity. 3. In EntityPersistentFieldStrategy, store

Re: Tapestry + Hibernate optimistic locking

2012-11-30 Thread nquirynen
Hi, Thanks for the explanation. Yes with "I understand its not working" I meant my approach is failing. I understand optimistic locking is working, but just don't know how to make use of it. So you mean I have to use Persist instead of activation context? -- View this message in context: http

Re: Tapestry + Hibernate optimistic locking

2012-11-30 Thread Lance Java
Should have been -- View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-Hibernate-optimistic-locking-tp5718413p5718416.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsub

Re: Tapestry + Hibernate optimistic locking

2012-11-30 Thread Lance Java
In order to use optimistic locking, hibernate recommends that you use an integer version annotated with @Version on your entity. @Entity public class Person implements Serializable { @Column private String name; @Version @Column private Integer version; // getters and set

Re: Tapestry + Hibernate optimistic locking

2012-11-30 Thread Thiago H de Paula Figueiredo
On Fri, 30 Nov 2012 08:47:55 -0200, nquirynen wrote: Hi, Hi! When I submit the form it will always first get the Person object again through onActivate so I understand why this isnt working. It's actually working. Optimistic locking doesn't seem to actually be what you think it is. Hi

Re: tapestry-hibernate and mysql console

2012-11-05 Thread angelochen
you are right, unexpected behavior, it even writes back some value which I set to null directly, of course this is for some testing app. Taha Hafeez wrote > Hi Angelo > > Yes this is not related to Tapestry. Hibernate caches the results for > efficiency(there are different levels of caches invol

Re: tapestry-hibernate and mysql console

2012-11-05 Thread Taha Siddiqi
Hi Angelo Yes this is not related to Tapestry. Hibernate caches the results for efficiency(there are different levels of caches involved) and so what you do directly with the database may not be updated in the cache for a while depending on the cache configuration. My advice would be not to up

RE: Tapestry & hibernate session - without tapestry-hibernate module

2012-10-12 Thread Wechsung, Wulf
est. More details here under "Defining Service Scope": http://tapestry.apache.org/defining-tapestry-ioc-services.html Kind Regards, Wulf -Original Message- From: esper [mailto:marin_ma...@yahoo.com] Sent: Freitag, 12. Oktober 2012 13:55 To: users@tapestry.apache.org Subject:

RE: Tapestry & hibernate session - without tapestry-hibernate module

2012-10-12 Thread esper
Mr. Wulf (shit this sounds cool!) i didn't even know this could be done! but there is a questions that comes to mind: can injected objects be built on demand (runtime) or is it only once per application session? once per thread basically. you see, there is a reason why I decided to remove tapestr

RE: Tapestry & hibernate session - without tapestry-hibernate module

2012-10-12 Thread Wechsung, Wulf
Hi, The awesome thing is that everything in Tapestry can be a service! All you need is a service builder method and the @Inject annotation in your Services, Pages and Components. So for a hibernate session you could (not saying this is a good solution, but it's a start) a service builder meth

Re: Tapestry & hibernate session - without tapestry-hibernate module

2012-10-12 Thread Lance Java
https://git-wip-us.apache.org/repos/asf?p=tapestry-5.git;a=blob;f=tapestry-hibernate-core/src/main/java/org/apache/tapestry5/hibernate/HibernateCoreModule.java -- View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-hibernate-session-without-tapestry-hibernate-module-tp5

Re: Tapestry & hibernate session - without tapestry-hibernate module

2012-10-12 Thread Lance Java
Download the source code for tapestry-hibernate and take a look at how it works. The session will end up being a proxy to a per-thread value. If you want two different db connections, you might want to consider giving each session a marker annotation to differentiate them. -- View this message i

Re: Tapestry & hibernate session - without tapestry-hibernate module

2012-10-12 Thread esper
One possible solution would be to create a HibernateUtils class for example to hold a session object. I could then persist that object on application state lavel like this: class HibernateUtils { ... @Persist(PersistenceConstants.SESSION) private Session session = ... ... } is this a way to go? i

  1   2   3   >