Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

invoking login method

 
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

i use HSQLD, jboss 4.2 and seam 2

my user class


the login action



my persistence.xml




in the database i done



if i enter the wrong information, i can't login

and i get this message




if i enter the correct information i get


so i would like to know how to avoid theses error when the information entered by the user is bad

any idea?
 
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mark,

You are maintaining the State "User" in a stateless session bean. You cannot guarantee that you would get the same instance of the stateless session bean everytime. If you plan to maintain state please switch to Stateful session bean. That should fix your issue. But you have to be very careful to remove the Stateful session bean once you are done.

Alternately you could just return the User from one of the methods in your stateless session bean.

Hope this helps.
 
mark smith
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Shailesh Kini:
Hi Mark,

You are maintaining the State "User" in a stateless session bean. You cannot guarantee that you would get the same instance of the stateless session bean everytime. If you plan to maintain state please switch to Stateful session bean. That should fix your issue. But you have to be very careful to remove the Stateful session bean once you are done.

Alternately you could just return the User from one of the methods in your stateless session bean.

Hope this helps.



thank i will try...

i use this technic because Michael Yuan use it in its book... i tried the example in its book and i get the same problem...
 
Why am I so drawn to cherry pie? I can't seem to stop. Save me tiny ad!
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic