{"action":"created","issue":{"url":"https://api.github.com/repos/ControlSystemStudio/cs-studio/issues/1342","labels_url":"https://api.github.com/repos/ControlSystemStudio/cs-studio/issues/1342/labels{/name}","comments_url":"https://api.github.com/repos/ControlSystemStudio/cs-studio/issues/1342/comments","events_url":"https://api.github.com/repos/ControlSystemStudio/cs-studio/issues/1342/events","html_url":"https://github.com/ControlSystemStudio/cs-studio/issues/1342","id":106022062,"number":1342,"title":"o.c.alarm.beast.msghist.rdb: locks database for transaction on select","user":{"login":"berryma4","id":854021,"avatar_url":"https://avatars.githubusercontent.com/u/854021?v=3","gravatar_id":"","url":"https://api.github.com/users/berryma4","html_url":"https://github.com/berryma4","followers_url":"https://api.github.com/users/berryma4/followers","following_url":"https://api.github.com/users/berryma4/following{/other_user}","gists_url":"https://api.github.com/users/berryma4/gists{/gist_id}","starred_url":"https://api.github.com/users/berryma4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/berryma4/subscriptions","organizations_url":"https://api.github.com/users/berryma4/orgs","repos_url":"https://api.github.com/users/berryma4/repos","events_url":"https://api.github.com/users/berryma4/events{/privacy}","received_events_url":"https://api.github.com/users/berryma4/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/ControlSystemStudio/cs-studio/milestones/33","html_url":"https://github.com/ControlSystemStudio/cs-studio/milestones/4.1.4%20-%20stable%20(4.1.x%20branch)","labels_url":"https://api.github.com/repos/ControlSystemStudio/cs-studio/milestones/33/labels","id":1213209,"number":33,"title":"4.1.4 - stable (4.1.x branch)","description":"","creator":{"login":"berryma4","id":854021,"avatar_url":"https://avatars.githubusercontent.com/u/854021?v=3","gravatar_id":"","url":"https://api.github.com/users/berryma4","html_url":"https://github.com/berryma4","followers_url":"https://api.github.com/users/berryma4/followers","following_url":"https://api.github.com/users/berryma4/following{/other_user}","gists_url":"https://api.github.com/users/berryma4/gists{/gist_id}","starred_url":"https://api.github.com/users/berryma4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/berryma4/subscriptions","organizations_url":"https://api.github.com/users/berryma4/orgs","repos_url":"https://api.github.com/users/berryma4/repos","events_url":"https://api.github.com/users/berryma4/events{/privacy}","received_events_url":"https://api.github.com/users/berryma4/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":16,"state":"open","created_at":"2015-07-17T16:30:19Z","updated_at":"2015-09-11T14:30:47Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2015-09-11T14:30:47Z","updated_at":"2015-09-11T17:29:14Z","closed_at":null,"body":"It seems if someone attempts a very large search from the alarm message history ui, it locks out other actions for all users during this transaction (ie. disabling areas).\r\n@kasemir \r\n\r\n```java\r\njava.sql.SQLException: Lock wait timeout exceeded; try restarting transaction\r\n\tat com.mysql.jdbc.SQLError.createSQLException(SQLError.java:998)\r\n\tat com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3847)\r\n\tat com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3783)\r\n\tat com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2447)\r\n\tat com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2594)\r\n\tat com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2545)\r\n\tat com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1901)\r\n\tat com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2113)\r\n\tat com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2049)\r\n\tat com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2034)\r\n\tat org.csstudio.alarm.beast.client.AlarmConfiguration.updatePVEnablement(AlarmConfiguration.java:622)\r\n\tat org.csstudio.alarm.beast.ui.clientmodel.AlarmClientModel.enable(AlarmClientModel.java:759)\r\n\tat org.csstudio.alarm.beast.ui.actions.DisableComponentAction.run(DisableComponentAction.java:80)\r\n\tat org.eclipse.jface.action.Action.runWithEvent(Action.java:519)\r\n\tat org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:595)\r\n\tat org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:511)\r\n\tat org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:420)\r\n\tat org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)\r\n\tat org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353)\r\n\tat org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061)\r\n\tat org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4172)\r\n\tat org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761)\r\n\tat org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)\r\n\tat org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)\r\n\tat org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)\r\n\tat org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)\r\n\tat org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)\r\n\tat org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)\r\n\tat org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)\r\n\tat org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)\r\n\tat org.csstudio.utility.product.Workbench.runWorkbench(Workbench.java:103)\r\n\tat org.csstudio.startup.application.Application.startApplication(Application.java:264)\r\n\tat org.csstudio.startup.application.Application.start(Application.java:118)\r\n\tat org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)\r\n\tat org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)\r\n\tat org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)\r\n\tat org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)\r\n\tat org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)\r\n\tat java.lang.reflect.Method.invoke(Unknown Source)\r\n\tat org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)\r\n\tat org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)\r\n\tat org.eclipse.equinox.launcher.Main.run(Main.java:1465)\r\n```\r\n\r\nI see that o.c.alarm.beast.msghist.rdb.MessageRDB.java:83\r\ndoesn't mark the connection as read only.\r\n```java\r\n final String sql_txt = sql.createSelect(rdb_util, filters);\r\n        final PreparedStatement statement =\r\n            rdb_util.getConnection().prepareStatement(sql_txt);\r\n```\r\n\r\npurposing:\r\n```java\r\nfinal String sql_txt = sql.createSelect(rdb_util, filters);\r\n        final Connection connection = rdb_util.getConnection();\r\n        connection.setReadOnly(true);\r\n        final PreparedStatement statement =\r\n                connection.prepareStatement(sql_txt);\r\n```"},"comment":{"url":"https://api.github.com/repos/ControlSystemStudio/cs-studio/issues/comments/139607350","html_url":"https://github.com/ControlSystemStudio/cs-studio/issues/1342#issuecomment-139607350","issue_url":"https://api.github.com/repos/ControlSystemStudio/cs-studio/issues/1342","id":139607350,"user":{"login":"kasemir","id":1932421,"avatar_url":"https://avatars.githubusercontent.com/u/1932421?v=3","gravatar_id":"","url":"https://api.github.com/users/kasemir","html_url":"https://github.com/kasemir","followers_url":"https://api.github.com/users/kasemir/followers","following_url":"https://api.github.com/users/kasemir/following{/other_user}","gists_url":"https://api.github.com/users/kasemir/gists{/gist_id}","starred_url":"https://api.github.com/users/kasemir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kasemir/subscriptions","organizations_url":"https://api.github.com/users/kasemir/orgs","repos_url":"https://api.github.com/users/kasemir/repos","events_url":"https://api.github.com/users/kasemir/events{/privacy}","received_events_url":"https://api.github.com/users/kasemir/received_events","type":"User","site_admin":false},"created_at":"2015-09-11T17:29:14Z","updated_at":"2015-09-11T17:29:14Z","body":"Yes, very good idea!\r\nThanks."}}