Re: EJBs & CMP with real database users

From: Fredrik Bertilsson (fredrik_bertilsson_at_passagen.se)
Date: 08/25/04


Date: 25 Aug 2004 01:23:48 -0700

I am afraid that J2EE will not help you very much here. Normally J2EE
applications are using connection pooling. The datasources are defined
(url, driver, user, password, etc) in a configuration file. When the
application want a connection it makes a lookup using the datasource
name. But the database user normally has to be defined in the
configuration file.

I think that you can't use connection pooling at all. Every user has
its own database session. You have to create connections (instead of
doing lookup), using JDBC DriverManager. Because you are not using
connection pooling, you have to check with you DBA that a user session
does not allocate too much memory on the database server. Otherwise
your application will scale very bad.

I also think that you can't use J2EE transaction handling, because you
are not using connection pooling. You have to do commit and rollback
explicit in your code. Or you can use some AOP (Aspect Oriented
Programming) framwork (like spring framework) and put the transaction
code in some post-processing code.

Because you are not using the two most important features of J2EE
(transaction handling and connection pooling), maybe you should not
use J2EE at all. It is a big overhead in money and performance using
J2EE.

/Fredrik



Relevant Pages

  • Re: EJBs & CMP with real database users
    ... > in a configuration file. ... But the database user normally has to be defined in the ... > I think that you can't use connection pooling at all. ... > Because you are not using the two most important features of J2EE ...
    (comp.lang.java.databases)
  • Re: Long running open connections badly leak memory
    ... > I wrote a batch import process that uses connection pooling, ... and I tracked it down to the Microsoft JDBC driver ... > If the driver is doing any caching on purpose, ... The MS driver does indeed do a lot of unnecessary caching (such as ...
    (microsoft.public.sqlserver.jdbcdriver)
  • Re: BindException (Address already in use) when connecting to MSSQL
    ... You we're quite right, connection pooling works! ... thing is that the JNetDirect JSQLConnectionPoolDataSource class isn't ... my ancient version of the driver, ... Thanks for pointing me in the right direction. ...
    (comp.lang.java.programmer)