Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 0 additions & 68 deletions hibernate/README-source.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -52,61 +52,9 @@ For example:
// build and run with standard server distribution
[[build_and_run_the_quickstart_with_server_dist]]
== Building and running the quickstart application with a {productName} server distribution
// Back Up the {productName} Standalone Server Configuration
include::../shared-doc/back-up-server-standalone-configuration.adoc[leveloffset=+2]
// Start the {productName} Standalone Server
include::../shared-doc/start-the-standalone-server.adoc[leveloffset=+2]

[[configure_the_server]]
=== Configure the Server

You can configure the server by running JBoss CLI commands. For your convenience, this quickstart batches the commands into a `configure-server.cli` script provided in the root directory of this quickstart.

. Before you begin, make sure you do the following:

* xref:back_up_standalone_server_configuration[Back up the {productName} standalone server configuration] as described above.
* xref:start_the_eap_standalone_server[Start the {productName} server with the standalone default profile] as described above.

. Review the `configure-server.cli` file in the root of this quickstart directory. This script adds datasource required for this quickstart.
. Open a new terminal, navigate to the root directory of this quickstart, and run the following command, replacing `__{jbossHomeName}__` with the path to your server:
+
[source,subs="+quotes,attributes+",options="nowrap"]
----
$ __{jbossHomeName}__/bin/jboss-cli.sh --connect --file=configure-server.cli
----
+
NOTE: For Windows, use the `__{jbossHomeName}__\bin\jboss-cli.bat` script.

+
You should see the following result when you run the script:
+
[source,options="nowrap"]
----
The batch executed successfully
----

. Stop the {productName} server.

=== Review the Modified Server Configuration

After stopping the server, open the `__{jbossHomeName}__/standalone/configuration/standalone.xml` file and review the changes.

. The following datasource was added to the `datasources` subsystem.
+
[source,xml,options="nowrap"]
----
<datasource jndi-name="java:jboss/datasources/HibernateQuickstartDS"
pool-name="HibernateQuickstartDS"
use-java-context="true">
<connection-url>jdbc:h2:mem:hibernate-quickstart;DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=-1</connection-url>
<driver>h2</driver>
<security>
<user-name>sa</user-name>
<password>sa</password>
</security>
</datasource>
----

// Build and Deploy the Quickstart
include::../shared-doc/build-and-deploy-the-quickstart.adoc[leveloffset=+2]

Expand All @@ -120,22 +68,6 @@ include::../shared-doc/run-integration-tests-with-server-distribution.adoc[level
// Undeploy the Quickstart
include::../shared-doc/undeploy-the-quickstart.adoc[leveloffset=+2]

// Restore the {productName} Standalone Server Configuration
include::../shared-doc/restore-standalone-server-configuration.adoc[leveloffset=+2]

// Additional information about this script
This script removes the datasource used for this quickstart. You should see the following result when you run the script:


[source,options="nowrap"]
----
The batch executed successfully
process-state: reload-required
----

// Restore the {productName} Standalone Server Configuration Manually
include::../shared-doc/restore-standalone-server-configuration-manual.adoc[leveloffset=+3]

// Build and run sections for other environments/builds
include::../shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc[leveloffset=+1]
include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1]
Expand Down
13 changes: 0 additions & 13 deletions hibernate/configure-server.cli

This file was deleted.

22 changes: 0 additions & 22 deletions hibernate/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -173,21 +173,10 @@
<configuration>
<discover-provisioning-info>
<version>${version.server}</version>
<!-- datasource added by CLI script -->
<failsOnError>false</failsOnError>
<add-ons>
<add-on>h2-database</add-on>
</add-ons>
</discover-provisioning-info>
<packaging-scripts>
<packaging-script>
<scripts>
<script>${basedir}/configure-server.cli</script>
</scripts>
<!-- Expressions resolved during server execution -->
<resolve-expressions>false</resolve-expressions>
</packaging-script>
</packaging-scripts>
</configuration>
<executions>
<execution>
Expand All @@ -211,21 +200,10 @@
<discover-provisioning-info>
<version>${version.server}</version>
<context>cloud</context>
<!-- datasource added by CLI script -->
<failsOnError>false</failsOnError>
<add-ons>
<add-on>h2-database</add-on>
</add-ons>
</discover-provisioning-info>
<packaging-scripts>
<packaging-script>
<scripts>
<script>${basedir}/configure-server.cli</script>
</scripts>
<!-- Expressions resolved during server execution -->
<resolve-expressions>false</resolve-expressions>
</packaging-script>
</packaging-scripts>
</configuration>
<executions>
<execution>
Expand Down
18 changes: 0 additions & 18 deletions hibernate/restore-configuration.cli

This file was deleted.

4 changes: 1 addition & 3 deletions hibernate/src/main/resources/META-INF/persistence.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
<persistence-unit name="primary">
<!-- If you are running in a production environment, add a managed
data source, this example data source is just for development and testing! -->
<!-- The datasource is deployed as WEB-INF/hibernate-quickstart-ds.xml, you
can find it in the source at src/main/webapp/WEB-INF/hibernate-quickstart-ds.xml -->
<jta-data-source>java:jboss/datasources/HibernateQuickstartDS</jta-data-source>
<jta-data-source>java:jboss/datasources/ExampleDS</jta-data-source>
<properties>
<!-- Properties for Hibernate -->
<property name="hibernate.hbm2ddl.auto" value="create-drop" />
Expand Down
Loading