ejb 3.0 - Difference between creating dao object with constructor and by EJB injection -


i know difference between creating dao object constructor :

mydaoobject = new mydaoobject(); 

and creating ejb injection :

@ejb mydaoobject mydaoobject; 

is there difference in running and/or performance ? thanks.

well...you can't create ejbs constructor because lose functionality offered container (dependency injection, pooling, calling of @postconstruct, transactions, ...). correct way

@ejb mydaoobject mydaoobject; 

p.s. or, in case using cdi, @inject instead of @ejb


Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -