Date: Thu, 28 Mar 2024 08:47:53 -0700 (PDT) Message-ID: <1388071056.279.1711640873945@aries> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_278_1698529861.1711640873945" ------=_Part_278_1698529861.1711640873945 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
The Marketcetera Automated Trading Platform uses Hibernate Object Relati= onal Mapping to provide access to the database. Hibernate ORM (Hibernate in= short) is an object-relational mapping framework for the Java language. It= provides a framework for mapping an object-oriented domain model to a rela= tional database. Hibernate solves object-relational impedance mismatch prob= lems by replacing direct, persistent database accesses with high-level obje= ct handling functions (source). In additi= on to Hibernate, the MATP uses Sprin= g Data JPA to more easily construct and execute datab= ase queries.
Database access is organized into layers. A Service class provides trans= actions and logical grouping of database queries to accomplish a business g= oal. A DAO interface (Data Access Object) provides the actual database quer= y, using Spring Data JPA. Transactions are indicated using AOP annotations = when possible, otherwise, they are manually constructed and committed, when= annotations are not possible to use. Two scenarios where it=E2=80=99s not = possible to use AOP annotations are: first, if the transaction you want to = execute is in a non-public method or class; second, if the Service method n= eeds finer granularity than the method itself for the transaction. An examp= le of the first scenario is the process used to check aggregations to see i= f they should be terminated. The method in AggregationServiceImpl that is r= un is run by a timer, which is not visible to AOP. Therefore, a manual tran= saction is needed. An example of the second scenario is BrokerServiceImpl.d= isableSession which disables a FIX session. There, two transactions are nee= ded, making it a poor match for AOP annotations. The first transaction upda= tes the database with the new status, the second is used to cover notifying= the other cluster members of the disabled session.
Not every service has a corresponding web service implementation. Most s= ervices don=E2=80=99t need one. Any service that is provided to the UI or o= utside the platform does have a web service implementation. The web service= implementation never handles transactions or database access. The service = implementation never handles web services or database access. Each layer ha= s a specific purpose.
Any ACID-compliant database with a modern JDBC driver can be used. The c= urrent implementation uses Oracle via the Oracle-provided thin client JDBC = driver. Database connections are managed by a connection pool provided by t= he C3P0 library. Us= ing a database connection pool prevents the application from being required= to create a new database connection for every call, which is expensive.
Complicated queries and joins that cannot be managed effectively with Sp= ring Data JPA are managed by an additional library called QueryDSL. QueryDSL adds some generated classes at build-time that a= llow complex queries to be built and executed with code. For example, some = of the more complicated queries that drive the Trader Blotter display are p= erformed using QueryDSL.