You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Satrix <sa...@gmail.com> on 2012/11/18 14:59:31 UTC

Wicket 1.5.8 + EJB 3.1 - strange problem

Hello,

Im using Wicket 1.5.8 + EJB 3.1. To configure Wicket with EJB Im using:
<dependency>
   <groupId>org.wicketstuff</groupId>
   <artifactId>javaee-inject</artifactId>
   <version>1.5-RC5.1</version>
</dependency>

Everything seemed to work when I was using only @Stateless beans. But now,
it's the time that I need to introduce @Stateful bean into the application.
And because of that I'm struggling with a very strange problem. Everything
works as expected except... back button. When I click back button -
@Stateful EJB is being recreated each time I press back button. So it's
ruining my logic. 

Any idea what's happening ?

Thank you in advance, Satrix



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-8-EJB-3-1-strange-problem-tp4653977.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Wicket 1.5.8 + EJB 3.1 - strange problem

Posted by Satrix <sa...@gmail.com>.
Cause Im eager to learn new things :)

Regards, Satrix



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-8-EJB-3-1-strange-problem-tp4653977p4654128.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Wicket 1.5.8 + EJB 3.1 - strange problem

Posted by Paul BorČ™ <pa...@bors.ws>.
Why don't you instead use a bigger and more robust IoC framework like Spring and a persistence framework you can trust like Hibernate?

Check out:
http://wicketinaction.com/2009/06/wicketspringhibernate-configuration/

Have a great day,
Paul Bors

On Nov 19, 2012, at 8:39 AM, Satrix <sa...@gmail.com> wrote:

> Nope. Look at the example:
> 
> 1. User has chose to add a product to the Cart (so now the cart number is 1
> and he can see that number in a proper place on the page).
> 
> 2. Now when he clicks back button - bean is recreated - so the cart number
> is 0 (list is recreated).
> 
> 3. BUT now when I click on any other link on my page container returns
> previous EJB bean so the cart number is 1.
> 
> Btw Im using LoadableDetachableModel so there is no way that the user is
> seeing stale data.
> 
> Regards, Satrix
> 
> 
> 
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-8-EJB-3-1-strange-problem-tp4653977p4653995.html
> Sent from the Users forum mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 

Re: Wicket 1.5.8 + EJB 3.1 - strange problem

Posted by Satrix <sa...@gmail.com>.
Nope. Look at the example:

1. User has chose to add a product to the Cart (so now the cart number is 1
and he can see that number in a proper place on the page).

2. Now when he clicks back button - bean is recreated - so the cart number
is 0 (list is recreated).

3. BUT now when I click on any other link on my page container returns
previous EJB bean so the cart number is 1.

Btw Im using LoadableDetachableModel so there is no way that the user is
seeing stale data.

Regards, Satrix



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-8-EJB-3-1-strange-problem-tp4653977p4653995.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Wicket 1.5.8 + EJB 3.1 - strange problem

Posted by Wujek Srujek <wu...@gmail.com>.
If the container returns the correct bean, this means your login works
fine, is this correct? Why do you then care that the @Stateful-annotated
field is different? It probably is just a proxy generated by your
container's injection framework anyways.


On Mon, Nov 19, 2012 at 2:16 PM, Satrix <sa...@gmail.com> wrote:

> Unfortunately even after changing the version of the
> wicketstuff-javaee-inject to newer version the problem still exists.
>
> What's more interesing is that when I navigate over the page (everything
> except back button) the @Stateful bean works. Only back button click
> recreates the @Stateful bean (but... after the bean has been recreated,
> when
> I click on a links etc, container returns me correct bean instance
> (previous
> bean - before recreation)).
>
> I wonder if you know someone from the wicketstuff-javaee-inject, so maybe
> they could provide me a workaround or smth ?
>
> Regards, Satrix
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-8-EJB-3-1-strange-problem-tp4653977p4653991.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Wicket 1.5.8 + EJB 3.1 - strange problem

Posted by Martin Grigorov <mg...@apache.org>.
https://github.com/aldaris - this is the guy who made this contribution


On Mon, Nov 19, 2012 at 3:16 PM, Satrix <sa...@gmail.com> wrote:

> Unfortunately even after changing the version of the
> wicketstuff-javaee-inject to newer version the problem still exists.
>
> What's more interesing is that when I navigate over the page (everything
> except back button) the @Stateful bean works. Only back button click
> recreates the @Stateful bean (but... after the bean has been recreated,
> when
> I click on a links etc, container returns me correct bean instance
> (previous
> bean - before recreation)).
>
> I wonder if you know someone from the wicketstuff-javaee-inject, so maybe
> they could provide me a workaround or smth ?
>
> Regards, Satrix
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-8-EJB-3-1-strange-problem-tp4653977p4653991.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com <http://jweekend.com/>

Re: Wicket 1.5.8 + EJB 3.1 - strange problem

Posted by Satrix <sa...@gmail.com>.
Unfortunately even after changing the version of the
wicketstuff-javaee-inject to newer version the problem still exists. 

What's more interesing is that when I navigate over the page (everything
except back button) the @Stateful bean works. Only back button click
recreates the @Stateful bean (but... after the bean has been recreated, when
I click on a links etc, container returns me correct bean instance (previous
bean - before recreation)).

I wonder if you know someone from the wicketstuff-javaee-inject, so maybe
they could provide me a workaround or smth ?

Regards, Satrix



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-8-EJB-3-1-strange-problem-tp4653977p4653991.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Wicket 1.5.8 + EJB 3.1 - strange problem

Posted by Satrix <sa...@gmail.com>.
Hello Martin,

I'll check this out today and let you know if it helps.

Regards, Satrix



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-8-EJB-3-1-strange-problem-tp4653977p4653990.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Wicket 1.5.8 + EJB 3.1 - strange problem

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

I don't use Wicketstuff-javaee and I have no idea what could be the problem.
But I want to tell you that there are several releases of this project
after 1.5-RC1:
http://central.maven.org/maven2/org/wicketstuff/wicketstuff-javaee-inject/1.5.9/.
Note the different groupId.


On Sun, Nov 18, 2012 at 3:59 PM, Satrix <sa...@gmail.com> wrote:

> Hello,
>
> Im using Wicket 1.5.8 + EJB 3.1. To configure Wicket with EJB Im using:
> <dependency>
>    <groupId>org.wicketstuff</groupId>
>    <artifactId>javaee-inject</artifactId>
>    <version>1.5-RC5.1</version>
> </dependency>
>
> Everything seemed to work when I was using only @Stateless beans. But now,
> it's the time that I need to introduce @Stateful bean into the application.
> And because of that I'm struggling with a very strange problem. Everything
> works as expected except... back button. When I click back button -
> @Stateful EJB is being recreated each time I press back button. So it's
> ruining my logic.
>
> Any idea what's happening ?
>
> Thank you in advance, Satrix
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-8-EJB-3-1-strange-problem-tp4653977.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com <http://jweekend.com/>