Re: T5.3: what's the correct usage of PerThreadValue

2012-11-28 Thread Howard Lewis Ship
On Wednesday, November 28, 2012, Robert Hailey wrote: > > I've read the "everyone out of the pool" blog post, but have not been able > to find an example of how to best use per-thread value on a page or service > (seems like what's provided is an internal tapestry case). > > As always. Some of the

Re: @CommitAfter not committing my transaction

2012-11-28 Thread Pillar
Ok, so I didn't know that, I thought SessionFactory was a singleton. I will use Tapestry-Hibernate the way it's meant to just like in the link you posted. Thanks! -- View this message in context: http://tapestry.1045711.n5.nabble.com/CommitAfter-not-committing-my-transaction-tp5718364p5718380.h

Re: @CommitAfter not committing my transaction

2012-11-28 Thread Josh Canfield
Tapestry-Hibernate creates it's own instance of the SessionFactory http://tapestry.apache.org/current/apidocs/index.html?org/apache/tapestry5/internal/hibernate/HibernateSessionSourceImpl.html You can have multiple SessionFactory instances (if you have multiple databases for instance) so calling t

Re: @CommitAfter not committing my transaction

2012-11-28 Thread Pillar
I'm not in a position to test it right now, so I won't say if it worked. Where does Tapestry get that session for you? But you are right, that is smarter/better than popping out your own every time. -- View this message in context: http://tapestry.1045711.n5.nabble.com/CommitAfter-not-committin

Re: @CommitAfter not committing my transaction

2012-11-28 Thread Jay Ginete
I believe you are suppose to "inject" the Hibernate session. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org

Re: T5.3: what's the correct usage of PerThreadValue

2012-11-28 Thread Josh Canfield
Ah right, I was assuming a loop, which would be one instance. Hmm... I can't remember a time when I've needed to talk across component instances where using a @SessionState object didn't work. But I can see how you might want to not have the state persist between requests... If someone doesn't co

Re: @CommitAfter not committing my transaction

2012-11-28 Thread Pillar
As far as I know a Hibernate Session has only one Transaction at a time, hence the session.beginTransaction, session.getTransaction(). Also, the SessionFactory has the getCurrentSession() which returns a per thread session. So unless, I'm completely wrong in how I think tapestry-hibernate is implem

Re: T5.3: what's the correct usage of PerThreadValue

2012-11-28 Thread Robert Hailey
Unless I'm mistaken (which is possible), tapestry will create two distinct components when building the component trees, and they will not have access to the same variable. So a template like: Would yield three log messages of "rendered 1 time". -- Robert Hailey

Re: @CommitAfter not committing my transaction

2012-11-28 Thread Josh Canfield
I'm not sure why you'd expect Tapestry to find a session that it didn't create and commit a transaction that it doesn't know about? On Wed, Nov 28, 2012 at 1:07 PM, Pillar wrote: > It is in a Controller. If it was in DAO Layer, do I still use the @Inject > for > a session or get it from Hibern

Re: T5.3: what's the correct usage of PerThreadValue

2012-11-28 Thread Josh Canfield
Hi Robert. Are you looking for a reason to use PreThreadValue? Or do you just want to have a page/component level property that you can access for the life of the request? In a page or component you just declare the variable and let tapestry do it's magic in the background. private int w

T5.3: what's the correct usage of PerThreadValue

2012-11-28 Thread Robert Hailey
I've read the "everyone out of the pool" blog post, but have not been able to find an example of how to best use per-thread value on a page or service (seems like what's provided is an internal tapestry case). As a (lazy?) tapestry developer, my first thought is to try this: @Inject

RE: How to execute a method automatically after deployment?

2012-11-28 Thread Tony Nelson
In your AppModule contribute a method annotated with @Startup. http://blog.tapestry5.de/index.php/2010/06/16/registry-startup/ -Original Message- From: membersound [mailto:memberso...@web.de] Sent: Wednesday, November 28, 2012 4:14 PM To: users@tapestry.apache.org Subject: How to execute

How to execute a method automatically after deployment?

2012-11-28 Thread membersound
Hi, how can I execute a method automatically after the whole application is loaded an up running? I don't mean static blocks to initialize something. I mean just executing a method as it would be called after application deployed. With all injected services working and so on. Can Tapestry do this

RE: @CommitAfter not committing my transaction

2012-11-28 Thread Pillar
It is in a Controller. If it was in DAO Layer, do I still use the @Inject for a session or get it from HibernateUtils style class? Now regardless of if I get the Transaction from the Session I'm given from the SessionFactory, shouldn't Tapestry be finding the same Transaction and committing it?

RE: @CommitAfter not committing my transaction

2012-11-28 Thread Tony Nelson
You should also Inject the session. @Inject private Session session; Is this method in a controller, or do you have a DAO layer? -Original Message- From: Pillar [mailto:sotodel...@hotmail.com] Sent: Wednesday, November 28, 2012 2:59 PM To: users@tapestry.apache.org Subject: @CommitAfter

Re: @CommitAfter not committing my transaction

2012-11-28 Thread Norman Franke
I don't think you should start your own transaction. Remove the beginTransaction(). Norman Franke Answering Service for Directors, Inc. www.myasd.com On Nov 28, 2012, at 2:59 PM, Pillar wrote: > Unless I'm understanding it wrong, the @CommitAfter on my method isn't > committing the transactio

@CommitAfter not committing my transaction

2012-11-28 Thread Pillar
Unless I'm understanding it wrong, the @CommitAfter on my method isn't committing the transaction. @CommitAfter public void call() { Session s = HibernateUtils.getSessionFactory().openSession(); s.beginTransaction(); User u = new User

Re: Referencing files from a jar

2012-11-28 Thread Thiago H de Paula Figueiredo
On Wed, 28 Nov 2012 15:05:55 -0200, mwrohde wrote: Ok, thanks for the replies so far. In the tml I've got: <${classpath:/com/navicure/ui/components/images/exit2.png}> It should have been src="${classpath:/com/navicure/ui/components/images/exit2.png}"/>. You still need to use proper HTML ta

Re: Referencing files from a jar

2012-11-28 Thread mwrohde
I've tried asset: before, without luck. But, at your urging I've played with it some more and have at least one image working, which means I can probably get the rest going to. For anyone else that stumbles across this here's what I've got in my tml now: <${asset:/images/exit2.png}> For reasons

Re: Referencing files from a jar

2012-11-28 Thread mailingl...@j-b-s.de
Hi! When looking at: http://tapestry.apache.org/assets.html Section "Assets in Templates" its "asset:" instead of "classpath:" So give this a try (untested)? Jens Sent from my iPhone On 28.11.2012, at 18:05, mwrohde wrote: > Ok, thanks for the replies so far. > > In the tml I've got: > <$

Re: Referencing files from a jar

2012-11-28 Thread mwrohde
Ok, thanks for the replies so far. In the tml I've got: <${classpath:/com/navicure/ui/components/images/exit2.png}> When I attempt to render the page in the browser I get: Could not convert 'classpath:/com/navicure/ui/components/images/exit2.png' into a component parameter binding: Error parsing

Re: Jquery Tooltip on production mode

2012-11-28 Thread Emmanuel DEMEY
You 're right. I think it the same problem as the one we are talking about on Tapestry5-jQuery mailing-list : https://groups.google.com/forum/?hl=fr&fromgroups=#!topic/tapestry5-jquery/2dpH1zsbZMU We can continue this discussion on this mailing-list ? can you check the version of jQuery and jQuer

Re: Referencing files from a jar

2012-11-28 Thread Lance Java
Images, css and js etc are known in tapestry as assets. You can reference assets by "classpath:" or "context:". http://tapestry.apache.org/assets.html -- View this message in context: http://tapestry.1045711.n5.nabble.com/Referencing-files-from-a-jar-tp5718355p5718357.html Sent from the Tapes

Re: Referencing files from a jar

2012-11-28 Thread Thiago H de Paula Figueiredo
On Wed, 28 Nov 2012 13:26:34 -0200, mwrohde wrote: All - Hi! We have not been successful in getting image files loaded from the component jar, however. We have tried referencing images through relative path from both tml and css, both to no avail. In templates and classes, use the Tap

Referencing files from a jar

2012-11-28 Thread mwrohde
All - I'm new to Tapestry, so please forgive my ignorance. We're writing an application using Tapestry 5.3.6. We would like to package customized components such as buttons, date pickers, and tables in a components jar. This jar will contain the class files, and associated css, js, and image fi

Re: Error references component id 'ABC' which does not exist

2012-11-28 Thread Lance Java
If you provide a small snippet of code that's failing and an exception stack trace you are more likely to get help with this. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Error-references-component-id-ABC-which-does-not-exist-tp5718353p5718354.html Sent from the Tapest

Error references component id 'ABC' which does not exist

2012-11-28 Thread dinesh707
When I run the same project in -- Jetty 7 -- Java 7 IT WORKS ! But when I build the war file and move it to -- Tomcat 7 -- Java 7 It gives the error ---Error references component id Any idea why this is happening? -- View this message in context: http://tapestry.1045711.n5.nabble.com/Erro

Re: Override MessagesImpl

2012-11-28 Thread Lance Java
You will either decorate or override the MessagesSource service. Take a look at the MessagesSourceImpl source code for inspiration. http://tapestry.apache.org/ioc-cookbook-overriding-ioc-services.html http://tapestry.apache.org/tapestry-ioc-decorators.html http://tapestry.apache.org/current/apidoc