Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Can a Stateless Bean be used to insert data

 
Jagmohan Negi
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can i use a stateless session bean to insert data into a table.I am only inserting data to it,Not performing any operations on it.Also I am not using any Transaction Management for it.
Or should i design a Entity bean for it.

Did it have any impact on performance.

plz let me know Wt is the recomendation for it.

Thanx
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. You'll need to implement the JDBC logic yourself or use some other ORM technology to do the database work.
 
Jagmohan Negi
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But Don't u think it will heavy my code and More i can do it with the help of a servlet or jsp. Then Why i go for Stateless session bean.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You would use a Sesison bean if you require any of the container's services. Do you? If you don't it is overkill.
 
Sravan Kumar
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stateless Session beans, (beans in general) form the business layer of your application. Call the business methods on the stateless session bean, pass the parameters through a ValueObject and call Data Access layer to do the actual insert. Do not bother about DB connectivity in the bean.
 
Martaban Martaban
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sravan,

The question he is asking is if he needs to use it or not ,instead of replying back with a design pattern tone ,why dont you answer his question as to if he neds to use it at all.. :roll:
 
I am going to test your electrical conductivity with this tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!