File tree Expand file tree Collapse file tree
java/server/src/org/openqa/selenium/grid/sessionmap/jdbc Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -89,9 +89,8 @@ public static SessionMap create(Config config) {
8989 public boolean add (Session session ) {
9090 Require .nonNull ("Session to add" , session );
9191
92- try {
93- return insertSessionStatement (session ).executeUpdate () >= 1 ;
94-
92+ try (PreparedStatement statement = insertSessionStatement (session )) {
93+ return statement .executeUpdate () >= 1 ;
9594 } catch (SQLException e ) {
9695 throw new JdbcException (e );
9796 }
@@ -105,7 +104,7 @@ public Session get(SessionId id) throws NoSuchSessionException {
105104 Capabilities caps = null ;
106105 String rawUri = null ;
107106
108- try (ResultSet sessions = readSessionStatement (id ).executeQuery ()){
107+ try (PreparedStatement statement = readSessionStatement (id ); ResultSet sessions = statement .executeQuery ()) {
109108 if (!sessions .next ()) {
110109 throw new NoSuchSessionException ("Unable to find..." );
111110 }
You can’t perform that action at this time.
0 commit comments