Table of contents
The Comments SQL store Store component adds the ability to connect your Runtime to a database for storing comments. It's an addition to the comment containers which are provided by the Dashboard plugin (see Container types), which use an in-memory DAO by default.
...
This component persists data in a database, that must be provided. See platform support for the supported databases.
UI Expand |
---|
|
The Comments SQL Store component can be used together with the Dashboard component. In this case the comments from the dashboard will be saved using the CommentDao implementation from the Comments SQL Store component. In order to use this component, the comments-sql-store profile must be active. More information on how to configure the application using Spring Profiles can be found here : Application configuration with Spring ProfilesUnzip the CommentsDao-Plugin-x.y.z.zip and copy the extracted folders to the runtime folder (make sure that the Include Page |
---|
| _HomeFolder | _HomeFolder | folder is merged).
UI Expand |
---|
|
Make sure to put the CommentsDao.dll file in the /bin directory of your .Net webapp In order to use this component, make sure to have the BlueriqComponentComments.dll in the /bin directory of your .NET webapp installation. |
Scripts to create the required database content are provided for the following databases:
- Microsoft SQL Server (download)
- Oracle (download)
- H2 (download) (we we do not recommend using using a H2 database in production environments)
- Microsoft SQL Server (download)
- Oracle (download)
Info |
---|
For customers that are upgrading an existing version of Blueriq, database upgrade scripts are provided in the Upgrade Instructions when applicable. |
UI Expand |
---|
|
Use the following steps to configure the datasource: - If necessary, create a new datasource. See See Configuring JDBC database connections in the Java webappdrivers for information on how to do this.Link the datasource to the comments DAO plugin. This can be done by editing
Include Page |
---|
_PropertiesFileJava | _PropertiesFileJava | in Include Page |
---|
_HomeFolder | _HomeFolder | directly or by using the Development plugin. So, either:Set the following property in Include Page |
---|
_PropertiesFileJava | _PropertiesFileJava | : Code Block |
---|
comments.dao.connection=commentsdao_datasource_name |
- In the development plugin Settings page, go to Connections -> Comments database and select the correct datasource.
An additional properties file named comments.dao.hibernate.properties can be used to set the Hibernate properties. Excerpt Include |
---|
_HibernateProperties | _HibernateProperties | nopanel | true |
---|
- Comments SQL Store component is using the main datasource to store data. The main datasource can be configured using JDBC or JNDI.
Using JDBC datasource : this can be configured in the application-externaldatasources.properties file. When configuring external datasources , the externaldatasources profile should be enabled. Code Block |
---|
language | powershell |
---|
title | application-externaldatasources.properties |
---|
| blueriq.datasource.main.url=jdbc:sqlserver://<database_url>:<port>;databaseName=bq_main;instance=SQL_EXPRESS
blueriq.datasource.main.username=<username>
blueriq.datasource.main.password=<password>
blueriq.datasource.main.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
blueriq.hibernate.main.hbm2ddl.auto=validate
blueriq.hibernate.main.dialect=org.hibernate.dialect.SQLServerDialect |
Using JNDI datasource : this can be configured in the application-jndidatasources.properties file When configuring JNDI datasources the jndidatasources profile should be enabled. Code Block |
---|
language | powershell |
---|
title | application-jndidatasources.properties |
---|
| blueriq.datasource.main.jndiName=java:/comp/env/jdbc/main
blueriq.hibernate.main.hbm2ddl.auto=validate
blueriq.hibernate.main.dialect=org.hibernate.dialect.SQLServerDialect |
- Configuring the datasource from the Development Dashboard
Go to Settings Widget → Datasources tab → On the left side menu : select Main datasource. The same properties are available for configuration as from the properties file. Make sure the corresponding profile is enabled (externaldatasources or jndidatasources) - Hibernate settings
These settings are done for each datasource type in the corresponding properties file, as in the examples above.
|
UI Expand |
---|
|
Configuring the database connection for the Comments SQL store Store component in .Net is done by adding a connection configuration to the Include Page |
---|
| _PropertiesFileNet |
---|
| _PropertiesFileNet |
---|
| file. Code Block |
---|
language | xml |
---|
title | .NET database configuration example |
---|
| <hibernate-configuration>
<session-factories>
<session-factory name="CommentsDao">
<properties>
<property name="connection.provider" value="NHibernate.Connection.DriverConnectionProvider" />
<property name="dialect" value="NHibernate.Dialect.MsSqlCeDialect" />
<property name="connection.driver_class" value="NHibernate.Driver.SqlServerCeDriver" />
<property name="connection.connection_string" value="Data Source=D:\Databases\CommentsDB.sdf" />
<property name="show_sql" value="false" />
<property name="current_session_context_class" value="Aquima.WebApplication.WebPersistenceUtility.Session.CurrentHibernateSessionContext, WebPersistenceUtility" />
</properties>
</session-factory>
</session-factories>
</hibernate-configuration> |
For more information about configuring database connections, see Configuring database connections in .Net webapp. Info |
---|
The Comments SQL store Store component looks for a database connection named "CommentsDao" so make sure that this name is used in order to configure the Comments DAO SQL Store properly. |
All necessary DLL files on which the Comments SQL store Store component depends can be found in the Pluginsthe /CommentsDao/Lib bin directory of the .NET webapp ZIP file. |