java - The proper way to deploy a Hibernate-based J2EE app to a remote server -


I have a huge demonic Java app in development here. So far, it is only installed on my locally installed Tomcat / MySQL has been deployed on setup.

For completeness, the app is an online game server using Spring, Hibernate with a MySQL currently on a backend.

Now, I can easily package up warfare and get it on a remote server. The problem is that the database is now just being generated with an ANT script that is hibernate (in particular, HBM2DDL ant functions) to generate schema, and then the DB is a static SQL and some ant-based parser, which is the other data (XML mostly). After that, I have a fully prepared DB that is populated with the "Start" data set from game server.

The issue is going to be slightly green in Java. I do not know what is the correct way to deploy it.

Do I want to:

  1. Export SQL from your local MySQL and manually import it to new server? Oh, is that so.
  2. Make ANT script less grody (it has a lot of hardcode directories right now) and run it on the server?
  3. Elegant alternatives I do not know?

The other complexity is that the war on MySQL DB is going on a different server. Is there a Java book or web resource that addresses these types of deployment broadly?

I think 3 options:

  1. DB on remote machine Change your ANT script to target. You can run it on your local machine, so you do not have to change it: it will get the necessary files in the same place. The main drawback of this method is that executing a lot of SQL over a network (Internet) can be slow.
  2. Export schema to your new database from your local (build) database This is not SQL, if your database supports some binary format, it is usually the fastest and least error prone to do this The method is, though there may be some very subtle problems if the configuration of remote DB is slightly different from your local setup (such as the character set).
  3. Run an NT script on your server; The biggest problem with this is that your database server should have all the necessary tools (such as ant and Java), but all source files (hibernate mapping) (Being a database server) does not need it.

Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -