RE: [JBoss-user] RE: Indexing of finders
Hiya Dain. > > That is me. I like this feature. Are you thinking about > > just adding an > > empty tag to the cmp-field element. Something like ? I've managed to do the first part, specifying the indexes in the jbosscmp-jdbc.xml file. I've included the changes made to the 3.0.2 download for you and the others to have a look at (sorry, that's what we have at present). Let me know what you think and tell me if there are any glaring problems with my code or assumptions. The bit I'm worried about the most is the executeSql method in JDBCStartCommand. I've written this to take a list of SQL statements and execute them within a single call, using batching if present. If I've understood the rest of the code in that file then the connection is being used outside of a transaction context. I have therefore turned off auto commit and explicitly used commit/rollback. Is this assumption correct? BTW I've only tested this on the hypersonic database which comes with jboss, I would like to hear from others about any problems. I have tried to keep the coding style of each part the same as the style used in each individual file (hence the different styles). I have occassionally lapsed into my standard style, executeSql is an example. I've attached a small example of the jbosscmp-jdbc.xml file to give people an idea of how they are specified. I intend to include the auto generated indexes at a later date, hence their inclusion in the code. I may not get a chance to start this for a few weeks though as I'm in the middle of packing to move house. > BTW Which CVS branch should I be using as a base for this? I'm > going to make the changes to our local source initially, which has > drifted from head, and then will look at moving it into CVS. It's > just so that I can try out the changes before updating our version > of jboss. Now that 3.2 is out I'll have a look at basing this code on that release. Kev P.S. I've included both mailing lists so that we can move this from jboss-user to jboss-devel. Kevin Conner Orchard Information Systems Limited Newcastle Technopole, Kings Manor Newcastle Upon Tyne, NE1 6PA. United Kingdom Registered in England, Number 1900078 Tel: +44 (0) 191-2032536 Fax: +44 (0) 191 2302515 jbosscmp-jdbc.xml Description: Binary data diffs Description: Binary data
RE: [JBoss-user] RE: Indexing of finders
> That is me. I like this feature. Are you thinking about > just adding an > empty tag to the cmp-field element. Something like ? I went through the entity deployment before I asked the original question and was thinking more along the lines of automatic index generation, i.e. if the finder is specified and the CMP engine can generate an index then it should apply it. Being a lazy developer :-), I would rather the CMP engine did this unless I had reason to believe that it was too costly. If it was too costly then I would like an option to switch it off and, potentially, override the generated indexes. I was thinking of making some changes to the jbosscmp-jdbc.xml file, nested within the entity element. Perhaps something like the following? ... XXX field1 ... fieldX ... If the indexes entry is specified then the CMP engine would not generate the indexes and would use the ones specified. Does this sound reasonable? I was also thinking of adding an entry to the defaults element which would indicate whether automatic generation was desirable. Perhaps something like the following? ... true I was going to start with this being false, developing the specified indexes part first :-) and then moving on to automatic generation. What do you think? BTW Which CVS branch should I be using as a base for this? I'm going to make the changes to our local source initially, which has drifted from head, and then will look at moving it into CVS. It's just so that I can try out the changes before updating our version of jboss. > You will have to add a template to the db confess like we do with > foreign key constraints. Thanks, I know about that. I've recently written a progress db mapping for the CMP engine. The jboss side was easy but progress jdbc seems to do something funny with catalogs, it reports a catalog name and then complains when you use it to check on the table's existence. I had to write a proxy driver class with a wrapper around the connection to hide it. The other problem is that it doesn't support the XA stuff :-(. Thanks, Kev Kevin Conner Orchard Information Systems Limited Newcastle Technopole, Kings Manor Newcastle Upon Tyne, NE1 6PA. United Kingdom Registered in England, Number 1900078 Tel: +44 (0) 191-2032536 Fax: +44 (0) 191 2302515 --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] RE: Indexing of finders
Kevin Conner wrote: > Do I understand from the rest of the thread that this is not > currently possible with JBossCMP? If so, is there any interest > in having it added? I'm willing to give it a go if the person > responsible for JBossCMP is available to bounce ideas off. > Is that you Dain? That is me. I like this feature. Are you thinking about just adding an empty tag to the cmp-field element. Something like ? You will have to add a template to the db confess like we do with foreign key constraints. -- Dain Sundstrom Chief Architect JBossCMP JBoss Group, LLC --- In remembrance www.osdn.com/911/ ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] RE: Indexing of finders
> I think he's talking about getting JBossCMP to generate a > 'CREATE INDEX' > statement at the time of table creation, to optimize the > database end of > the finder. > > speculation, but that's something I'd want. Except that it > never occured > to me and I always just added the indexes manually. Oh, well. That's exactly what I want. CMP is handling the creation of the tables and appropriate accesses but it does not seem to be indexing the fields used in finders. I know this is not part of EJBQL but then I never expected it to be, after all its job is to specify the finder logic not the implementation details. This is CMP engine specific, something which helps the particular CMP engine to execute the finder quickly. Do I understand from the rest of the thread that this is not currently possible with JBossCMP? If so, is there any interest in having it added? I'm willing to give it a go if the person responsible for JBossCMP is available to bounce ideas off. Is that you Dain? Kev Kevin Conner Orchard Information Systems Limited Newcastle Technopole, Kings Manor Newcastle Upon Tyne, NE1 6PA. United Kingdom Registered in England, Number 1900078 Tel: +44 (0) 191-2032536 Fax: +44 (0) 191 2302515 --- In remembrance www.osdn.com/911/ ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] RE: Indexing of finders
I think he's talking about getting JBossCMP to generate a 'CREATE INDEX' statement at the time of table creation, to optimize the database end of the finder. speculation, but that's something I'd want. Except that it never occured to me and I always just added the indexes manually. Oh, well. hth, danch Anthony Geoghegan wrote: > EJBQL (CMP 2.0) does not support ORDER BY statements. > Thus, I don't believe you can index a finder method in standard EJBQL. > The various JBoss specific QL overrides though support it (e.g.. JBossQL). > Is this what you mean? > > Best Regards, > Anthony Geoghegan. > J2EE Developer > CPS Ireland Ltd. > - Original Message - > From: "Kevin Conner" <[EMAIL PROTECTED]> > To: "'jboss users'" <[EMAIL PROTECTED]> > Sent: Tuesday, September 10, 2002 5:20 PM > Subject: [JBoss-user] RE: Indexing of finders > > > >>>I have a simple question which I hope will have a simple answer :-) >>> >>>I have been going through the jboss 3.0.2 source to try and find out >>>if there is any way to enable indexing for finder methods. So far I >>>have been unable to find any mechanism for achieving this. >>> >>>Can anyone tell me if this is possible and, if so, what I have missed >>>in enabling it? >> >>Sorry, forgot to add that this is for CMP entity beans with finders > > written > >>in EJBQL. >> >>Thanks, >>Kev >> >>Kevin Conner >>Orchard Information Systems Limited >>Newcastle Technopole, Kings Manor >>Newcastle Upon Tyne, NE1 6PA. United Kingdom >>Registered in England, Number 1900078 >>Tel: +44 (0) 191-2032536 Fax: +44 (0) 191 2302515 >> >> >>--- >>This sf.net email is sponsored by: OSDN - Tired of that same old >>cell phone? Get a new here for FREE! >>https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 >>___ >>JBoss-user mailing list >>[EMAIL PROTECTED] >>https://lists.sourceforge.net/lists/listinfo/jboss-user >> > > > > > --- > This sf.net email is sponsored by: OSDN - Tired of that same old > cell phone? Get a new here for FREE! > https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 > ___ > JBoss-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/jboss-user --- This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE! https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] RE: Indexing of finders
Kevin, Not sure what you are getting at. Typically, in the design phase, if you know you will be looking up records according to some field, you set up the database to index on that field. When the database receives a query it is smart enough to recognize when a lookup is being done on an indexed field and will then use the index. I don't get what you want to do in the finder methods. Kevin Conner wrote: > I have a simple question which I hope will have a simple answer :-) > > I have been going through the jboss 3.0.2 source to try and find out > if there is any way to enable indexing for finder methods. So far I > have been unable to find any mechanism for achieving this. > > Can anyone tell me if this is possible and, if so, what I have missed > in enabling it? Sorry, forgot to add that this is for CMP entity beans with finders written in EJBQL. Thanks, Kev Kevin Conner Orchard Information Systems Limited Newcastle Technopole, Kings Manor Newcastle Upon Tyne, NE1 6PA. United Kingdom Registered in England, Number 1900078 Tel: +44 (0) 191-2032536 Fax: +44 (0) 191 2302515 --- This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE! https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user -- Greg Turner, JBoss Authorized Consultant Tiburon Enterprise Systems http://www.tiburon-e-systems.com Box 1171 Tiburon, CA 94920 415-332-3363
Re: [JBoss-user] RE: Indexing of finders
EJBQL (CMP 2.0) does not support ORDER BY statements. Thus, I don't believe you can index a finder method in standard EJBQL. The various JBoss specific QL overrides though support it (e.g.. JBossQL). Is this what you mean? Best Regards, Anthony Geoghegan. J2EE Developer CPS Ireland Ltd. - Original Message - From: "Kevin Conner" <[EMAIL PROTECTED]> To: "'jboss users'" <[EMAIL PROTECTED]> Sent: Tuesday, September 10, 2002 5:20 PM Subject: [JBoss-user] RE: Indexing of finders > > I have a simple question which I hope will have a simple answer :-) > > > > I have been going through the jboss 3.0.2 source to try and find out > > if there is any way to enable indexing for finder methods. So far I > > have been unable to find any mechanism for achieving this. > > > > Can anyone tell me if this is possible and, if so, what I have missed > > in enabling it? > > Sorry, forgot to add that this is for CMP entity beans with finders written > in EJBQL. > > Thanks, > Kev > > Kevin Conner > Orchard Information Systems Limited > Newcastle Technopole, Kings Manor > Newcastle Upon Tyne, NE1 6PA. United Kingdom > Registered in England, Number 1900078 > Tel: +44 (0) 191-2032536 Fax: +44 (0) 191 2302515 > > > --- > This sf.net email is sponsored by: OSDN - Tired of that same old > cell phone? Get a new here for FREE! > https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 > ___ > JBoss-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/jboss-user > --- This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE! https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] RE: Indexing of finders
Can you be way more specific? What exactly would you want? Different SQL generated? Different default tables? -dain Kevin Conner wrote: >>I have a simple question which I hope will have a simple answer :-) >> >>I have been going through the jboss 3.0.2 source to try and find out >>if there is any way to enable indexing for finder methods. So far I >>have been unable to find any mechanism for achieving this. >> >>Can anyone tell me if this is possible and, if so, what I have missed >>in enabling it? > > > Sorry, forgot to add that this is for CMP entity beans with finders written > in EJBQL. > > Thanks, > Kev > > Kevin Conner > Orchard Information Systems Limited > Newcastle Technopole, Kings Manor > Newcastle Upon Tyne, NE1 6PA. United Kingdom > Registered in England, Number 1900078 > Tel: +44 (0) 191-2032536 Fax: +44 (0) 191 2302515 > > > --- > This sf.net email is sponsored by: OSDN - Tired of that same old > cell phone? Get a new here for FREE! > https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 > ___ > JBoss-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/jboss-user -- Dain Sundstrom Chief Architect JBossCMP JBoss Group, LLC --- This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE! https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] RE: Indexing of finders
> I have a simple question which I hope will have a simple answer :-) > > I have been going through the jboss 3.0.2 source to try and find out > if there is any way to enable indexing for finder methods. So far I > have been unable to find any mechanism for achieving this. > > Can anyone tell me if this is possible and, if so, what I have missed > in enabling it? Sorry, forgot to add that this is for CMP entity beans with finders written in EJBQL. Thanks, Kev Kevin Conner Orchard Information Systems Limited Newcastle Technopole, Kings Manor Newcastle Upon Tyne, NE1 6PA. United Kingdom Registered in England, Number 1900078 Tel: +44 (0) 191-2032536 Fax: +44 (0) 191 2302515 --- This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE! https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user