Bug #30925 | Get stack trace when saving a new rule to a name that already exists | ||
---|---|---|---|
Submitted: | 10 Sep 2007 6:48 | Modified: | 14 Oct 2008 16:26 |
Reporter: | Bill Weber | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Enterprise Monitor: Web | Severity: | S3 (Non-critical) |
Version: | 1.2.0.7481 | OS: | Any |
Assigned to: | Eric Herman | CPU Architecture: | Any |
Tags: | mer 121 |
[10 Sep 2007 6:48]
Bill Weber
[10 Sep 2007 21:13]
Peter Lavin
Added to the documentation as a known issue.
[12 May 2008 19:36]
Joshua Ganderson
This bug becomes somewhat more confused with the addition of internationalized rule names for certified rules. Do we complain that there's a duplicate rule only on the current user's localized rule name? What happens if the name put in conflicts with a rule for a different user's locale? The simple and straightforward solution is to add an indication that a rule is certified in the manage rules page. That way user's can name rules whatever they please and only be dealing with conflicts against other user named rules. Since these rules will have burned in names rather than localized, localization differences don't come into it. The one problem with this solution is that a user naming a rule the same as the KEY for the name of a certified rule will cause an error. However, that's an unlikely scenario. If it becomes an issue, we could special case it and provide a more meaningful error OR do some hack that prepends something to the user generated name and strips it off for display. Other than the new snags pointed out above, I believe name collisions should cause a UI error rather than a stack trace on the error page. However, I can't confirm this since rule creation seems to be broken. I will set this to verified until the behavior can be determined.
[4 Sep 2008 19:01]
Bill Weber
with 2.0.0.7044 get following stack trace: 2008-09-04 11:53:53,254 ERROR [http-18080-1:com.mysql.misc] could not insert: [com.mysql.etools.monitor.pom.hib.HibRule] org.hibernate.exception.ConstraintViolationException: could not insert: [com.mysql.etools.monitor.pom.hib.HibRule] at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:40) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2163) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2643) at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:51) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279) at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:298) at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:181) at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:107) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:187) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:172) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:94) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70) at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:507) at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:499) at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:495) at sun.reflect.GeneratedMethodAccessor53.invoke(Unknown Source) ... Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry 'Attempted Connections To The Server Have Failed - copy 1' for key 2 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at com.mysql.jdbc.Util.handleNewInstance(Util.java:406) at com.mysql.jdbc.Util.getInstance(Util.java:381) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1015) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3512) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3444) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1948) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2081) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2554) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1751)
[9 Oct 2008 17:13]
Bill Weber
verified fixed in build 2.0.0.7072
[14 Oct 2008 16:26]
Tony Bedford
An entry was added to the 2.0 changelog: Saving a rule with a name that already existed resulted in a stack trace in the window, instead of a more user-friendly error message.