从Google AppEngine切换到另一台服务器 [英] Switch from Google AppEngine to another server

查看:159
本文介绍了从Google AppEngine切换到另一台服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我正在Google AppEngine(GAE)上构建我的Java Web应用程序,但由于存在很多限制,我担心我将不得不从GAE切换到正在运行的自己的服务器Glassfish(或者我可以根据需要安装任何其他服务器)。另外我打算运行Oracle或MySql数据库。我需要做什么才能从GAE切换到我的服务器?我是否需要重写我的代码?我应该继续使用Datanucleus还是改用别的东西?还有什么? 解决方案

如果不知道如何编写应用程序,我们将无法给出很好的建议。您是否创建了一个数据访问层,将您的数据存储访问与业务逻辑分开?或者,您是否将应用程序引擎特定的对象传遍了整个地方?你使用的是gae用户服务吗?或memcache?



您应该做的第一件事是查看所有导入语句。任何时候当你看到com.google.something时,你都知道你需要改变它。您没有详细说明如何编写应用程序,但如果您问的是关于数据核的问题,那么您可能使用的是JDO或JPA,这意味着您可能能够重用大部分数据层。你可能有一堆你必须改变的关键字段,也可能是一些特定的注释。您可能需要仔细检查处理事务的方式,因为这在SQL数据库中可能会有所不同,因为它不像GAE那样使用实体组。


Currently I'm building my Java Web Application on Google AppEngine (GAE), but due to a lot of limitations they have I'm afraid that I'm going to have to switch from GAE to my own server which is running Glassfish (or I can setup any other server if needed). Also I'm planning to run Oracle or MySql databases. What do I need to do in order to switch from GAE to my server? Do I need to rewrite my code? Should I continue using Datanucleus or switch to something else? Anything else?

解决方案

We won't be able to give very good advice without knowing how you wrote your app. Did you create a data access layer that separates your datastore access from your business logic? Or do you pass app engine specific objects all over the place? Are you using the gae user service? or memcache?

The first thing you should do is look at all your import statements. Anytime you see a com.google.something in there, you know you need to change that. You didn't give much detail about how you wrote your app, but if you are asking about datanucleus you probably were using JDO or JPA, which means you may be able to reuse most of your data layer. You might have a bunch of Key fields which you'll have to change, and maybe a few gae specific annotations. You'll probably have to double check how you handle transactions, as that is likely to be different in a SQL database, which don't use entity groups like GAE does.

这篇关于从Google AppEngine切换到另一台服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆