On Monday 26 November 2001 19:08, danch wrote: > Peter Levart wrote: > > What about using finder methods like in BMP EBs? The responsibility of a > > BMP finder method is to return a Collection of primary keys. That's easy > > to do with JDBC/SQL. There would only have to be a way to apply BMP > > finders to CMP beans and we'll have dynamic SQL already. > > > > Currently I'm using JDBC/SQL to retrieve primary keys and then a loop of > > findByPrimaryKey() for each key to obtain Local interfaces and it takes > > about 1-2 seconds per 30 objects. The abovementioned BMP finders would > > speed things up considerably since it would only take one invocation... > > That may still takes n+1 DB hits - remember that the BMP finder returns > a set of keys - beyond that you're OK if the bean is already in cache > (commit option A). If you're doing all this from a session bean (in > transaction) it shouldn't be any faster with a BMP finder than what > you're doing. Unless I'm missing something big. >
DB hits are one thing. I don't know if read-ahead option in JBossCMP is used for anything else than relations, but it would be a great idea to apply this to finders also. The other thing are invocations. Even if I use Local interfaces to call a bean from an already established transaction context, the invocations have to pass all the interceptors, etc. I was hoping that building the Local interface from the primary key does not have to hit the DB until some accessors in the Local interface are called, so building a lot of local interfaces should be cheap if it is done during one invocation (a call to finder method). Peter _______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development