JPA Configuration, Issues, Pitfalls

Total Page:16

File Type:pdf, Size:1020Kb

JPA Configuration, Issues, Pitfalls JDBC vs ORM Comparing INGRES-based data access logic Monica Kurth Outline . What is JDBC? . What is ORM? . Advantages and Disadvantages of using JDBC vs ORM . JDBC Configuration, Issues, Pitfalls . JPA Configuration, Issues, Pitfalls . Sample application . Questions? Confidential — © 2008 Ingres Corporation Slide What is JDBC? . Short for Java Database Connectivity . Java API that enables Java programs to execute SQL statements and interact with any SQL-compliant database. Possible to write a single database application that can run on different platforms and interact with different DBMS. Similar to ODBC, but designed specifically for Java Confidential — © 2008 Ingres Corporation Slide Pros and Cons of JDBC Clean and simple SQL processing Good performance with large amounts of data. Large programming overhead Transactions and concurrency must be hand-coded in Awkward way of obtaining and handling connections and the resulting errors SQL Logging is not provided and must be coded specifically (INGRES provides utility!) Confidential — © 2008 Ingres Corporation Slide JDBC Configuration Required Parameters Vendor - connect using the Ingres JDBC driver Hostname - the name or IP address Port - the port to connect to, default is II7 Database - the name of the database User - the user name to connect with Password - the password Confidential — © 2008 Ingres Corporation Slide JDBC Code Sample [more code] //Instantiate Driver class Class.forName("com.ingres.jdbc.IngresDriver"); //Create Connection Connection connection = DriverManager.getConnection( jdbc:ingres://localhost:II7/demodb, USERNAME, PASSWORD); //Create SQL statement Statement statement = connection.createStatement(); //Execute SQL statement.execute(“SELECT * FROM Employee”); //Tidy up resources – this will need some exception catching etc… statement.close(); connection.close(); [more code] Confidential — © 2008 Ingres Corporation Slide JDBC Configuration – Notes . Leave username and password blank for a local database. The Ingres driver version must be the one provided by the local Ingres installation; look for the iijdbc.jar file under <Ingres dir>\IngresII\ingres\lib . Place iijdbc.jar on the classpath . For SQL Logging, place iijdbc.properties on the classpath to enable Ingres JDBC driver logging. Confidential — © 2008 Ingres Corporation Slide Ingres JDBC logging On Windows, this will log to c:\tmp\iijdbc.log . iijdbc.properties file on classpath Folder must exist - it will not be created! ingres.jdbc.trace.log=/tmp/iijdbc.log ingres.jdbc.trace.timestamp=true ingres.jdbc.trace.drv=5 ingres.jdbc.trace.ds=5 Set ingres.jdbc.trace.msg=5 level 1 (errors) ingres.jdbc.trace.nl=3 to level 5 (low level calls) Read up more detail on: http://docs.ingres.com/connectivity/JDBCTracing Confidential — © 2008 Ingres Corporation Slide What is ORM? . Short for Object Relational Mapping . Lets business code access objects rather than DB tables . Hides details of SQL queries from OO logic . Makes it easy to extend ORM-based applications . Based on JDBC ‘under the hood’ Confidential — © 2008 Ingres Corporation Slide Pro ORM No need to deal with the database implementation Little need to write SQL statements = code reduction. Simple configuration Entities based on business concepts rather than database structure Easy navigation of the object graph Confidential — © 2008 Ingres Corporation Slide Pro ORM (continued) Concurrency support - No coding necessary although locking can be manually configured if desired Excellent caching built in - e.g. Hibernate 2 levels of caching, detailed configuration possible. Can greatly increase application performance! Transaction management and automatic key generation Very good configurable logging built in Confidential — © 2008 Ingres Corporation Slide Against ORM Can be slow with large Inserts & Updates (batch processing) Initially steep learning curve Sometimes hard to track and optimize Confidential — © 2008 Ingres Corporation Slide ORM - JPA - Hibernate . Most ORM tools in the Java world are based on JDBC . Connection configuration easy and similar to JDBC . JPA - first common standard released in May 2006 as part of the Java Standard and Java Enterprise Edition 1.5 . Based largely on Hibernate . Hibernate still exceeds JPA functionality in some areas and remains most popular JPA implementation Confidential — © 2008 Ingres Corporation Slide Other JPA implementations . OpenJPA – an Apache JPA implementation . Apache Cayenne – another Apache JPA project . JPOX – Open Source JPA implementation . TopLink – Oracle’s JPA implementation . Kodo – BEA’s JPA flavour . Eclipse Link – recently started project for INGRES Integration – contributions welcome! Confidential — © 2008 Ingres Corporation Slide JPA Configuration XML schema <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Persistence xsi:schemaLocation="http://java.sun.com/xml/ns/persistence Provider: http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd“ version="1.0"> Hibernate <persistence-unit name="jpa-ingres"> Automatically find persistence <provider>org.hibernate.ejb.HibernatePersistence</provider> objects in all Java <properties> classes <property name="hibernate.archive.autodetection" value="class"/> <property name="hibernate.show_sql" value="true"/> Log all SQL <property name="hibernate.connection.driver_class" statements value="com.ingres.jdbc.IngresDriver"/> Use Ingres Driver <property name="hibernate.connection.url" value="jdbc:ingres://localhost:II7/ Use performancedb"/> Connect to DB using JDBC String Hibernate’s <property name="hibernate.dialect" value="org.hibernate.dialect.IngresDialect"/> Ingres dialect <property name="hibernate.hbm2ddl.auto" value="update"/> </properties> </persistence-unit> update the DB schema only other options: validate – create - create-drop Confidential — © 2008 Ingres Corporation Slide JPA Configuration - Notes . More than one persistence unit can be defined to cater for multiple databases etc. Changes only in configuration file . Actual code not touched by implementation . SQL Logging is easily configured . Hibernate implementation needs a number of Jar files on the classpath Confidential — © 2008 Ingres Corporation Slide Hibernate log4j configuration (similar for other JPA implementations) log4j.jar and log4j.properties must be placed on classpath log4j.appender.FileAppender=org.apache.log4j.FileAppender Define File Logger log4j.appender.FileAppender.File=c:/test.log log4j.appender.FileAppender.layout=org.apache.log4j.PatternLayout log4j.appender.FileAppender.layout.ConversionPattern=%d{ABSOLUTE}%5p %c{1}:%L - %m%n log4j.appender.stdout=org.apache.log4j.ConsoleAppender Define Console Logger log4j.appender.stdout.Target=System.out log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE}%5p %c{1}:%L - %m%n log4j.rootLogger=DEBUG, FileAppender, stdout List required Loggers log4j.logger.org.hibernate=ERROR log4j.logger.uk.co.luminary.jdbc=DEBUG log4j.logger.org.apache.commons.collections=ERROR Set logging levels for different packages in the application and Hibernate. Allowed are: FATAL, ERROR, WARN, INFO, DEBUG Confidential — © 2008 Ingres Corporation Slide JPA entity configuration (independent of JPA implementation) package uk.co.luminary.entity; public Employee(Integer id) import javax.persistence.*; { this.id = id; @Entity tell the JPA this is a mapped entity } @Table(name=“EMP_TABLE") Optional: table name; //the usual getters and setters public class Employee class name = default { public Integer getId() //define the primary key { return this.id; @Id the entity’s ID @GeneratedValue } (strategy=GenerationType.AUTO) private Integer id; public void setId(Integer id) { let the DB use it’s default this.id = id; private String firstName; id generation strategy private String surName; } (in INGRES, this is private Date birthdate; SEQUENCE) private String position; public String getFirstName() private String notes; { return this.firstName; //default constructor } public Employee(){ } [MORE CODE] Confidential — © 2008 Ingres Corporation Slide Hibernate – deleting an entity Example log statements DEBUG - Initializing object from ResultSet: [uk.co.luminary.entity.Employee#21] DEBUG - Hydrating entity: [uk.co.luminary.entity.Employee#21] DEBUG - returning '1960-02-10 00:00:00' as column: birthdate2_0_ DEBUG - returning 'John' as column: firstName2_0_ DEBUG - returning 'on holiday until August' as column: notes2_0_ DEBUG - returning 'Developer' as column: position2_0_ DEBUG - returning 'Smith' as column: surName2_0_ DEBUG - done processing result set (1 rows) DEBUG - about to close ResultSet (open ResultSets: 1, globally: 1) DEBUG - about to close PreparedStatement (open PreparedStatements: 1, globally: 1) DEBUG - closing statement DEBUG - total objects hydrated: 1 DEBUG - resolving associations for [uk.co.luminary.entity.Employee#21] DEBUG - done materializing entity [uk.co.luminary.entity.Employee#21] DEBUG - initializing non-lazy collections DEBUG - done entity load DEBUG - deleting a persistent instance DEBUG - deleting [uk.co.luminary.entity.Employee#21] DEBUG - Flushed: 0 insertions, 0 updates, 1 deletions to 1 objects DEBUG - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections DEBUG - listing entities: DEBUG - uk.co.luminary.entity.Employee{position=Developer, notes=on holiday until August, surName=Smith, firstName=John, birthdate=1960-02-10 00:00:00, id=21} DEBUG - executing flush DEBUG - registering flush begin
Recommended publications
  • The State of the Feather
    The State of the Feather An Overview and Year In Review of The Apache Software Foundation The Overview • Not a replacement for “Behind the Scenes...” • To appreciate where we are - • Need to understand how we got here 2 In the beginning... • There was The Apache Group • But we needed a more formal and legal entity • Thus was born: The Apache Software Foundation (April/June 1999) • A non-profit, 501(c)3 Corporation • Governed by members - member based entity 3 “Hierarchies” Development Administrative PMC Members Committers Board Contributors Officers Patchers/Buggers Members Users 4 At the start • There were only 21 members • And 2 “projects”: httpd and Concom • All servers and services were donated 5 Today... • We have 227 members... • ~54 TLPs • ~25 Incubator podlings • Tons of committers (literally) 6 The only constant... • Has been Change (and Growth!) • Over the years, the ASF has adjusted to handle the increasing “administrative” aspects of the foundation • While remaining true to our goals and our beginnings 7 Handling growth • ASF dedicated to providing the infrastructure resources needed • Volunteers supplemented by contracted out SysAdmin • Paperwork handling supplemented by contracted out SecAssist • Accounting services as needed • Using pro-bono legal services 8 Staying true • Policy still firmly in the hands of the ASF • Use outsourced help where needed – Help volunteers, not replace them – Only for administrative efforts • Infrastructure itself is a service provided by the ASF • Board/Infra/etc exists so projects and people
    [Show full text]
  • Hibernate ORM Query Simplication Using Hibernate
    2016 3rd National Foundation for Science and Technology Development Conference on Information and Computer Science Hibernate ORM Query Simplication Using Hibernate Criteria Extension (HCE) Kisman Sani M. Isa Master of Information Technology Master in Computer Science Bina Nusantara University Bina Nusantara University Jl. Kebon Jeruk Raya No. 27, Jakarta Barat, DKI Jl. Kebon Jeruk Raya No. 27, Jakarta Barat, DKI Jakarta, Indonesia 11530 Jakarta, Indonesia 11530 [email protected] [email protected] Abstract— Software development time is a critical issue interfaced by a query. The software engineer will make in software development process, hibernate has been the query specified to database used. Each database widely used to increase development speed. It is used in vendor has their Structured Query Language (SQL). As database manipulation layer. This research develops a the development of software technology and most of library to simplify hibernate criteria. The library that is programming languages are object oriented, some called as Hibernate Criteria Extension (HCE) provides API functions to simplify code and easily to be used. Query engineer or software institutions try to simplify the associations can be defined by using dot. The library will query process. They try to bind object in application to automatically detect the join association(s) based on database. This approach is called as Object Relational mapping in entity class. It can also be used in restriction Mapping (ORM). ORM is a translation mechanism from and order. HCE is a hibernate wrapper library. The object to relational data, vice versa. ORM has “dialect” configuration is based on hibernate configuration.
    [Show full text]
  • Objektově Orientovaný Přístup K Perzistentní Vrstvě V Prostředí Java Object Oriented Database Access in Java
    Objektově orientovaný přístup k perzistentní vrstvě v prostředí Java Object Oriented Database Access in Java Roman Janás Bakalářská práce 2014 *** nascannované zadání str. 1 *** *** nascannované zadání str. 2 *** UTB ve Zlíně, Fakulta aplikované informatiky, 2014 4 ABSTRAKT Předmětem bakalářské práce „Objektově orientovaný přístup k perzistentní vrstvě v prostředí Java“ je analýza dostupných ORM aplikačních rámců pro programovací jazyk Java. Cílem je zjistit, který aplikační rámec je v současnosti nejlépe použitelný. Obsahem práce je také srovnání s technologií JDBC - porovnání výkonnosti jednotlivých řešení a popis používaných návrhových vzorů. Praktická část názorně ukazuje práci se zvolenými aplikačními rámci a výsledky výkonnostních testů. Klíčová slova: ORM, Java, návrhové vzory, JDBC, Hibernate, Cayenne ABSTRACT The subject of the submitted thesis “Object Oriented Database Access in Java” is analysis of available ORM frameworks for programming language Java. The goal is to determine which framework is the most applicable. The content is also comparison with JDBC technology – comparison of efficiency of each solutions and description of used design patterns. The practical part clearly shows work with chosen frameworks and results of efficiency tests. Keywords: ORM, Java, design patterns, JDBC, Hibernate, Cayenne UTB ve Zlíně, Fakulta aplikované informatiky, 2014 5 Na tomto místě bych rád poděkoval Ing. Janu Šípkovi za cenné připomínky a odborné rady, kterými přispěl k vypracování této bakalářské práce. Dále děkuji svým kolegům z
    [Show full text]
  • Return of Organization Exempt from Income
    OMB No. 1545-0047 Return of Organization Exempt From Income Tax Form 990 Under section 501(c), 527, or 4947(a)(1) of the Internal Revenue Code (except black lung benefit trust or private foundation) Open to Public Department of the Treasury Internal Revenue Service The organization may have to use a copy of this return to satisfy state reporting requirements. Inspection A For the 2011 calendar year, or tax year beginning 5/1/2011 , and ending 4/30/2012 B Check if applicable: C Name of organization The Apache Software Foundation D Employer identification number Address change Doing Business As 47-0825376 Name change Number and street (or P.O. box if mail is not delivered to street address) Room/suite E Telephone number Initial return 1901 Munsey Drive (909) 374-9776 Terminated City or town, state or country, and ZIP + 4 Amended return Forest Hill MD 21050-2747 G Gross receipts $ 554,439 Application pending F Name and address of principal officer: H(a) Is this a group return for affiliates? Yes X No Jim Jagielski 1901 Munsey Drive, Forest Hill, MD 21050-2747 H(b) Are all affiliates included? Yes No I Tax-exempt status: X 501(c)(3) 501(c) ( ) (insert no.) 4947(a)(1) or 527 If "No," attach a list. (see instructions) J Website: http://www.apache.org/ H(c) Group exemption number K Form of organization: X Corporation Trust Association Other L Year of formation: 1999 M State of legal domicile: MD Part I Summary 1 Briefly describe the organization's mission or most significant activities: to provide open source software to the public that we sponsor free of charge 2 Check this box if the organization discontinued its operations or disposed of more than 25% of its net assets.
    [Show full text]
  • Cloud-TM Companion Document For
    Cloud-TM Specific Targeted Research Project (STReP) Contract no. 257784 Companion document for deliverable D2.2: Preliminary Prototype of the RDSTM and RSS Date of preparation: 10 June 2010 Start date of project: 1 June 2010 Duration: 36 Months Contributors Emmanuel Bernard, Red Hat Joao Cachopo, INESC-ID Mark Little, Red Hat Francesco Quaglia, CINI Paolo Romano, INESC-ID Vittorio A. Ziparo, ALGORITHMICA Manik Surtani, Red Hat Sanne Grinovero, Red Hat Fabio Cottefoglie, ALGORITHMICA —————————————————— (C) 2010 Cloud-TM Consortium. Some rights reserved. This work is licensed under the Attribution-NonCommercial-NoDerivs 3.0 Creative Commons License. See http://creativecommons.org/licenses/by-nc-nd/3.0/legalcode for details. Table of Contents 1 Introduction 4 1.1 Relationship with other deliverables . .4 2 Architectural Overview of the Cloud-TM Preliminary Prototype 6 2.1 TorqueBox . .6 2.2 Object Grid Mapper . .7 2.3 Reconfigurable Distributed STM and Storage System . .8 3 Setting up the prototype 10 3.1 Structure and Content of the Package . 10 3.2 Installing and running the prototype . 10 3.2.1 Hibernate OGM . 11 3.2.2 Fenix Framework . 12 4 Conclusions 13 3 1 Introduction This document accompanies Deliverable D2.2, Preliminary Prototype of the Cloud- TM platform. Its aim is to overview the current architecture of the prototype and to document how to set it up in order to develop applications running on top of it. As planned in the DoW this preliminary prototype does not include neither dy- namic reconfiguration mechanisms, nor the Autonomic Manager which are going to be developed later on during the project.
    [Show full text]
  • APACHE LUCENE for JAVA EE DEVELOPERS JAVAONE:2015 by @Sannegrinovero
    APACHE LUCENE FOR JAVA EE DEVELOPERS JAVAONE:2015 by @SanneGrinovero WHO AM I? WHO AM I? RED HAT Principal Software Engineer, middleware R&D Dutch, Italian, living now in London HIBERNATE TEAM Hibernate Search project lead Hibernate ORM Hibernate OGM CONTRIBUTING TO INFINISPAN the Lucene guy: Infinispan Query, Infinispan Lucene Directory, clustering extensions for Hibernate Search OTHER PROJECTS I HELP WITH... WildFly, JGroups, Apache Lucene, ... AGENDA What is Apache Lucene and how can it help you Integrations with a JPA application via Hibernate Search How does this all relate with Infinispan and WildFly Lucene index management & clouds Plans and wishlist for the future THE SEARCH PROBLEM THE SEARCH PROBLEM Hey JavaOne, remind me where the talk having primary key #2342 is? SQL CAN HANDLE TEXT SQL CAN HANDLE TEXT The LIKE operator? LET'S REFRESH SOME LESSONS ON LET'S REFRESH SOME LESSONS ON THE WIKIPEDIA Select * from WikipediaPages p where p.content LIKE ?; Select * from WikipediaPages p where p.title LIKE ?; Select * from WikipediaPages p where (lowercase(p.content) LIKE %:1% OR lowercase(p.content) LIKE %:2% OR lowercase(p.content) LIKE %:3% OR ...); HOW BAD IS IT? HOW BAD IS IT? I'm quoting successfull web companies. How many can you list which do not provide an effective search engine? Human interaction REQUIREMENTS FOR A SEARCH REQUIREMENTS FOR A SEARCH ENGINE Need to guess what you want w/o you typing all of the content Humans hate complex forms: can't you just guess what I need? We want the results in the blink of an eye We want the right result on top: Relevance We want the right result on top: Relevance SOME MORE THINGS TO CONSIDER: SOME MORE THINGS TO CONSIDER: Approximate word matches Stemming / Language specific analysis Typos Synonyms, Abbreviations, Technical Language specializations BASICS: KEYWORD EXTRACTION On how to improve running by Scott 1.
    [Show full text]
  • Spring Framework Cookbook I
    Spring Framework Cookbook i Spring Framework Cookbook Spring Framework Cookbook ii Contents 1 Spring Framework Best Practices 1 1.1 Define singleton beans with names same as their class or interface names.....................1 1.2 Place Spring bean configuration files under a folder instead of root folder.....................1 1.3 Give common prefixes or suffixes to Spring bean configuration files........................2 1.4 Avoid using import elements within Spring XML configuration files as much as possible.............2 1.5 Stay away from auto wiring in XML based bean configurations...........................2 1.6 Always externalize bean property values with property placeholders........................3 1.7 Select default version-less XSD when importing namespace definitions.......................3 1.8 Always place classpath prefix in resource paths...................................4 1.9 Create a setter method even though you use field level auto wiring.........................4 1.10 Create a separate service layer even though service methods barely delegate their responsibilities to correspond- ing DAO methods...................................................4 1.11 Use stereotype annotations as much as possible when employing annotation driven bean configuration......5 1.12 Group handler methods according to related scenarios in different Controller beans................6 1.13 Place annotations over concrete classes and their methods instead of their interfaces................6 1.14 Prefer throwing runtime exceptions instead of checked exceptions
    [Show full text]
  • Avaliando a Dívida Técnica Em Produtos De Código Aberto Por Meio De Estudos Experimentais
    UNIVERSIDADE FEDERAL DE GOIÁS INSTITUTO DE INFORMÁTICA IGOR RODRIGUES VIEIRA Avaliando a dívida técnica em produtos de código aberto por meio de estudos experimentais Goiânia 2014 IGOR RODRIGUES VIEIRA Avaliando a dívida técnica em produtos de código aberto por meio de estudos experimentais Dissertação apresentada ao Programa de Pós–Graduação do Instituto de Informática da Universidade Federal de Goiás, como requisito parcial para obtenção do título de Mestre em Ciência da Computação. Área de concentração: Ciência da Computação. Orientador: Prof. Dr. Auri Marcelo Rizzo Vincenzi Goiânia 2014 Ficha catalográfica elaborada automaticamente com os dados fornecidos pelo(a) autor(a), sob orientação do Sibi/UFG. Vieira, Igor Rodrigues Avaliando a dívida técnica em produtos de código aberto por meio de estudos experimentais [manuscrito] / Igor Rodrigues Vieira. - 2014. 100 f.: il. Orientador: Prof. Dr. Auri Marcelo Rizzo Vincenzi. Dissertação (Mestrado) - Universidade Federal de Goiás, Instituto de Informática (INF) , Programa de Pós-Graduação em Ciência da Computação, Goiânia, 2014. Bibliografia. Apêndice. Inclui algoritmos, lista de figuras, lista de tabelas. 1. Dívida técnica. 2. Qualidade de software. 3. Análise estática. 4. Produto de código aberto. 5. Estudo experimental. I. Vincenzi, Auri Marcelo Rizzo, orient. II. Título. Todos os direitos reservados. É proibida a reprodução total ou parcial do trabalho sem autorização da universidade, do autor e do orientador(a). Igor Rodrigues Vieira Graduado em Sistemas de Informação, pela Universidade Estadual de Goiás – UEG, com pós-graduação lato sensu em Desenvolvimento de Aplicações Web com Interfaces Ricas, pela Universidade Federal de Goiás – UFG. Foi Coordenador da Ouvidoria da UFG e, atualmente, é Analista de Tecnologia da Informação do Centro de Recursos Computacionais – CERCOMP/UFG.
    [Show full text]
  • Develop a Simple Web Application with Apache Wicket and Apache
    Develop a simple Web application with Apache Wicket and Apache Geronimo Combine Wicket, Geronimo, and Apache Derby to form an open source Java Web development platform Skill Level: Intermediate Robi Sen ([email protected]) Vice President Department 13 LLC 10 Jul 2007 Apache Wicket is an innovative Java™ Web application framework that was introduced a couple of years ago. It helps simplify Web application development by clearly separating the roles of developers and designers. It lets you remove logical code from the view layer, eliminating the need for JavaServer Pages (JSP), providing a simple plain old Java object (POJO)-centric mode of development, and removing much of the need for XML and other configuration file formats. In this tutorial, learn how to set up your system to develop a simple Web application with Wicket, using Apache Geronimo as your application server and Apache Derby as the embedded database. Section 1. Before you start This tutorial is designed for developers who have found Java frameworks, such as Struts, lacking in needed functionality. If you're interested in developing Web applications in a more object-oriented manner, where the view is clearly separated from logic and there's minimal configuration and mapping, then Wicket is for you! This tutorial walks you through the basics of how Wicket works, while using Apache Geronimo to set up a Java Platform, Enterprise Edition (Java EE) server, Web server, and embedded database in just minutes. Combining Wicket with Geronimo lets you develop data-driven, scalable Web applications using software that's all open source. Develop a simple Web application with Apache Wicket and Apache Geronimo © Copyright IBM Corporation 1994, 2008.
    [Show full text]
  • Comparative Studies of 10 Programming Languages Within 10 Diverse Criteria
    Department of Computer Science and Software Engineering Comparative Studies of 10 Programming Languages within 10 Diverse Criteria Jiang Li Sleiman Rabah Concordia University Concordia University Montreal, Quebec, Concordia Montreal, Quebec, Concordia [email protected] [email protected] Mingzhi Liu Yuanwei Lai Concordia University Concordia University Montreal, Quebec, Concordia Montreal, Quebec, Concordia [email protected] [email protected] COMP 6411 - A Comparative studies of programming languages 1/139 Sleiman Rabah, Jiang Li, Mingzhi Liu, Yuanwei Lai This page was intentionally left blank COMP 6411 - A Comparative studies of programming languages 2/139 Sleiman Rabah, Jiang Li, Mingzhi Liu, Yuanwei Lai Abstract There are many programming languages in the world today.Each language has their advantage and disavantage. In this paper, we will discuss ten programming languages: C++, C#, Java, Groovy, JavaScript, PHP, Schalar, Scheme, Haskell and AspectJ. We summarize and compare these ten languages on ten different criterion. For example, Default more secure programming practices, Web applications development, OO-based abstraction and etc. At the end, we will give our conclusion that which languages are suitable and which are not for using in some cases. We will also provide evidence and our analysis on why some language are better than other or have advantages over the other on some criterion. 1 Introduction Since there are hundreds of programming languages existing nowadays, it is impossible and inefficient
    [Show full text]
  • Oracle Glassfish Server Release Notes Release 3.1.2 and 3.1.2.2 E24939-04
    Oracle GlassFish Server Release Notes Release 3.1.2 and 3.1.2.2 E24939-04 October 2012 These Release Notes provide late-breaking information about GlassFish Server 3.1.2 and 3.1.2.2 software and documentation. These Release Notes include summaries of supported hardware, operating environments, and JDK and JDBC/RDBMS requirements. Also included are a summary of new product features in the 3.1.2 and 3.1.2.2 releases, and descriptions and workarounds for known issues and limitations. Oracle GlassFish Server Release Notes, Release 3.1.2 and 3.1.2.2 E24939-04 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited. The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing. If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, the following notice is applicable: U.S. GOVERNMENT RIGHTS Programs, software, databases, and related documentation and technical data delivered to U.S.
    [Show full text]
  • Ebean Java Persistence (Dominik Dorn)
    Meeting #44 EBean Java Persistence (Dominik Dorn) CoffeeScript & SASS (Clemens Helm) Brunch (w/ backbone.js) (Nik Graf – lightning talk) 2011-12-05 Dominik Dorn EBean Java Persistence just simple & powerful 2011-12-05 Dominik Dorn Overview ● What is EBean / Java Persistence + JPA? ● Architecture – where does it fit? ● Partial Objects + Fetch Graphs ● EBean Features ● Code... (maybe :) ) 2011-12-05 Dominik Dorn What is Ebean? ● open source Object Relational Mapping tool ● simple alternative to JPA (not like hibernate, eclipselink, etc.) ● “sessionless” API and simple query language (explained later) ● Fetch graphs + Partial Objects ● Lazy loading that just works. 2011-12-05 Dominik Dorn Architecture – Where does it fit? 2011-12-05 Dominik Dorn Differences to Hibernate/JPA ● Sessionless ● No EntityManager / Session / UnitOfWork – No merge(), persist(), attach() or detach() – Only save() and delete() ● Query Language ● Slightly different ● Optimized for fetch graphs and partial objects ● No hacks ● For wide tables / blobs & clobs etc. 2011-12-05 Dominik Dorn Partial Objects & Fetch Graphs ● TASK: Print an Invoice → get Order(date, items, total) + customer (name, email) + items ( name, price ) 2011-12-05 Dominik Dorn Partial Objects & Fetch Graphs ● Hibernate createQuery(“SELECT o FROM Order o WHERE o.id = ?”) → Lazy/eager loading Customer + Items → “Huge” traffic and memory requirements (blobs etc.) 2011-12-05 Dominik Dorn Partial Objects & Fetch Graphs ● EBean Order o = Ebean.find(Order.class) .select("date, total") .fetch("customer", "name,
    [Show full text]