Hi everybody,
I'm having a weird problem with a simple change in my datasource on JBoss AS 6, I'm changing the database name of my app, but when I deploy it and run the server it takes the old database, I don't know what I'm doing wrong, I'm using hibernate.
This is the original datasource:
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
<local-tx-datasource>
<jndi-name>ThotMainDS</jndi-name>
<connection-url>jdbc:jtds:sqlserver://localhost/THOT</connection-url>
<driver-class>net.sourceforge.jtds.jdbc.Driver</driver-class>
<user-name>sa</user-name>
<password>pass</password>
<check-valid-connection-sql>SELECT 1 FROM sysobjects</check-valid-connection-sql>
<metadata>
<type-mapping>MS SQLSERVER2008</type-mapping>
</metadata>
</local-tx-datasource>
</datasources>
After I change the database name:
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
<local-tx-datasource>
<jndi-name>ThotMainDS</jndi-name>
<connection-url>jdbc:jtds:sqlserver://localhost/THOTDEV</connection-url>
<driver-class>net.sourceforge.jtds.jdbc.Driver</driver-class>
<user-name>sa</user-name>
<password>pass</password>
<check-valid-connection-sql>SELECT 1 FROM sysobjects</check-valid-connection-sql>
<metadata>
<type-mapping>MS SQLSERVER2008</type-mapping>
</metadata>
</local-tx-datasource>
</datasources>
This is my persistence.xml
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
<persistence-unit name="ThotPersistenceUnit">
<jta-data-source>java:/ThotMainDS</jta-data-source>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect" />
<property name="hibernate.hbm2ddl.auto" value="validate" />
</properties>
</persistence-unit>
</persistence>
If I put a wrong database name, some that doesn't exist, the server shows the error.
Please help me, I'm stuck, thank you already