How to share a data layer interface in COM +

Source: Internet
Author: User
How to share a data layer interface in COM +: Delphi/Windows SDK/API
Http://www.delphi2007.net/DelphiNetwork/html/delphi_20061216191901110.html
In COM + development, I want to build a common data service layer component consisting of a data access control such as mtsdatamodule and ADO. Each Business Object interacts with the database through it. However, when a business object accesses this data access component, an mtsdatamodule object instance is created. In this way, multiple mtsdatamodule objects are generated when multiple business objects are accessed, this will occupy a large amount of database resources.
Problem:
1. When developing with COM +, can the data access layer generate only one common mtsdatamodule (multiple adoconnect and data access controls are put above), and business objects only call this mtsdatamodule object, instead of multiple instances that generate mtsdatamodule?
2. Use the above idea to implement the database connection pool.
3. Thread model problems. There are two COM + objects, bo1 (STA) and bo2 (STA). When the client calls bo1, a single thread suite is generated on the server side, and bo1 is also placed in the same single thread suite, there is a method in bo1 that will create the bo2 object and call the bo2 method. Is bo2 and bo1 in the same suite? (If bo2 is MTA, is it the same)

Please help. the problem persists. Thank you.

Have you ever encountered this problem? Let's make a move.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.