[jboss-jira] [JBoss JIRA] Commented: (EJBTHREE-1171) DDL in NativeQuery error rollbacks only Entity changes leaves nativequery executes committed
Carlo de Wolf (JIRA)
jira-events at lists.jboss.org
Fri Jan 4 08:59:43 EST 2008
[ http://jira.jboss.com/jira/browse/EJBTHREE-1171?page=comments#action_12393851 ]
Carlo de Wolf commented on EJBTHREE-1171:
-----------------------------------------
Please provide the full source code of your bean.
> DDL in NativeQuery error rollbacks only Entity changes leaves nativequery executes committed
> --------------------------------------------------------------------------------------------
>
> Key: EJBTHREE-1171
> URL: http://jira.jboss.com/jira/browse/EJBTHREE-1171
> Project: EJB 3.0
> Issue Type: Bug
> Affects Versions: AS 4.2.1.GA
> Environment: Windows XP Sp2, Oracle 10.2.0.2.0
> Reporter: Guillermo Guisado
>
> If the following code of a Stateless Session bean fails in the 5th line, the statement in the 3rd line does not rollback
> 0 User user = new User(userId);
> 1 myEntityManager.persist(user);
> 2 String insertUserInOldTable = "insert into olduserstable values('" + userId + "');
> 3 myEntityManager.createNativeQuery(insertUserInOldTable ).executeUpdate();
> 4 String userCreate = "CREATE USER " + userId + " IDENTIFIED BY " + userPassword + " DEFAULT TABLESPACE TB1 TEMPORARY TABLESPACE TEMPORARY PROFILE P1"; // let say this fails because a user exists or the password does not conform the security measures
> 5 myEntityManager.createNativeQuery(userCreate).executeUpdate();
> If the failing code is not DDL the 3rd line does rollback normally
> 0 User user = new User(userId);
> 1 myEntityManager.persist(user);
> 2 String insertUserInOldTable = "insert into olduserstable values('" + userId + "');
> 3 myEntityManager.createNativeQuery(insertUserInOldTable ).executeUpdate();
> 4 String userCreate = "dummy sql to fail";
> 5 myEntityManager.createNativeQuery(userCreate).executeUpdate();
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list