SSIS/DTSx Error: The specified DSN contains an architecture mismatch between the Driver and Application

Categories: Database; Tagged with: ; @ July 11th, 2013 11:11

Requirement

Error message:

Log:
     Name: OnError
     Computer: DVSSIS
     Operator: DVSSIS\siu
     Source Name: Populate TR Data
     Message: System.Data.Odbc.OdbcException: ERROR [IM014] [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application
   at System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, RetCode retcode)
   at System.Data.Odbc.OdbcConnectionHandle..ctor(OdbcConnection connection, OdbcConnectionString constr, OdbcEnvironmentHandle environmentHandle)
   at System.Data.Odbc.OdbcConnectionOpen..ctor(OdbcConnection outerConnection, OdbcConnectionString connectionOptions)
   at System.Data.Odbc.OdbcConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)
   at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)
   at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
   at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
   at System.Data.Odbc.OdbcConnection.Open()
   at Microsoft.SqlServer.Dts.Runtime.ManagedHelper.GetManagedConnection(String assemblyQualifiedName, String connStr, Object transaction)
   at Microsoft.SqlServer.Dts.Runtime.Wrapper.IDTSConnectionManager100.AcquireConnection(Object pTransaction)
   at Microsoft.SqlServer.Dts.Pipeline.DataReaderSourceAdapter.AcquireConnections(Object transaction)
   at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostAcquireConnections(IDTSManagedComponentWrapper100 wrapper, Object transaction)
     Start Time: 2013-06-27 07:44:51
     End Time: 2013-06-27 07:44:51
End Log

 

Solution

This Error is caused by different version of ‘DTEXEC’, the DTS was developed in a 64-bit PC, that’s means the package using some 64-bit components.  in this case, when the package invoked by a 32-bit ‘DTEXEC’, the above error will be triggered.

The solution is check the system path or any batch file to make sure the 64-bit version path(e.g.  C:\Program Files\Microsoft SQL Server\100\DTS\Binn\)is before 32-bit version(if existing, e.g. C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn)

<<季羡林谈人生>> 笔记

Categories: 垃圾山; Tagged with: ; @ June 17th, 2013 22:14

1. [人生] 我劝人们不妨在吃饱了燕窝鱼翅之后, 或者在吃糠咽菜之后, 或者在卡拉OK. 高尔夫之后, 问一问自己: 你为什么或者? 或者难道就是为了恣睢的享受吗? 难道就是为了忍饥受寒吗? 问了这些简单的问题之后, 会使你头脑清醒一点, 会减少一点糊涂.

2. [做人与出世] 一个人活在世界上, 必须处理好三个关系: 第一, 人与大自然的关系, 第二, 人与人的关系, 包括家庭关系在内; 第三, 个人心中思想与感情矛盾与平衡的关系.

3. [三思而行] “季文子三思而后行. 子闻之曰: 再, 斯可矣”

遇事必须深思熟虑, 先考虑可行性, 考虑的方面越广越好, 然后再考虑不可行性, 也是考虑的方面越广越好. 正反两面仔细考虑完以后, 就必须加以比较, 做出决定, 立即行动. 如果你考虑蒸面, 又考虑反面之后, 再回头来考虑正面, 再考虑反面, 那么, 如此循环往复, 终无宁日, 最终成为考虑的巨人, 行动的侏儒. 所以, 我赞成孔子的” 再, 斯可矣”

4. [傻瓜] 认为别人是傻瓜的人, 才是天下最大的傻瓜.

5. [爱情]  如果一个人不想终生独身的话,  他必须谈恋爱以至结婚. 这是”人间正道”. 但是千万别浪费过多的时间, 终日卿卿我我, 闹得神魂颠倒, 处心积虑, 不时闹点小别扭, 学习不好, 工作难成, 最终可能是”竹篮打水一场空”. 这真是何苦来! 我并不提倡二人”一见倾心”, 立即办理结婚手续. 我觉得, 两个人必须有一个互相了解的过程,. 这个过程不必过长, 短则半年, 多则一年. 余出来的时间应当用到刀刃上, 搞点事业, 为了个人, 为了家庭, 为了国家, 为了世界.

从前西湖有一座月老祠, 有一副对联是天下闻名的: “愿天下有情人都成了眷属, 是前生注定事莫错过姻缘” 多么质朴, 多么有人情味!

6. [温馨, 家庭不可或缺的气氛] 温馨是家庭不可或缺的气氛, 而温馨则是需要培养的. 培养之道, 不出两端, 一真一忍而已.

7. [关于人的素质的几点思考 之四 修养与实践的问题]

“以白黑石子, 用当等于筹算. 善念下白, 恶念下黑. 优波提奉受其教, 善恶之念, 辄投石子. 初黑偶多, 白者甚少. 渐渐修习, 白黑正等. 係年不止. 更无黑石, 纯有白者. 善念已盛, 逮得初果” <大正新修大藏经>

8. [八十述怀] 我从前对穷通寿夭也是颇有一些想法的. “十年浩劫”以后, 我成了陶渊明的志同道合者. 他的一首诗, 我很欣赏:

纵浪大化中, 不喜亦不惧. 应尽便须尽, 无复独多虑.

我现在就是抱着这种精神, 盎然走上前去. 只要有可能, 我一定做一些对别人有益的事情, 绝不想成为行尸走肉. 我知道, 未来的路也不回比过去的更笔直, 更平淡, 但是我并不恐惧. 我眼前还闪动着野百合和野蔷薇的影子.

How To Design A Good API and Why it Matters 笔记

Categories: Java; Tagged with: ; @ June 2nd, 2013 23:22

YouTube: http://www.youtube.com/watch?v=aAb7hSCtvGw

by Joshua Bloch (Principal Software Engineer of Google)

 

API设计是重要的

对公司来说, API 很可能成为公司重要财产, 客户要购买, 学习, 停止使用API的代价过高, 并且, 成功的API可以帮助公司抓牢客户.  当然, 设计太烂的API也会拖垮公司.

对于程序员来说,  如果你写程序, 那你就是一个API设计师,  有用的模块会被重用, 但一旦被其他人使用, 那就不能随便更改.  如果在平时的编程当成设计API会提高代码质量

干货来了:

Characteristics of a Good API

• Easy to learn
• Easy to use, even without documentation 多美好啊
• Hard to misuse
• Easy to read and maintain code that uses it
• Sufficiently powerful to satisfy requirements
• Easy to extend
• Appropriate to audience

 

Outline

I. The Process of API Design

1. Gather Requirements – With a Healthy Degree of Scepticism

我们经常会收到解决方案而不是需求 — 所以我们常说, Product management/BA们不要提Solution.

我们的工作是提炼需求, 最好是以Use Case的形式.

(以前我有个Technical Manager, 他总是要求我们吃透需求, 挑战PM. 事实上, 如果暂时妥协, 接受未经挑战的需求, 可能会为日后的重构埋下伏笔)

Can be easier and more rewarding to build something more general

2. Start with Short Spec–1 Page is Ideal

跟领导演讲稿一样

“If you want me to speak for an hour – give me a moment’s notice; if you want me to speak for half an hour, give me a day’s notice; if you want me to speak for five minutes—give me a week.”__Winston Churchill

3. Write to Your API Early and Often

Code lives on as examples, unit tests

II. General Principles

API Should Be As Small As Possible But No Smaller

API should satisfy its requirements

When in doubt leave it out
_ Functionality, classes, methods, parameters, etc.
_ You can always add, but you can never remove

Minimize Accessibility of Everything

Names Matter–API is a Little Language

 

Document Religiously
• Document every class, interface, method,
constructor, parameter, and exception
_ Class: what an instance represents

_ Method: contract between method and its client
_ Preconditions, postconditions, side-effects
_ Parameter: indicate units, form, ownership
• Document state space very carefully

 

III. Class Design

 

Minimize Mutability

Classes should be immutable unless there’s a
good reason to do otherwise
_ Advantages: simple, thread-safe, reusable
_ Disadvantage: separate object for each value
• If mutable, keep state-space small, well-defined
_ Make clear when it’s legal to call which method

Subclass Only Where It Makes Sense

Design and Document for Inheritance or Else Prohibit it

Inheritance violates encapsulation (Snyder, ‘86)

IV. Method Design

Don’t Make the Client Do Anything the Module Could Do

Don’t Violate the Principle of Least Astonishment

User of API should not be surprised by behavior

Fail Fast–Report Errors as Soon as Possible After They Occur

快速失败

Provide Programmatic Access to All Data Available in String Form

Overload With Care

Avoid ambiguous overloadings,  If you must provide ambiguous overloadings, ensure same behavior for same arguments.

Just because you can doesn’t mean you should: often better to use a different name

Use Appropriate Parameter and Return Types

• Favor interface types over classes for input
_ Provides flexibility, performance
• Use most specific possible input parameter type
_ Moves error from runtime to compile time
• Don’t use string if a better type exists
_ Strings are cumbersome, error-prone, and slow
• Don’t use floating point for monetary values
_ Binary floating point causes inexact results!
• Use double (64 bits) rather than float (32 bits)
_ Precision loss is real, performance loss negligible

 

Use Consistent Parameter Ordering Across Methods

Avoid Long Parameter Lists

V. Exception Design

 

VI. Refactoring API Designs

 

Links:

Rule of three

The New Google Maps 新版Google地图

Categories: Development Notes; Tagged with: ; @ June 1st, 2013 15:26

Google 是个很炫的公司.

Google Map是个神奇的工具.

新的搜索条,  更加紧凑的利用空间.  灵活的跳转到搜索结果:

image

自动适应分辨率的调整. 在搜索结果中, 可以直接看到街景的预览.

 

下图为旧版:

image

相比之下 就略显笨拙.

JIRA: How to Select the user and groups mapping 获得用户与用户组关联列表

Categories: Development Notes; Tagged with: ; @ May 28th, 2013 10:09

Requirement:

Export the users and group mapping list.

Solution:

Seems there’s no feature / plugins for this requirement. If you can access the database, then everything is easy:

SELECT  member.[ID]
      ,[membership_type]
      ,[group_type]
      ,[parent_name]
      ,[lower_parent_name]
      ,[child_name]
      ,[lower_child_name]
      ,member.[directory_id], jira_user.display_name
  FROM [jiradb].[jiraschema].[cwd_membership] member
left join [jiradb].[jiraschema].[cwd_user] jira_user
ON member.child_name = jira_user.user_name
order by parent_name

Newer Posts <-> Older Posts



// Proudly powered by Apache, PHP, MySQL, WordPress, Bootstrap, etc,.