Re: stateless session bean OR ordinary java class ?

Juan Pablo Lorandi <[email protected]>
Newsgroups gmane.comp.java.sun.ejb.general
Organization CodeFoundry LTD
Message-ID <014901c3b431$57f88d90$0a00a8c0@rifle>
>
> Greetings,
>
> I wonder what should I use for executing some business logic
> and call stored procedures: ordinary classes or stateless
> session beans?
>
> For stateless session beans it's possible to cache somewhere
> the datasource factory or must I lookup always for the jndi
> connection pool?

Sure:

private static DataSource ds = null;
private static InitialContext ic = null;

private void init() {
        if (ic == null)
                initHomes();
}
private static synchronized void initHomes() {
        if (ic == null) {
                ic = new InitialContext();
                ds = (DataSource) ic.lookup("someDataSource);
        }
}

>
> thanks.
>
> P.S.-I believe the stateful session bean is out of question
> since it's much more heavy than stateless beans.
>
> regards,
> Pedro Salazar.
> --
> PS
> [email protected]
> PGP:0E129E31D803BC61
>
> ==============================================================
> =============
> To unsubscribe, send email to [email protected] and
> include in the body of the message "signoff EJB-INTEREST".
> For general help, send email to [email protected] and
> include in the body of the message "help".
>

===========================================================================
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[email protected] and include in the body of the message "help".
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.