hibernate - Multiple JPA persistence units pointing to same database? -


can have more 1 jpa persistence units pointing same database, in different java projects , deployed on server @ same time? same time mean, not deployed @ same second deployed together. using hsqldb database.

i having client-server model project. have 1 single unified database table in server fills data , client access data in different project. can populate database through server. when deploy client project data database gets erased.

i using <property name="hibernate.hbm2ddl.auto" value="update" /> both persistence units.

can have more 1 jpa persistence units pointing same database, in different java projects , deployed on server @ same time?

as long don't have incompatible mappings in both projects, should work. won't able use second level caching though.

but when deploy client project data database gets erased. (...)

that's not behavior i'd expect hbm2ddl.auto set update don't know if behavior defined when used in "cluster-like" environment (with several jvms performing update in same time).

what happens when deploy client once server part done initializing?

my advices:

  • setup logging see happening exactly
  • if sharing same entities, maybe don't update on client , server (although shouldn't problem if done 1 after other).
  • ultimately, don't use update @ on production database.

Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -