Jpa Saga persistence + hibernate entity manager looking for tables in different schemas


I am implementing jpa persistence using hiberante-entity manager in a java web project. I have set following property in in persistence.xml.

<property name="" value="update"/>

I have a schema for each user. For e.g i have a schema for user1 and one for user2. If the table ‘ABC’ is present in user1 schema but not in user2 schema & I deploy the application and it uses user2 db credentials, i get the message ‘user1.ABC’ table found so the ‘ABC’ table is not created in user2 schema.

When i tried with following property in the persistence.xml file the table is created in the user2 schema.

 <property name="" value="create"/>   

My question is why hibernate is searching in another schema i.e user1 if the application is using user2 db credentials? and I don’t want to create the schema every time the server is started so how can i avoid using the value ‘create’.

EDIT: Below is my persistence.xml file

    <persistence xmlns="" version="1.0">
    <persistence-unit name="XXXXXX" transaction-type="RESOURCE_LOCAL">


        <property name="hibernate.archive.autodetection" value="class"/>
        <property name="" value="update"/> 

Thanks in advance



Hi Prashant,

this seems more a hibernate issue than an Axon one. You might be better off asking this in the hibernate community.

Make sure you use the correct URL. For some database types, the database/schema to use is configured in the connection url.