Bugs item #858828, was opened at 2003-12-12 12:56
Message generated for change (Comment added) made by loubyansky
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=858828&group_id=22866

Category: JBossCMP
Group: v3.2
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Rafal Kedziorski (rafciom)
Assigned to: Alexey Loubyansky (loubyansky)
Summary: Wrong SQL queries ...

Initial Comment:
Hi,

I'm working currently with the actual sources from CVS.
Last update on 11.12.2003 and I get wrong queries for
my Entity Bean:

/**
 * Description of the Class
 *
 * @author    MAGIX AG
 * @version   $Id: Setting_2_System_GroupBean.java,v
1.6 2003/12/05 14:19:52 rafal Exp $
 * @ejb.bean
 *       name = "Setting_2_System_GroupBean"
 *       description = "Setting_2_System_Group Entity Bean"
 *       display-name = "Setting_2_System_Group Entity
Bean"
 *       local-jndi-name =
"setting/Setting_2_System_GroupBean"
 *       view-type = "local"
 *       type = "CMP"
 *       cmp-version = "2.x"
 *       schema = "setting_2_system_group"
 *       primkey-field = "setting_2_system_group_id"
 *
 * @ejb.finder
 *       view-type = "local"
 *       signature = "java.util.Collection
findAllBySystemGroupId(java.lang.Integer system_group_id)"
 *       query = "SELECT OBJECT(o) FROM
setting_2_system_group o WHERE o.system_group_id = ?1"
 *       result-type-mapping = "Local"
 *
 * @ejb.finder
 *       view-type = "local"
 *       signature =
"net.magix.ejb.access.entitybeans.Setting_2_System_GroupBeanLocalHome
findBySettingIdAndSystemGroupId(java.lang.Integer
setting_id, java.lang.Integer system_group_id)"
 *       query = "SELECT OBJECT(o) FROM
setting_2_system_group o WHERE o.setting_id = ?1 AND
o.system_group_id = ?2"
 *       result-type-mapping = "Local"
 *
 * @ejb.security-identity
 *       use-caller-identity = "true"
 *
 * @ejb.transaction
 *       type = "Mandatory"
 *
 * @jboss.persistence
 *       row-locking = "true"
 *       list-cache-max = "200"
 *       table-name = "setting_2_system_group"
 *
 * @jboss.table-name
 *       table-name = "setting_2_system_group"
 *
 * @jboss.container-configuration
 *       name = "Standard CMP 2.x EntityBean"
 *
 * @jboss.read-ahead
 *       strategy = "on-find"
 *       page-size = "4"
 *       eager-load-group = "*"
 *
 * @jboss.entity-command
 *       name = "mysql-get-generated-keys"
 *
 */
public abstract class Setting_2_System_GroupBean
extends AbstractEntityBean implements EntityBean {
...
}

For the code above I get:

SELECT t0_o.setting_2_system_group_id, t0_o.setting_id,
t0_o.system_group_id, t0_o.value FROM
setting_2_system_group t0_o WHERE (t0_o.setting_id =
200 AND t0_o.system_group_id = 3) FOR UPDATE OF
t0_o.setting_2_system_group_id, t0_o.setting_id,
t0_o.system_group_id, t0_o.value


And after changing the strategy to on-load I get this one:

SELECT t0_o.setting_2_system_group_id FROM
setting_2_system_group t0_o WHERE (t0_o.setting_id =
200 AND t0_o.system_group_id = 3)


Regards,
Rafal

----------------------------------------------------------------------

>Comment By: Alexey Loubyansky (loubyansky)
Date: 2003-12-12 18:01

Message:
Logged In: YES 
user_id=543482

The FOR UPDATE OF syntax was hardcoded. Now it is taken from
the vendor specific type mapping following row-locking-template.
Fixed in 3.2.4RC1.
Thanks.

----------------------------------------------------------------------

Comment By: Rafal Kedziorski (rafciom)
Date: 2003-12-12 15:17

Message:
Logged In: YES 
user_id=201737

Hi,

for strategy = "on-find" and row-locking = "true" so:

SELECT t0_o.setting_2_system_group_id, t0_o.setting_id,
t0_o.system_group_id, t0_o.value FROM
setting_2_system_group t0_o WHERE (t0_o.setting_id =
200 AND t0_o.system_group_id = 3) FOR UPDATE OF
t0_o.setting_2_system_group_id, t0_o.setting_id,
t0_o.system_group_id, t0_o.value

And MySQL told me:

You have an error in your SQL syntax.  Check the manual that
corresponds to your MySQL server version for the right
syntax to use near 'OF t0_o.setting_2_system_group_id,
t0_o.setting_id, t0_o.system

And after change sthe strategy to "on-load" this query:

SELECT t0_o.setting_2_system_group_id FROM
setting_2_system_group t0_o WHERE (t0_o.setting_id =
200 AND t0_o.system_group_id = 3)


Regards,
Rafal

----------------------------------------------------------------------

Comment By: Alexey Loubyansky (loubyansky)
Date: 2003-12-12 14:16

Message:
Logged In: YES 
user_id=543482

How do the expected SQL queries look like?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=858828&group_id=22866


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to