English 中文(简体)
B. 平行使用我的ql数据库时的考虑
原标题:Considerations when calling mysql database in parallel

I have to create an mysql database to be used by several applications in parallel for the first time. Up until this point my only experience with mysql databases have been single programs (for example webservers) querying the database. Now i am moving into a scenario where i will have several CXF java servlet type programs, as well as a background server editing and reading on the same schemas. I am using the Connector/J JDBC driver to connect to the database in all instances.

My question is this: What do i need to do in order to make sure that the parallel access does not become a problem. I realize that i need to use transactions where appropriate, but where i am truly lost is in the management. For example. Do i need to close the connection every time a servlet is done with a job? Do i need a unique user for each program accessing the database? Do i have to do something with my Connector/J objects? Do i have to declare my tables in a different way? Did i miss anything or is there something i failed to think about? I have a pretty good idea about how to handle transactions and the SQL itself, but i am pretty lost when it comes to what i need to do when setting up my database.

最佳回答

You should maintain a pool of connections. Connections are really expensive to create think on the order of of several hundred milliseconds. So for high volume apps it makes sense to cache and reuse them.

对于你的服务器,它取决于你使用什么集装箱。 象JBos这样的一些公司将作为集装箱的一部分提供集合。 可以通过数据来源定义加以界定,并通过日本国家空间数据基础设施加以利用。 其他集装箱,如游艇可能依靠C3PO。

大部分框架还沿用了结(近)方法的亚行连接的习俗,其逻辑是回到了联线。 你们应熟悉你具体执行工作的详细内容,确保你以得到支持的方式做事。

关于一致性考虑,你应熟悉乐观/悲观的锁定和交易孤立程度的概念。 只有在你提出申请的业务背景下才能确定正确的答案。

考虑到用户,大多数应用都有一个用户,即“阅读/标准用户”的申请。 该用户只应当有幸阅读和书写与申请相关的表格、指标、序号等记录。 申请的所有情况都将在其连接线上具体说明这一用户。

如果你熟悉上述概念,你就走了约95%的道路。

还有一点。 正如关于行政部门的评论所指出,贵国数据库发动机是一个巨大的考虑因素。 你们应当熟悉差异以及校对/配置选择。

问题回答

暂无回答




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签