Hi,
Assuming that there is no EJB-QL equivalent for the SQL COUNT(*) and MAX(...) functions, would it be safe to combine CMP entity beans with stateless session beans, where the session beans would use true SQL calls via JDBC to access the same tables as the CMP entity bean?
E.g. the CMP entity bean would have the regular findByPrimaryKey, findAll, etc. methods, and the stateless session bean would have methods such as Count(), MaxSalary(), etc.
Or would this result in horrible caching issues?
-
CMP combined with Session beans using JDBC (6 messages)
- Posted by: Koen Rousseau
- Posted on: September 15 2002 03:54 EDT
Threaded Messages (6)
- CMP combined with Session beans using JDBC by srini sam on September 15 2002 08:50 EDT
- CMP combined with Session beans using JDBC by Eric Ma on September 15 2002 18:02 EDT
- CMP combined with Session beans using JDBC by Koen Rousseau on September 16 2002 01:37 EDT
-
CMP combined with Session beans using JDBC by gopal krishnan on September 16 2002 03:15 EDT
- CMP combined with Session beans using JDBC by Ferhat SAVCI on September 16 2002 04:50 EDT
-
CMP combined with Session beans using JDBC by gopal krishnan on September 16 2002 03:15 EDT
- CMP combined with Session beans using JDBC by Koen Rousseau on September 16 2002 01:37 EDT
- CMP combined with Session beans using JDBC by manish gour on September 16 2002 08:30 EDT
-
CMP combined with Session beans using JDBC[ Go to top ]
- Posted by: srini sam
- Posted on: September 15 2002 08:50 EDT
- in response to Koen Rousseau
Yes. EJB's are designed with the possibility that the same data store may be accessed by another legacy application concurrently. In fact, this is the prime reason for the overhead in the Entity Beans. You can control how much concurrency you would like by setting the Transaction Isolation level in the EJB.
It looks like you will only be reading the DB from the SLSB. Even if you update, it doesn't matter.
I am not sure if the EJB QL supports the functions you need. It has been a while since I looked at the specs.
Thanks...
-Srini Santhanam
RBC Dain Rauscher -
CMP combined with Session beans using JDBC[ Go to top ]
- Posted by: Eric Ma
- Posted on: September 15 2002 18:02 EDT
- in response to Koen Rousseau
I suggest that you don't use separate stateless session beans. Use entity beans's home methods. -
CMP combined with Session beans using JDBC[ Go to top ]
- Posted by: Koen Rousseau
- Posted on: September 16 2002 01:37 EDT
- in response to Eric Ma
In the meantime, I found out that aggregate functions (max, min, avg, count, ...) are in the 2.1 proposed final spec, but it will probably be a while before the application server vendors get their apps up to that level.
About the "Use entity bean's home methods":
Can I use JDBC statements inside a CMP entity bean home method? -
CMP combined with Session beans using JDBC[ Go to top ]
- Posted by: gopal krishnan
- Posted on: September 16 2002 03:15 EDT
- in response to Koen Rousseau
No jdbc calls shouldnt be made in a cmp. -
CMP combined with Session beans using JDBC[ Go to top ]
- Posted by: Ferhat SAVCI
- Posted on: September 16 2002 04:50 EDT
- in response to gopal krishnan
Posted by gopal krishnan 2002-09-16 02:15:19.0.
> No jdbc calls shouldnt be made in a cmp.
I see no reason for such a restriction, as long as both the CMP's data source and the JDBC datasource are XA compliant. -
CMP combined with Session beans using JDBC[ Go to top ]
- Posted by: manish gour
- Posted on: September 16 2002 08:30 EDT
- in response to Koen Rousseau
If your purpose of doing so it to get the highest Id then this can be done by creating a sequence and then using the nextval.This will give you the highest value.