@@ -25,3 +25,42 @@ After the sessionmap server successfully starts, you should see some log lines a
252515:22:55.136 INFO [KqueueProvider.<clinit>] - Starting with kqueue library
262615:22:55.328 INFO [SessionMapServer.execute] - Started Selenium session map 4.0.0-alpha-7 (revision a5536dfb7b*): http://192.168.0.5:5556
2727```
28+ 2. JdbcBackedSessionMap
29+ ========================
30+
31+ `JdbcBackedSessionMap` uses the JDBC API to talk to the JDBC driver and use related database for sessions map store.
32+
33+ The table name used to store sessions is : sessions_map
34+ It consists of three columns of string datatype : session_ids, session_caps, session_uri
35+
36+ Prerequisites
37+ 1. Ensure the appropriate JDBC driver jar is downloaded on the host machine.
38+ 2. Ensure the "sessions_map" table with varchar "session_ids", "session_caps" and "session_uri" columns is created in the database.
39+
40+ Example of creating the table:
41+ `CREATE TABLE sessions_map
42+ (
43+ session_ids varchar(1000),
44+ session_caps varchar(1000),
45+ session_uri varchar(1000)
46+ );`
47+ Here the limit for varchar type is given 1000 as an arbitrary number in the example. Ensure the datatype and limit matches the selected database.
48+ Also, the limit for varchar type should be able to accommodate the capabilities json stored in "sessions_caps".
49+
50+ Below are the steps to start a `JdbcBackedSessionMap`.
51+
52+ 1. Set an environment variable using `export SESSIONS_IMPLEMENTATION='org.openqa.selenium.grid.sessionmap.jdbc.JdbcBackedSessionMap'`
53+ 3. Build the grid deployment jar by running the command
54+ `bazel build grid`
55+ 2. Start the JdbcBackedSessionMap using the command
56+ `java -jar <path/to/grid/jar> --ext path/to/selenium/bazel-bin/java/server/src/org/openqa/selenium/grid/sessionmap/jdbc/libjdbc.jar:path/to/jdbc-driver.jar sessions --jdbc-user "<jdbc_user>" --jdbc-password "<jdbc_password>" --jdbc-url "<jdbc_url>"`
57+
58+ After the sessionmap server successfully starts, you should see some log lines as below:
59+ ```
60+ 15:05:20.345 INFO [LoggingOptions.getTracer] - Using OpenTelemetry for tracing
61+ 15:05:20.348 INFO [LoggingOptions.createTracer] - Using OpenTelemetry for tracing
62+ 15:05:20.439 INFO [UnboundZmqEventBus.<init>] - Connecting to tcp://*:4442 and tcp://*:4443
63+ 15:05:20.489 INFO [UnboundZmqEventBus.<init>] - Sockets created
64+ 15:05:20.492 INFO [UnboundZmqEventBus.lambda$new$2] - Bus started
65+ 15:05:21.483 INFO [SessionMapServer.execute] - Started Selenium session map 4.0.0-alpha-7 (revision 857fe401ae): http://192.168.29.132:5556
66+ ```
0 commit comments