Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1298627
  • 博文数量: 127
  • 博客积分: 2286
  • 博客等级: 大尉
  • 技术积分: 1943
  • 用 户 组: 普通用户
  • 注册时间: 2010-06-10 10:37
文章分类

全部博文(127)

文章存档

2018年(1)

2015年(2)

2014年(1)

2013年(30)

2012年(88)

2011年(5)

分类: Mysql/postgreSQL

2012-01-30 13:47:19

flexAsynch只能本地连接,而且使用缺省的1186端口,这个真是情况下肯定不够用

diff flexAsynch.cpp.71 flexAsynch.cpp

198c198
< static Ndb_cluster_connection * g_cluster_connection = 0;
---
> static Ndb_cluster_connection *g_cluster_connection[1024];
264c264
< g_cluster_connection = new Ndb_cluster_connection [tConnections];
---
> // g_cluster_connection = new Ndb_cluster_connection [tConnections];
269a270
>
272,273c273,282
< if(g_cluster_connection[i].connect(12, 5, 1) != 0)
< return NDBT_ProgramExit(NDBT_FAILED);
---
> if (i % 2 == 0)
> {
> g_cluster_connection[i] = new Ndb_cluster_connection("db1:1186");
>
> }else
> {
> g_cluster_connection[i] = new Ndb_cluster_connection("db2:1186");
> }
> if(g_cluster_connection[i]->connect(12, 5, 1) != 0)
> return NDBT_ProgramExit(NDBT_FAILED);
281c290
< Ndb * pNdb = new Ndb(g_cluster_connection+0, "TEST_DB");
---
> Ndb * pNdb = new Ndb(g_cluster_connection[0], "TEST_DB");
636c645,651
< delete [] g_cluster_connection;
---
> // delete [] g_cluster_connection;
> for (int i = 0; i < tConnections; i++)
> {
> delete g_cluster_connection[i];
> }
>
>
656c671
< localNdb = new Ndb(g_cluster_connection+(threadNo % tConnections), "TEST_DB");
---

> localNdb = new Ndb(g_cluster_connection[threadNo % tConnections], "TEST_DB");


阅读(1854) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~