AcquireConnection 方法调用失败,错误代码为 0x80040154 : 没有注

解决SSIS在64位环境下的AcquireConnection方法调用失败问题
本文详细描述了如何解决在64位操作系统环境下使用SSIS(SQL Server Integration Services)时遇到的AcquireConnection方法调用失败问题。通过设置运行时属性为False来选择32位执行,从而解决了错误代码0x80040154导致的无法连接数据源的问题。

[查找 [142]] 错误: 对连接管理器“LocalHost.jxwfkjlweb”的 AcquireConnection 方法调用失败,错误代码为 0x80040154。
[连接管理器“LocalHost.jxwfkjlweb”] 错误: 没有注册类别

 

========================

环境: 64位server2003

           64位sqlserver2005

原因: 64位的ssis少了很多可用的数据源

 

解决:

在 Integration Services 包的“项目属性”中,通过在“调试”页上设置 Run64BitRuntime 属性的值为 False 以选择 32 位执行

 

步骤:顶部菜单-项目-属性(或....属性)-调试-在“调试”页上设置 Run64BitRuntime 属性的值为 False

 

==========================

 

后记:

该问题困扰了好久好久,百度一直没有找到解决办法,今特记录下找到该方法的解决过程

 

复制 “AcquireConnection 方法调用失败,错误代码为 0x80040154。”错误信息到http://fanyi.youdao.com/translate  有道翻译

 

翻译结果为:AcquireConnection method calls failure, the error code 0x80040154.

 

然后复制上面语句到google查询(百度好久没找到结果,换google试试了)

 

查询结果发现正确的语法语句应该是

The AcquireConnection method call failed with error code 0x80040154.

 

 

于是把上面语句再google一边 ,发现 code 0xC0202009 的很多 ,于是就提取 AcquireConnection 和 error code 0x80040154 做为关键字查询

选择第二条查询结果

SSIS Excel Connection Manager Error : The Official Microsoft ASP ...

 

 

 

 

 

 

 

 

 

 

 

 

 

The AcquireConnection method call to the connection manager "Excel
Connection Manager" failed with error code 0xC0202009. ... Source: "Microsoft
OLE DB Service Components" Hresult: 0x80040154 Description: "Class ...
forums.asp.net/t/1391496.aspx/1 - 网页快照 - 类似结果
点进去,在如下处发现了答案  Run64BitRunTime

Re: SSIS Excel Connection Manager Error

Mar 02, 2009 12:01 PM|LINK

This issue is occuring because you are having a 64 bit OS and Office Excel (including most of the office products) does not have 64bit provider and hence the error above on Excel connection.

You can solve this issue by setting Run64BitRunTime property as False

Go to properties page for the overall SSIS solution, simply set the Run64BitRunTime = False.

Thanks,

Anoop

 

英文难看懂,然后百度Run64BitRunTime  ssis  接搜索到很多解决办法了

桌面ANR了,anr日志如下: "main" prio=5 tid=1 TimedWaiting | group="main" sCount=1 ucsCount=0 flags=1 obj=0x74866a40 self=0x7186888c00 | sysTid=4011 nice=-10 cgrp=vip sched=1073741825/2 handle=0x722d2cc508 | state=S schedstat=( 162505346434 49475697797 580932 ) utm=11195 stm=5054 core=10 HZ=100 | stack=0x7ff3827000-0x7ff3829000 stackSize=8188KB | held mutexes= at sun.misc.Unsafe.park(Native method) - waiting on an unknown object at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:230) at android.database.sqlite.SQLiteConnectionPool.waitForConnection(SQLiteConnectionPool.java:848) at android.database.sqlite.SQLiteConnectionPool.acquireConnection(SQLiteConnectionPool.java:420) at android.database.sqlite.SQLiteSession.acquireConnection(SQLiteSession.java:916) at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:608) at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:67) at android.database.sqlite.SQLiteQuery.<init>(SQLiteQuery.java:37) at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:46) at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1585) at android.database.sqlite.SQLiteDatabase.rawQuery(SQLiteDatabase.java:1519) at com.huawei.android.launcher.DatabaseHelper.getTableContent(DatabaseHelper.java:6076) at com.huawei.android.launcher.LauncherProvider.isCanUnionDate(LauncherProvider.java:681) at com.huawei.android.launcher.LauncherProvider.doNormalQuery(LauncherProvider.java:575) - locked <0x0bc72969> (a java.lang.Object) at com.huawei.android.launcher.LauncherProvider.query(LauncherProvider.java:530)
最新发布
07-15
在分析 Android 主线程 ANR(Application Not Responding)日志时,主线程阻塞的原因可能多种多样,其中 SQLiteConnectionPool 等待连接问题是一个常见的瓶颈。以下是对该类问题的详细分析方法和解决思路。 ### 3.1 ANR 日志中主线程阻塞的常见表现 当发生 ANR 时,系统会生成 Trace 文件(通常位于 `/data/anr/` 目录下),通过查看 Trace 文件可以定位主线程当前的状态。如果主线程处于如下堆栈信息: ``` at android.database.sqlite.SQLiteConnectionPool.waitForConnection(SQLiteConnectionPool.java:670) ``` 这表明主线程正在等待数据库连接释放,无法继续执行后续操作。SQLite 数据库默认是单线程访问的,多个并发请求可能导致连接池资源竞争,从而引发主线程阻塞[^1]。 ### 3.2 SQLiteConnectionPool 等待连接的根本原因 - **事务操作未及时提交或回滚**:长时间运行的事务会占用数据库连接,导致其他查询操作必须等待。 - **数据库操作未异步处理**:若将耗时的数据库操作放在主线程中执行,尤其是在 onCreate 或 onResume 中进行大量读写,容易造成主线程卡顿。 - **连接池容量限制**:SQLiteConnectionPool 默认只维护有限数量的连接,如果多个线程频繁请求连接而未释放,会导致连接池饱和。 ### 3.3 分析与排查步骤 #### 查看 Trace 文件中的主线程状态 查找类似如下的堆栈信息: ```java "main" prio=5 tid=1 Waiting | group="main" sCount=1 dsCount=0 obj=0x74a9e800 self=0x7f7d5c4a00 | sysTid=1234 nice=0 cgrp=default sched=0/0 handle=0x7f7d5c4a00 | state=S schedstat=( 123456789 987654321 1234 ) utm=12 stm=34 core=0 HZ=100 | stack=0x7fd7e5b000-0x7fd7e5d000 stackSize=8MB | held mutexes= at android.database.sqlite.SQLiteConnectionPool.waitForConnection(SQLiteConnectionPool.java:670) at android.database.sqlite.SQLiteSession.acquireConnection(SQLiteSession.java:894) at android.database.sqlite.SQLiteSession.executeForCursorWindow(SQLiteSession.java:1591) at android.database.sqlite.SQLiteQuery.fillWindow(SQLiteQuery.java:72) at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:153) at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:140) ... ``` 以上堆栈表明主线程正在等待数据库连接释放,此时应重点检查数据库访问逻辑是否合理。 #### 检查数据库操作是否异步化 确保所有数据库操作(尤其是插入、更新等耗时操作)都在子线程中执行,避免直接在主线程中调用 `SQLiteDatabase` 的相关方法。推荐使用 `AsyncTask`、`HandlerThread` 或 `ExecutorService` 实现异步数据库访问。 示例代码: ```java new AsyncTask<Void, Void, Cursor>() { @Override protected Cursor doInBackground(Void... voids) { SQLiteDatabase db = dbHelper.getReadableDatabase(); return db.query("my_table", null, null, null, null, null, null); } @Override protected void onPostExecute(Cursor cursor) { // 处理结果并更新 UI } }.execute(); ``` #### 分析事务的使用情况 避免在一个事务中执行过多操作。长事务不仅会锁住数据库连接,还可能影响性能。建议将事务拆分为多个小事务,并在适当的时候提交。 ### 3.4 性能优化建议 - **避免在主线程中执行数据库操作**:所有数据库访问都应在非主线程中完成。 - **减少事务范围**:事务尽可能短,避免将大量数据操作包含在一个事务中。 - **使用 ContentProvider 和 Loader 架构**:适用于需要跨组件共享数据的场景,支持异步加载机制。 - **启用数据库连接池监控**:可通过自定义封装 SQLiteOpenHelper 来记录连接获取和释放的时间点,辅助定位阻塞源头。 ###
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值