DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
...
It's proposed to introduce SessionContext API that is available from the functions and provides access to the attributes in all levels order (call, application, connection).
...
#setClientInfo is arbitrary. The documentation recommends strictly limiting the set of attributes, but this is not necessary. For example, Oracle does not have such a limitation [5]. The setClientInfo array is completely translated into the ApplicationAttributes array.setClientInfo are passed along with each JdbcRequest (this requires a new feature in JdbcThinFeature)....
| Code Block | ||
|---|---|---|
| ||
// JDBC connection to Ignite server.
try (Connection conn = DriverManager.getConnection(URL)) {
conn.setClientInfo("SESSION_ID", "1234");
...
}
|
SessionContext is an entrypoint for accessing attributes on all levels and other session-level data (e.g. SecurutySubject
...
).
...
Ignite provides SessionContextProviderResource to access to SessionContext.
CacheInterceptor or QuerySqlFunction target class for every call (every row or key).SessionContext from Ignite thread.QuerySqlFunction to inject the resource.| Code Block | ||
|---|---|---|
| ||
/** SessionContext interface. It's an entrypoint for all attributes. */
public class SessionContext {
/** @return Attribute by name. */
public @Nullable String getAttribute(String attrName);
/** @return Current SecuritySubject. */
public @Nullable SecuritySubject getSecuritySubject();
}
/** Example, use it in QuerySqlFunction. */
public static class UserDefinedFunctions {
/** Injection performs once per query. */
@SessionContextProviderResource
public SessionContextProvider sesCtxProv;
/** @return Session ID set with application attributes. */
@QuerySqlFunction
public @Nullable String sessionId() {
SessionContextreturn sesCtx = sesCtxProv.getSessionContext();
return sesCtx == null ? null : sesCtx.getAttribute("SESSION_ID");
}
}
|
...
https:// Links to discussions on the devlist, if applicable.lists.apache.org/thread/c5j5yykr6tfrnp9zprhg9j69w63r11zx
...