Re: How to do a Batch transaction with Tapestry-Hibernate

2013-10-25 Thread Martin Kersten
Well I inject methods but I use a special working thread or at least you can do. There is this PerThreadManager service (lance, barry and thiago knows better) and the Job API of Tapestry. There are plenty of ways to get this done. Barry is writing pages for every batch job and those pages just retu

Re: [5.4.23] Troubleshooting Live Class Reloading

2013-10-25 Thread Martin Kersten
I had a reload issue regarding to class loading and incompatible class versions for a parameter when changing from alpha 21 to 23. I altered the binding code to not use reloading (preventReloading or something similar, check the auto complete options). I only had to do it for one service I dont nee

DynamicTemplate issue

2013-10-25 Thread Martin Kersten
Hi there, I still try to get DynamicTemplate working. Since I debugged into it it seams that the parser of the dynamic template just returns dom elements and never tries to analyze any element and map it towards components. Am I correct on this? Is someone able to use a dynamic template compo

Re: Tapestry5 Anchor Usage for Navigation

2013-10-25 Thread Ilya Obshadko
Found this thread while looking for a similar solution. - I'm using AJAX calls heavily and still want to be able to represent each page state as a separate URL. - I need to use anchor part of the URL in page activation handlers Is there any proper way to do that in 5.4? On Thu, Dec 1, 2011 at

Re: Tapestry5 Anchor Usage for Navigation

2013-10-25 Thread Dmitry Gusev
Please note: Anchors or URL fragments as they are referred to in RFC 1738, > are not sent by the client to the server, when requesting for a resource. > So dealing with anchors is completely client-side job. Of course you can redirect from server-side to anc

Re: How to do a Batch transaction with Tapestry-Hibernate

2013-10-25 Thread Martin Kersten
Try to avoid CommitAfter its broken beyond repair (Accidently nesting the annotation creates unexpected commit behaviour that is hard to spot). If you do batch work you should use session.getTransaction().commit() instead to control the session. Hibernate also has some problems regarding to shared

Re: How to do a Batch transaction with Tapestry-Hibernate

2013-10-25 Thread Lance Java
Martin, again you are saying @CommitAfter is broken when it's not. It's your understanding of @CommitAfter that is broken :) CommitAfter does exactly what is says on the tin, it commits the current transaction after it executes the method.

[5.4.23] Troubleshooting Live Class Reloading

2013-10-25 Thread Peter Hvass
Hello, I've followed all guidance posted here; http://tapestry.apache.org/class-reloading.html A couple days ago live class and template reloading just stopped working between restarts. This only occurs for one of our projects... have spent a few hours trying to figure out where this mig

Re: Embedding a file on a page using StreamResponse from another component.

2013-10-25 Thread Steve
Hi again, Thanks for your help. I can't say how much I really appreciate the help from the people who contribute here, a huge thank you all of you. I've sent off the apache contributers licence agreement myself so that hopefully, some time in the future if I can then I will improve some of the doc

Re: How create Autocomplete with selectbox

2013-10-25 Thread Steve
Hello! I think you may find there is a useful example of something *similar* here: http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/autocompletemixin However, if it is that exact functionality as you see in the jqueryui page you linked to, perhaps you can simply use that exact one -

Re: [5.4.23] Troubleshooting Live Class Reloading

2013-10-25 Thread Taha Hafeez Siddiqi
Hi It may seem stupid but I have made such mistakes in the past so I will still ask you to check if tapestry.production_mode is true. For class reloading it should be false. Also ensure tapestry.service-reloading-enabled is set to true. regards Taha On 25-Oct-2013, at 2:25 PM, Peter Hvass wr

Re: Datatables warning when using

2013-10-25 Thread Steve
Thanks for getting back to us - Glad it helped! I'm regularly asking questions here myself so I'm just happy I was able to help someone else :D. Have a good weekend, On 25 October 2013 05:08, lidijaldo . wrote: > Will keep that in mind, thanks! > > Regards, > Lidija > > > On Thu, Oct 24, 2013 a

Re: [5.4.23] Troubleshooting Live Class Reloading

2013-10-25 Thread Peter Hvass
Hi Thanks Taha - you're right that with these types of issues we overlook the simple and obvious! I've double checked though and both values were correct. Since then I checked out the same project again into a different Eclipse workspace and all was working fine there. I'm going to pers

Re: [5.4.23] Troubleshooting Live Class Reloading

2013-10-25 Thread Taha Hafeez Siddiqi
I don't use runJettyRun plugin as I use Intellij Idea but I think runJettyRun restarts jetty for each change. Are you sure you have disabled that. You can search the archives to see the exact option to disable. regards Taha On 25-Oct-2013, at 4:42 PM, Peter Hvass wrote: > Hi > > > Thanks

Re: [5.4.23] Troubleshooting Live Class Reloading

2013-10-25 Thread Peter Hvass
Hi Taha, Thanks for this - I should have also mentioned my Jetty configs; all 'scanning' is disabled so it will not restart jetty on saves. I'm really scratching my head on this one. :) Thanks! Peter - Original Message - From: "Taha Hafeez Siddiqi" To: "Tapestry users" Se

Re: How to do a Batch transaction with Tapestry-Hibernate

2013-10-25 Thread Martin Kersten
It's broken. Or at least one should update the UserGuide stating out the concrete behaviour and the danger that can be caused by using it in conjunction with Services. I had to clean up the mess that was introduced by using this annotation on Service interfaces. And luckily this even breaks the tr

Re: How to do a Batch transaction with Tapestry-Hibernate

2013-10-25 Thread Lance Java
I'm assuming a fork is broken too because it's no good for eating soup? Sounds like you need a spoon, it's easy to write your own annotation... Perhaps you want a @MaybeCommitAfter ;)

uberValidator for all text input fields

2013-10-25 Thread Hendrik Grewe
Hello! I am looking for an easy way to get all existing text input fields in my webapp validated before submission. Currently some people were able to submit text with e.g ASCII control-characters and other (by xml spec [1]) disallowed characters. As I want to generate valid xml files from those

Re: How to do a Batch transaction with Tapestry-Hibernate

2013-10-25 Thread Barry Books
I run a lot of batch transactions and I use @Inject and @CommitAfter without any problems so I don't think they are the issue. For high volumes I usually use plain SQL though because it's easier to control. While it's true you can run into problems by nesting @CommitAfter the same can be said abou

Re: uberValidator for all text input fields

2013-10-25 Thread Barry Books
You might be able to override the StringTranslator but I have never tried that. On Fri, Oct 25, 2013 at 7:34 AM, Hendrik Grewe wrote: > Hello! > > I am looking for an easy way to get all existing text input fields in my > webapp validated before submission. > > Currently some people were able to

Re: How to do a Batch transaction with Tapestry-Hibernate

2013-10-25 Thread Thiago H. de Paula Figueiredo
On Thu, Oct 24, 2013 at 11:14 PM, George Christman wrote: > I'm wondering how to do a batch transaction with Tapestry-Hibernate. Should > I still be using @Inject Session session and @CommitAfter? or Should I be > using Transaction tx? Without testing, I'd guess both should work. > I'm flushin

Re: [5.4.23] Troubleshooting Live Class Reloading

2013-10-25 Thread Lance Java
Just a stab in the dark here but are you using maven and using a version number NOT suffixed with "-SNAPSHOT" if you are this will cause problems as maven assumes that non snapshot versions (releases) are static.

Re: [5.4.23] Troubleshooting Live Class Reloading

2013-10-25 Thread Steve
Hi Peter, I had this problem also and also use the runJettyRun plugin for eclipse. I found it was because I was missing some arguments on the "Arguments" tab of run configurations. The ones which I am using are from the tutorial from the documentation on setting up eclipse, they are: VM Arguments:

Re: How to do a Batch transaction with Tapestry-Hibernate

2013-10-25 Thread Thiago H. de Paula Figueiredo
On Fri, Oct 25, 2013 at 10:53 AM, Barry Books wrote: While it's true you can run into problems by nesting @CommitAfter the same > can be said about nesting any commits. The Tapestry database model is > simple. There is one connection per request and when you call commit it > does a commit. > Ta

Re: [5.4.23] Troubleshooting Live Class Reloading

2013-10-25 Thread Thiago H. de Paula Figueiredo
Check the project configuration in Eclipse, specifically the build path tab. If you're using its Maven support, it configures your project to always exclude all resources from being copied to the target folder when you change them. Regarding live class reloading itself, it's weird. Are you using Wi

Re: How to do a Batch transaction with Tapestry-Hibernate

2013-10-25 Thread Martin Kersten
Use: @Inject Session session; //current session bound to the current thread or @Inject HibernateSessionSource source; + source.create() for a really new session (CommitAfter would not work with newly created one); Using the Manager does give you only the session associated with the current thr

Re: How to do a Batch transaction with Tapestry-Hibernate

2013-10-25 Thread Martin Kersten
> session.flush(); > session.clear(); > hibernateSessionManager.commit(); This is wrong. First on commit you will do the flush automatically (flush means all changes are written to the database (performing outstanding updates, inserts, deletes)) Clear clears

Re: How to do a Batch transaction with Tapestry-Hibernate

2013-10-25 Thread Martin Kersten
@George: Flushing the session does not commit your changes (Consider FlushMode.Commit). Therefore clear does not clear the persistence context. The rest is just dedicated to O(n²) for dirty checking (even immutable objects are dirty checked and touched in the way I wrote within the stackoverflow a

Re: How to do a Batch transaction with Tapestry-Hibernate

2013-10-25 Thread George Christman
So I guess I'm still a little confused as to what is the best to do it. @CommitAfter seems to work fine for individual transactions but does not work well with batch jobs do to it holding on to the object in memory. Anyhow, I could not figure out how to get Martins session.getTransaction() to work,

Re: How to do a Batch transaction with Tapestry-Hibernate

2013-10-25 Thread Martin Kersten
You might also want to use such kind of a utility that allows you to run in transaction: public interface InTransaction { public T run(Session session); } public static T DatabaseUtil.process(InTransaction transactionalRunnable) { try { Session session = currentSession();

Re: How to do a Batch transaction with Tapestry-Hibernate

2013-10-25 Thread Martin Kersten
And George, read this one: http://stackoverflow.com/questions/10143880/hibernate-queries-much-slower-with-flushmode-auto-until-clear-is-called. It explains why you experience the slow downs and what is it causing it. 2013/10/25 Martin Kersten > You might also want to use such kind of a utility

Re: How to do a Batch transaction with Tapestry-Hibernate

2013-10-25 Thread Martin Kersten
well you are decorating the session not the session source of cause... . 2013/10/25 Martin Kersten > >> Perhaps you want a @MaybeCommitAfter ;) > > What about simply having @WriteTransaction (und @ReadTransaction, since > lacking support for read transactions is the biggest performance issue wh

Re: How to do a Batch transaction with Tapestry-Hibernate

2013-10-25 Thread Martin Kersten
>> Perhaps you want a @MaybeCommitAfter ;) What about simply having @WriteTransaction (und @ReadTransaction, since lacking support for read transactions is the biggest performance issue when dealing with databases). If you are inside a method annotated with @WriteTransaction it is ignored. If nest

Re: uberValidator for all text input fields

2013-10-25 Thread Lance Java
You could add an implicit mixin to every textfield using a ClassTransformWorker2. See Taha's blog post here http://tawus.wordpress.com/2011/08/01/tapestry-mixins-classtransformations/

Re: How to do a Batch transaction with Tapestry-Hibernate

2013-10-25 Thread George Christman
Thanks Martin, if I understood you correctly, you are still Injecting the Session. Will this cause any issues where I'm still using @CommitAfter? Also in the batch job, do you typically put an additional commit outside the loop to pickup up the remaining values when they don't reach the count, say

[5.4-alpha-23] Memory Leak on GlassFish 4.0.1-b03

2013-10-25 Thread Andreas Ernst
Hi, The web application [/AEOnlineExtranet] created a ThreadLocal with key of type [org.apache.tapestry5.ioc.internal.services.PerthreadManagerImpl.MapHolder] (value [org.apache.tapestry5.ioc.internal.services.PerthreadManagerImpl$MapHolder@1ddcda0d]) and a value of type [java.util.HashMap]

Re: [5.4.23] Troubleshooting Live Class Reloading

2013-10-25 Thread Bob Harner
Peter, To be 100% sure you are running in development mode, look in the console log as Tapestry is starting up. It should have "(development mode)" next to the "Tapestry5" ASCII art. Whenever I have had a problem with Live Class Reloading not working, I have gone through the "Troubleshooting" sec

Re: [T5.4] AjaxFormLoop - is it working?

2013-10-25 Thread Michał Gruca
Hi all, I've digged deeper and found out the difference. I'm trying to do a ajaxloopform on a tr table element. https://gist.github.com/anonymous/7161243 Gist is a simplified version of a form (as whole thing is rather big). I almost wanted to gave up and started to implement a table based on divs