Git Product home page Git Product logo

reladomo's Introduction

Reladomo

What is it?

Reladomo is an object-relational mapping (ORM) framework for Java with the following enterprise features:

  • Strongly typed compile-time checked query language
  • Bi-temporal chaining
  • Transparent multi-schema support
  • Full support for unit-testable code
  • See the documentation for more detail.

What can I do with it?

  • Model data as objects with meaningful relationships between them
  • Define classes and relationships using simple XML files
  • Traverse, query, fetch, and update graphs of objects in an idiomatic object-oriented way
  • Manage bi-temporal data using built-in methods
  • Define, create, query, and update data that has both business date and processing date axes
  • Maintain complete and accurate audit history of changes efficiently
  • Answer as-of questions such as "what did this object look like at the end of last quarter"
  • Build applications as diverse as interactive web-apps to batch-processing
  • Leverage transactions and batch operations to support high-performance throughput
  • Detach objects to allow users to change data off-line
  • Write database vendor-independent code

Detailed feature list

  • Strongly typed compile-time checked query language
  • Audit-only, Business time-series only, and Bi-temporal chaining
  • Transparent multi-schema support (partition data across many databases)
  • Object-oriented batch operations
  • Flexible object relationship inflation
  • Detached objects (allow data to be changed independently (a.k.a. delayed edit functionality) of the DB and then pushed (or reset) as and when required) - useful when users are editing data in a GUI form
  • Multi-Threaded matcher Loader (MTLoader) is a high-performance pattern for merging changes from another source (file, feed, other DB, etc.) to your existing DB data. By design it is flexible/customizable and re-runnable
  • Tunable caching by object type - partial, full, full off-heap
  • Available meta-data - enables higher-level programming paradigms
  • Multi-tier operation - obviates the need for direct DB access from client-side apps, enables better connection sharing, with no code changes required
  • Full support for unit-testable code
  • Databases supported include: Sybase (ASE & IQ), DB2, Oracle, Postgres, MS-SQL, H2, Derby, "generic" ...

Sample Project

To help getting started with Reladomo, a simple project is available with maven and gradle build set-up.

Prerequisite: install maven or gradle.

git clone https://github.com/goldmansachs/reladomo.git
cd samples/reladomo-sample-simple

Maven

mvn clean install

Gradle

gradle clean build

Once build is successful, run src/main/java/sample/HelloReladomoApp to see how it behaves.

Documentation

Documentation is available online and also included within the Reladomo Javadoc jar file. Extract the jar file and refer to the docs below.

Reference Description File Path
Tutorial This tutorial demonstrates the necessary steps to get your Reladomo project started. userguide/ReladomoTutorial.html
FAQ Reladomo FAQ mithrafaq/ReladomoFaq.html
Reladomo Test Resource This document explains the steps required to use Reladomo objects in unit tests. mithraTestResource/ReladomoTestResource.html
Reladomo Notification When you have multiple JVMs connecting to a DB via Reladomo, you need to keep each JVM up-to-date with changes made by any of the other JVMs. Reladomo Notification is the primary mechanism for achieving this and keeping each JVMs Reladomo cache fresh. notification/Notification.html
Reladomo Primary Key Generator Primary key generator is an optional feature in Reladomo that allows Reladomo objects to declare how the primary key is going to be generated. primaryKeyGenerator/PrimaryKeyGenerator.html
Reladomo Database Definition Generators Database definition language (DDL) file generation is an optional feature in Reladomo that allows users to generate scripts to create tables, indices and foreign keys from the Reladomo object definition XML files. mithraddl/ReladomoDdlGenerator.html
Reladomo Object XML Generator To expedite the creation of object XML files from existing schema, an object XML file generator has been created. It connects directly to a database, retrieving a list of the existing tables and generating object XML files that appropriately map to these tables. objectxmlgenerator/Generator.html
Visualize Domain Model Using Reladomo Metadata When a persistent set of objects is specified in Reladomo metadata, the objects can be visualized. The output can be used as documentation, or simply browsed through to gain understanding of the domain. visualization/ReladomoVisualization.html
Reladomo Architecture Reladomo internal architecture. architecture/ReladomoInternalArchitecture.html
Presentations Reladomo presentation materials. presentations

Acquiring Reladomo

feature2

reladomo's People

Contributors

andrewwyllie avatar dependabot[bot] avatar donraab avatar epsstan avatar goldbal25 avatar gs-prady avatar gs-rezaem avatar horbe avatar itohiro73 avatar itohro avatar itrestian avatar jajodr avatar ktonq avatar mohrezaei avatar motlin avatar neistd avatar nikhilnanivadekar avatar opatrascoiu avatar punithreventh avatar seratch avatar sett4 avatar vborisoff avatar wabowe317 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

reladomo's Issues

ClassCastException from generated code when using inheritance.

I'm getting a ClassCastException from within Reladomo-generated code when invoking getters and setters on a subclass. I haven't used inheritance before, so it's likely I'm doing something wrong. In that case I'd expect an error message rather than a runtime exception.

I've created a small repro. One Book owns many AbstractChapters. AbstractChapter is set up as table-per-class. AbstractChapter has the key (bookTitle, chapterNumber) and has text. A subclass, ChapterWithQuote extends AbstractChapter, has the same key, and adds one attribute. The full definitions are at the bottom.

When I call ChapterWithQuote.getText() or setText(), I'm getting ClassCastException.

ChapterWithQuote chapterWithQuote = new ChapterWithQuote();
String text = chapterWithQuote.getText();

The error:

java.lang.ClassCastException: com.repro.reladomo.bug.ChapterWithQuoteData cannot be cast to com.repro.reladomo.bug.AbstractChapterData
    at com.repro.reladomo.bug.AbstractChapterAbstract.getText(AbstractChapterAbstract.java:166)

Coming from this cast in AbstractChapterAbstract.java:

public String getText()
{
    AbstractChapterData data = (AbstractChapterData) this.zSynchronizedGetData();
    return data.getText();
}

And I see that ChapterWithQuoteData in fact does not extend AbstractChapterData. Both classes implement MithraDataObject and have no superclass.

public class ChapterWithQuoteData
implements MithraDataObject
{
    private String bookTitle;
    private int chapterNumber;
    private String quote;
    // ...
}

Similar situation when I call setText().

ChapterWithQuote chapterWithQuote = new ChapterWithQuote();
chapterWithQuote.setText("chapter text");

The error:

java.lang.ClassCastException: com.repro.reladomo.bug.ChapterWithQuoteData cannot be cast to com.repro.reladomo.bug.AbstractChapter
    at mithra.gen.Attribute1.stringValueOf(Unknown Source)
    at com.repro.reladomo.bug.AbstractChapterCommonAbstract.zSetString(AbstractChapterCommonAbstract.java:997)
    at com.repro.reladomo.bug.AbstractChapterAbstract.setText(AbstractChapterAbstract.java:172)

Coming from the call to zSetString() in AbstractChapterAbstract.java:

public void setText(String newValue)
{
    zSetString(AbstractChapterFinder.text(), newValue, false, false );
}

Which delegates to AbstractChapterCommonAbstract.java:

protected MithraDataObject zSetString(StringAttribute attr, String newValue, boolean isReadOnly, boolean hasOptimistic)
{
    TransactionalBehavior behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
    try
    {
        MithraDataObject data = behavior.getCurrentDataForWrite(this);
        // attr is generated by asm. Cast happening in stringValueOf and failing.
        String cur = attr.stringValueOf(data);
        if (cur == null)
        {
            if (newValue == null) return null;
        }
        else
        {
            if (cur.equals(newValue)) return null;
        }

        data = behavior.update(this, attr, newValue, isReadOnly, true);
        if (hasOptimistic)
        {
            zIncrementOptimiticAttribute(behavior, data);
        }

        return data;
    }

    finally
    {
        behavior.clearTempTransaction(this);
    }
}

Is this a bug? If not, what am I doing wrong? Is there a missing error message?

xml definitions

AbstractChapter.xml

<?xml version="1.0" encoding="UTF-8" ?>
<MithraObject
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/goldmansachs/reladomo/master/reladomogen/src/main/xsd/mithraobject.xsd"
        initializePrimitivesToNull="true"
        objectType="transactional"
        superClassType="table-per-class">
    <PackageName>com.repro.reladomo.bug</PackageName>
    <ClassName>AbstractChapter</ClassName>
    <DefaultTable>ABSTRACT_CHAPTER</DefaultTable>

    <Attribute
            name="bookTitle"
            javaType="String"
            primaryKey="true"
            nullable="false"
            columnName="book_title"
            trim="false" />
    <Attribute
            name="chapterNumber"
            javaType="int"
            primaryKey="true"
            nullable="false"
            columnName="chapter_number" />
    <Attribute
            name="text"
            javaType="String"
            primaryKey="false"
            nullable="false"
            columnName="text"
            trim="false" />
</MithraObject>

ChapterWithQuote.xml

<?xml version="1.0" encoding="UTF-8" ?>
<MithraObject
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/goldmansachs/reladomo/master/reladomogen/src/main/xsd/mithraobject.xsd"
        initializePrimitivesToNull="true"
        objectType="transactional">
    <PackageName>com.repro.reladomo.bug</PackageName>
    <ClassName>ChapterWithQuote</ClassName>
    <SuperClass name="com.repro.reladomo.bug.AbstractChapter"></SuperClass>
    <DefaultTable>CHAPTER_WITH_QUOTE</DefaultTable>

    <Attribute
            name="bookTitle"
            javaType="String"
            primaryKey="true"
            nullable="false"
            columnName="book_title"
            trim="false" />
    <Attribute
            name="chapterNumber"
            javaType="int"
            primaryKey="true"
            nullable="false"
            columnName="chapter_number" />
    <Attribute
            name="quote"
            javaType="String"
            primaryKey="false"
            nullable="false"
            columnName="quote"
            trim="false" />
</MithraObject>

Book.xml

<?xml version="1.0" encoding="UTF-8" ?>
<MithraObject
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/goldmansachs/reladomo/master/reladomogen/src/main/xsd/mithraobject.xsd"
        initializePrimitivesToNull="true"
        objectType="transactional">
    <PackageName>com.repro.reladomo.bug</PackageName>
    <ClassName>Book</ClassName>
    <DefaultTable>BOOK</DefaultTable>

    <Attribute
            name="title"
            javaType="String"
            primaryKey="true"
            nullable="false"
            columnName="title"
            trim="false" />
    <Relationship
            name="chapters"
            reverseRelationshipName="book"
            relatedObject="AbstractChapter"
            relatedIsDependent="true"
            cardinality="one-to-many"
            orderBy="chapterNumber asc">
        this.title = AbstractChapter.bookTitle
    </Relationship>

</MithraObject>

Tuplizer

Is there a notion of Tuplizer similar to Hibernate? I see them used for filtering but what about mapping to a reladomo Object?

Thanks.

Caching with Relationships

I want to completely disable caching - I know this will be a performance hit but our table sizes are small and we'll re-enable the caching once we configure the TCP Notification Server and have tested it in our environment/ with redundancy etc.

So, to disable the caching I set cacheType = none as follows and sure enough I see all application finds going to the db (sql logs and profiler show that)

 <MithraObjectConfiguration
  className="com.greenhedges.Account" cacheType="none"/>

 <MithraObjectConfiguration
  className="com.greenhedges.AccountAgreement" cacheType="none"/>

My issue is the one-to-many relationship are not refetched/queried from the db each time - e.g. say an Account can have n number of AccountAgreements:

<MithraObject objectType="transactional">
<PackageName>com.greenhedges</PackageName>
    <ClassName>Account</ClassName>
    <DefaultTable>account</DefaultTable>
...
    <Relationship name="aggreements" relatedObject="AccountAgreement" cardinality="one-to-many" relatedIsDependent="true">
         AccountAgreement.id = this.id
    </Relationship>
</MithraObject>

Is there a way to force the relatedObjects to be reloaded always?

Event Handler

Is there a way to listen for all data changes? I noticed for the UpdateHandler but i am not sure if that is meant to capture or listen for all data changes and types.

MithraObjectXmlGenerator / MsSql nvarchar type

Having table defined as follows:

create table dbo.Citizen(Id int not null, Address nvarchar(500) null...)

MithraObjectXmlGenerator generates the following definition:

"nvarchar" is not valid type - it should be String

Add Eclipse Collections as a dependency.

(This is Hiroshi with my personal account)

Since my copyright situation got changed after I raised PR #30, I'm going to cancel #30 and submit a new PR with adding dco for EC dependency changes in reladomo.

I'm still in middle of making changes and I'd have design questions for the change, so would like to use this issue for discussion.

Invalid generated code for to-many, owned relationship to a sub-type, with foreign key in super-type.

When I declare a to-many, owned relationship to a sub-type, where the foreign key lives in its super-type, Reladomo generates code which won't compile.

ConcreteChild extends AbstractChild. One Parent owns many ConcreteChildren (relatedIsDependent=true). The foreign key parentKey is defined in its super class, AbstractChild.

The generated class ParentAbstract has two compiler errors, in setParentKey() and setChildren(). Both are because ConcreteChildList has no method setParentKey().

public void setParentKey(String newValue)
{
    MithraDataObject d = zSetString(ParentFinder.parentKey(), newValue, true, false );
    if (d == null) return;
    ParentData data = (ParentData) d;
    TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
    if (!_behavior.isPersisted())
    {
        ConcreteChildList children =
        (ConcreteChildList ) data.getChildren();
        if (children != null)
        {
            // Compiler error here
            children.setParentKey(newValue);
        }
    }
}
public void setChildren(ConcreteChildList children)
{
    ConcreteChildList _children = (ConcreteChildList) children;
    TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
    ParentData _data = (ParentData) _behavior.getCurrentDataForWrite(this);
    if (_behavior.isInMemory())
    {
        if (_behavior.isDetached() && _children != null)
        {
            _children.zMakeDetached(ConcreteChildFinder.parentKey().eq(_data.getParentKey()),
                _data.getChildren());
        }

        _data.setChildren(_children);
        if (_children != null)
        {
            // Compiler error here
            _children.setParentKey(_data.getParentKey());
            _children.zSetParentContainerparent(this);
            _children.zSetAddHandler(new ChildrenAddHandlerInMemory());
        }
        else if (_behavior.isDetached())
        {
            throw new MithraBusinessException("to-many relationships cannot be set to null. Use the clear() method on the list instead.");
        }
    }
    else if (_behavior.isPersisted())
    {
        _behavior.clearTempTransaction(this);
        _children.zSetAddHandler(new ChildrenAddHandlerPersisted());
        ConcreteChildList childrenToDelete = new ConcreteChildList();
        childrenToDelete.addAll(this.getChildren());
        for(int i=0;i < _children.size(); i++)
        {
            ConcreteChild item = _children.getConcreteChildAt(i);
            if (!childrenToDelete.remove(item))
            {
                item.setParentKey(_data.getParentKey());
                item.cascadeInsert();
            }
        }

        childrenToDelete.cascadeDeleteAll();
    }
    else throw new RuntimeException("not implemented");
}

If I change relatedIsDependent to false, I don't get any compiler errors. I'm using this as a workaround. I thought about moving the foreign key, but I'm using table-per-class and I really do want the foreign key in the shared table if possible.

Full xmls below.

Parent.xml:

<?xml version="1.0" encoding="UTF-8" ?>
<MithraObject
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/goldmansachs/reladomo/master/reladomogen/src/main/xsd/mithraobject.xsd"
        initializePrimitivesToNull="true"
        objectType="transactional">
    <PackageName>com.repro.reladomo.abstractownedforeignkey</PackageName>
    <ClassName>Parent</ClassName>
    <DefaultTable>PARENT</DefaultTable>

    <Attribute
            name="parentKey"
            javaType="String"
            primaryKey="true"
            nullable="false"
            readonly="true"
            finalGetter="true"
            columnName="parent_key"
            trim="false" />
    <Relationship
            name="children"
            reverseRelationshipName="parent"
            relatedObject="ConcreteChild"
            relatedIsDependent="true"
            cardinality="one-to-many">
            this.parentKey = ConcreteChild.parentKey
    </Relationship>

</MithraObject>

AbstractChild.xml:

<?xml version="1.0" encoding="UTF-8" ?>
<MithraObject
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/goldmansachs/reladomo/master/reladomogen/src/main/xsd/mithraobject.xsd"
        initializePrimitivesToNull="true"
        objectType="transactional"
        superClassType="table-per-class">
    <PackageName>com.repro.reladomo.abstractownedforeignkey</PackageName>
    <ClassName>AbstractChild</ClassName>
    <DefaultTable>ABSTRACT_CHILD</DefaultTable>

    <Attribute
            name="parentKey"
            javaType="String"
            primaryKey="false"
            nullable="false"
            finalGetter="true"
            columnName="parent_key"
            trim="false" />
    <Attribute
            name="childKey"
            javaType="String"
            primaryKey="true"
            nullable="false"
            readonly="true"
            finalGetter="true"
            columnName="child_key"
            trim="false" />
</MithraObject>

ConcreteChild.xml

<?xml version="1.0" encoding="UTF-8" ?>
<MithraObject
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/goldmansachs/reladomo/master/reladomogen/src/main/xsd/mithraobject.xsd"
        initializePrimitivesToNull="true"
        objectType="transactional">
    <PackageName>com.repro.reladomo.abstractownedforeignkey</PackageName>
    <ClassName>ConcreteChild</ClassName>
    <SuperClass name="AbstractChild" generated="true" />
    <DefaultTable>CONCRETE_CHILD</DefaultTable>

    <Attribute
            name="childProperty"
            javaType="String"
            primaryKey="false"
            nullable="false"
            finalGetter="true"
            columnName="child_property"
            trim="false" />
</MithraObject>

Improve sql logging by adding additional context.

Reladomo's sql logging is so useful that I sometimes leave it turned on in production.

DEBUG com.gs.fw.common.mithra.sqllogs.MyClass: connection:1030722971 find with: select t0.key,t0.number from MY_CLASS t0 where  t0.key = 'abcd' and t0.system_to = '9999-12-01 23:59:00.000'
DEBUG com.gs.fw.common.mithra.sqllogs.MyClass: retrieved 1 objects, 2.0 ms per

I have some ideas on how to make this logging even more useful.

It's currently hard to log only sql, or only timings, without the other. That's because both log statements using the same logger, com.gs.fw.common.mithra.sqllogs.MyClass in this example. I propose adding markers for each.

private static final Marker MARKER_SQL = MarkerFactory.getMarker("Reladomo SQL");
private static final Marker MARKER_TIMING = MarkerFactory.getMarker("Reladomo Timing");

And adding the markers to the relevant log statements. For example, change this:

logger.debug("source '" + source + "': " + text);

to

logger.debug(MARKER_SQL, "source '" + source + "': " + text);

In addition, the timing information could be even more useful if I didn't have to parse it out of the logged message. I propose adding the timing information to MDC. That way I more easily create dashboards of the amount of time spent on queries over time.

For example, change this:

this.sqlLogger.debug("retrieved " + this.rowCount + " objects, " +
        ((this.rowCount > 0) ? ((totalTime / this.rowCount) + " ms per") : (totalTime +
                " ms")));

to

MDC.put("rowCount", String.valueOf(this.rowCount));
MDC.put("totalTime", String.valueOf(totalTime));
try
{
    this.sqlLogger.debug(MARKER_TIMING, "retrieved " + this.rowCount + " objects, " + ((this.rowCount > 0) ? (totalTime / this.rowCount + " ms per") : (totalTime + " ms")));
}
finally
{
    MDC.remove("rowCount");
    MDC.remove("totalTime");
}

I'm happy to contribute these changes but I wanted to discuss here before working on the whole thing.

I'm starting with the assumption that changing the existing logging is undesirable because users already rely on the current behavior. So this proposal adds markers and MDC but doesn't change, remove, or combine any messages. What do you think?

Getting exception when tried to join a table with equalsEdgePoint()

Getting below exception when tried to join table with equalsEdgePoint().

Sample Reladomo Query:
DocumentFinder.authors().processingDate().equalsEdgePoint()
.and(DocumentFinder.authors().processingDateTo().greaterThan())

Exception :
can't join with non-standard as-operation com.gs.fw.common.mithra.finder.asofop.AsOfEdgePointOperation processingDate

Read with txParticipation=readOnly and write in same Application

Hi,
Sorry for posting my question in the issue section, but i had an issue that i am stuck at for some time now so wanted to check if anybody could kindly provide any help here.
We are working on creating a purge application that runs throughout the day. We fetch objects using the listCursor and for each x rows, check if they meet certain criteria and delete. We stop purge and also stop fetching data using the cursor(but do not close the cursor ,effectively pausing the cursor )if the database is busy or if other processes are running.
I was looking to find a way such that the read from the listCursor would be in readOnly mode so it does not hold on to any locks(this is currently blocking other processes even thought the cursor is paused and not fetching any data) and the delete's can happen in the same JVM.
Since we declare txParticpation at the connection level, it would not let me do it currently.
Could someone please suggest if there is a way i can specify txParticpation at query level or if could have 2 connection managers for an application so i could use the listCursor in readOnly mode and run the delete's using the second connection manager or if there is any other way to tackle this problem.
Please let me know if you need any other details.

Thanks

Updating/moving a record to exist in the past

Context
I'm using Reladomo to manage bi-temporal data. One time dimension is for audit purposes (transaction time). The other time dimension is for business purposes (valid time). A primary key is being used that contains a unique identifier for each entity. Each entity also has a "name" column stored in the database.

Scenario

  1. You insert a record that is valid from present time to infinity with id=5 (primary key) and name="A"
  2. You realize that the entity existed in the past but it had a different name (name = "B")

What is the proper way to correct history on the business time dimension (valid dates)?

Approach 1 (This one does not work. Reladomo does not seem to support changing the valid from date?)

  1. Find dto where id = 5 in present time
  2. Set the validFrom date backwards in history to show that this entity existed in the past
  3. Update the name to equal "B" from past date until present time

Approach 2

  1. Call insert again and pass an entity that contains the primary key (id = 5), name = "B", validFrom = "some past date", validTo = "present/current time"

Questions

  • What is the recommended way for updating history to show that the entity existed in the past?
  • Is there anyway to slide the validFrom date backwards?
  • Is there any danger in inserting doing several inserts with the same primary key? I noticed that there is nothing preventing me from inserting the entity again with id=5 and name="B" where the validTo date is greater then the valid from date on the first insert. This causes the dtos to overlap and there to exist two rows with id = 5 at a single point in time.

SerializationConfig doesn't preserve serializeMetaData in copy methods.

Some of the copy methods in SerializationConfig don't copy over serializeMetaData. I worked around it by changing code like this:

        SerializationConfig serializationConfig = SerializationConfig
                .shallowWithDefaultAttributes(MyTypeFinder.getFinderInstance())
                .withoutMetaData()
                .withDeepFetches(MyTypeFinder.relatedThings());

to:

        SerializationConfig serializationConfig = SerializationConfig
                .shallowWithDefaultAttributes(MyTypeFinder.getFinderInstance())
                .withDeepFetches(MyTypeFinder.relatedThings())
                .withoutMetaData();

reladomo-test-suite fails in non-EST timezone machine

Number of test cases fail when being built in non-EST timezone. Think these would be better to be made timezone agnostic.

Below are the tests that failed in JST with fresh clone of master repo.

[junit] TestTimeDatedNonTransactional.testToString failed with error
[junit] TestOffHeapSemiUniqueDatedIndex.testBasicData failed
[junit] CacheLoaderManagerTest.testLimitedLoadOfDependentWithOwnerObjectsPassedIn failed
[junit] CacheLoaderManagerTest.testRefreshTwoDatesWithAllDateShifted failed
[junit] CacheLoaderManagerTest.testInitialLoadWithTwoDatesWithinRangeWithAdditionalOperationBuilderThatIsDateInvariant failed
[junit] CacheLoaderManagerTest.testRefreshTopLevelNewDependantOld failed
[junit] CacheLoaderManagerTest.testLoadWithOpenBizDateBringsBackOpenRecords failed
[junit] CacheLoaderManagerTest.testLimitedLoadWithAdditionalOperation failed
[junit] CacheLoaderManagerTest.testRefreshTwoDates failed
[junit] CacheLoaderManagerTest.testInitialLoadWithTwoDatesWithinRangeWithTopAdditionalOperationBuilderThatIsDateVariant failed
[junit] CacheLoaderManagerTest.testLoadWithFilteredMapper failed
[junit] CacheLoaderManagerTest.testRefreshTwoDatesWithDependentDateShifted failed
[junit] CacheLoaderManagerTest.testInitialLoadWithTwoDatesWithinRangeOneDateOutOfRange failed
[junit] CacheLoaderManagerTest.testInitialLoadWithTwoDatesWithinRange failed
[junit] CacheLoaderManagerTest.testOperationBuilderPrerequisite failed
[junit] CacheLoaderManagerTest.testLimitedLoadWithDependency failed
[junit] CacheLoaderManagerTest.testInitialLoad failed
[junit] CacheLoaderManagerTest.testInitialLoadWithTwoDatesWithinRangePostFiltersUnwantedDatesInbetween failed
[junit] CacheLoaderManagerTest.testRefresh failed
[junit] CacheLoaderManagerTest.testInitialLoadWithTwoDatesWithinRangeWithDependentAdditionalOperationBuilderThatIsDateVariant failed
[junit] CacheLoaderManagerTest.testRefreshWithAdditionalOperationBuilderWithLoadPerBusinessDateAndDateShift failed
[junit] CacheLoaderManagerTest.testRefreshTwoDatesWithTopLevelDateShifted failed
[junit] CacheLoaderManagerTest.testLimitedLoad failed
[junit] CacheLoaderManagerTest.testNonRegional failed
[junit] CacheLoaderManagerTest.testLoadWithBizDateInThePastBringsBackNoRecords failed
[junit] CacheLoaderManagerTest.testRefreshWithAdditionalOperationBuilder failed
[junit] CacheLoaderManagerTest.testLoadWithOpenAndPastBizDateBringsBackOpenRecordsOnlyInSingleDateConfig failed
[junit] CacheLoaderManagerTest.testLimitedLoadOfDependent failed
[junit] CacheLoaderManagerTest.testInitialLoadWithTwoDatesWithinRangeAndDependentTaskShifted failed
[junit] CacheLoaderManagerTest.testPrerequisite failed
[junit] CacheLoaderManagerTest.testLoadWithOpenAndPastBizDateBringsBackOpenRecordsOnlyInDateRangeConfig failed
[junit] CacheLoaderManagerTest.testRefreshTopLevelOldDependantNew failed
[junit] CacheLoaderManagerProcessingOnlyTest.testInitialLoad failed
[junit] CacheLoaderManagerProcessingOnlyTest.testRefresh failed
[junit] DependentLoaderFactoryTest.testSameDependentTwice failed
[junit] DependentLoaderFactoryTest.testTwoDependenciesWithDifferentOwnerFilters failed
[junit] FullyMilestonedTopLevelLoaderFactoryTest.testDateFilterToKeep failed
[junit] FullyMilestonedTopLevelLoaderFactoryTest.testInitialLoad failed
[junit] FullyMilestonedTopLevelLoaderFactoryTest.testRefresh failed
[junit] FullyMilestonedTopLevelLoaderFactoryTest.testInitialLoadOnlyPreStartTimeInz failed
[junit] TestAtomicOperationsToString.testInOperation failed
[junit] TestAtomicOperationsToString.testGreaterThanEqualsOperation failed
[junit] TestAtomicOperationsToString.testNotInOperation failed
[junit] TestAtomicOperationsToString.testLessThanOperation failed
[junit] TestAtomicOperationsToString.testNonPrimitiveEqualsOperation failed
[junit] TestAtomicOperationsToString.testLessThanEqualsOperation failed
[junit] TestAtomicOperationsToString.testGreaterThanOperation failed
[junit] TestAtomicOperationsToString.testEqualsOperation failed
[junit] TestAtomicOperationsToString.testNotEqualsOperation failed

A Reladomo DDL API

We are planning to use Obevo as a database deployment tool in our application.
As part of this we have to generate the Obevo scripts (for Sybase ASE DB) from the Reladamo XMLs that is deployable without user intervention.
It would be great to have a DDL Generation API in Reladamo which can take the input as ClassList and give the output as an array of SQLs or a better format which can be used to create Obevo deployable scripts.

Support for unicode encoded data files

Hi,

We have some data files that contain Unicode (non-ascii) characters that AbstractMithraDataFileParser is loading incorrectly on Linux - its using the default system charset/encoding - which is ASCII. Works ok on Windows/windows-1252 :)

One option is to set the default locale before starting Java, using
export LANG=en_US.UTF-8

Any plans to provide support to change the encoding within the parse method of the above FileParser, eg pass in a Charset that can be used with the InputStreamReader?

Cheers
Chris

reladomo.iml in .gitignore

Hi all,why is reladomo.iml in ignored files ?
I believe it will help us to set up dev environment swiftly in intellij.

MithraObjectXmlGenerator on MsSql - provide schema name parameter or ignore system schemas

There is no way to provide sql schema name for MithraObjectXmlGenerator (because of initializeSchemaOrCatalog method logic, "schemaName" variable is always null for SqlServer).

SQL server database always contains system views and tables, so running MithraObjectXmlGenerator leads to processing all those system views and tables. In my sample DB there are 400 system views (INFORMATION_SCHEMA.* and sys.*) for 20 user tables, so the output of generator is nearly unusable
(and on SqlServer 2012 generator actually throws exception trying to process sys.trace_xe_action_map table)

The work around is to provide "includeTables" parameter, but for real db that list would be very long.

Shared Schema Multi-tenancy

Hi,

I've been reviewing Reladomo for use in a project but see nothing about multi-tenancy.

I plan on implementing shared schema tenancy by using row level security in PostgreSQL. My original plan before coming across Reloadomo was to set a connection parameter when the connection was grabbed for use. This was to be used in PostgreSQL via a table policy that checked the value compared the the column value stored essentially creating a virtual database.

I think I can do the PostgreSQL part still and the connection parameter by overriding the getConnection in say the SourcelessConnectionManager.

Where I get confused is with the Caching in Reladomo.

I've read what I can on the caching and It would appear that there is a collection of indices and that matching an object in the cache must be done via a match with "=" or "in". So if the tenant id was part of an index this may work?

Is there a way I can do what I want to do?
How would one use Reladomo for multi-tenancy?

Any help would be greatly appreciated.

Timezone issues with Tests

I'm still having real issues with the timezone stuff in my timezone. I was following a suggestion by @gs-rezaem to run the TestPostgresGeneralTestCases to make sure it worked with AWS Aurora (PostgreSQL). I was initially making sure all the tests ran locally with normal PostgreSQL.

I think the issue might lie in this bit of code in MithraTimestamp

    protected static int getOffsetFromTimeZoneToUtc(TimeZone tz, Date date)
    {
        if (date.getTime() <= TIME_FOR_1950_01_01)
        {
            return DateTimeZone.forTimeZone(tz).getOffset(date.getTime());
        }
        else
        {
            int offset = tz.getRawOffset();
            if (tz.inDaylightTime(date))
            {
                offset += tz.getDSTSavings();
            }
            return offset;
        }
    }

My run of a test I was looking at goes in to the else. The date in question happens to be a date that was in a Daylight Saving period. So the check if (tz.inDaylightTime(date)) is true. It then gets the current Daylight savings offset with tz.getDSTSavings() which is not currently in a Daylight Savings period so the date is offset incorrectly by 1 hour. So when the date is retrieved it is not the original date but out by 1 hour.

Am I on the right track and does that make any sense?

Compile *ListAbstract fails due to missing dependency on gs-collections.jar [Version 17.0.1]

Looks like maven is not able to resolve dependency on gs-collections.jar when running build on latest version 17.0.1. I believe everyone can replicate this problem by changing reladomo version in reladomo/samples/reladomo-sample-simple/build.gradle to 17.0.1.

tsuyoshi@tsuyoshi-XPS-13-9360:~/Downloads/reladomo/samples/reladomo-sample-simple$ gradle build
:genReladomo
:compileJava
/home/tsuyoshi/Downloads/reladomo/samples/reladomo-sample-simple/build/generated-sources/reladomo/sample/domain/PersonListAbstract.java:104: error: package com.gs.collections.impl.list.mutable does not exist
return com.gs.collections.impl.list.mutable.ListAdapter.adapt(this);
^
/home/tsuyoshi/Downloads/reladomo/samples/reladomo-sample-simple/build/generated-sources/reladomo/sample/domain/ObjectSequenceListAbstract.java:104: error: package com.gs.collections.impl.list.mutable does not exist
return com.gs.collections.impl.list.mutable.ListAdapter.adapt(this);
^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors
:compileJava FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':compileJava'.

Compilation failed; see the compiler error output for details.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Finding the "Latest" value for an entity in a Bi-Temporal Table.

Suppose we keep track of the contact name for an account in a bi temporal table. At different times in history we will have different contacts associated with an account. If the account is closed the row will be terminated in this table.
Here is an example with some data:
exampletable

The list of the current/last contact name for every account we've ever had (both currently open plus closed accounts) would be:
exampleresults

In SQL i would have to partition by Account Id, order by valid_to desc, rank and select where rank =1

How should I best achieve the same result in Reladomo?

I believe the following code would work but would issue a separate findOne for each and ever distinct accountId in the table. - Is this the way to do this or is there a better way to use the API?

            List<AccountContact> listOfAccountContacts = new ArrayList<>();
            
            AggregateList aggregateList = new AggregateList(AccountContactFinder.validDate().equalsEdgePoint());
            aggregateList.addAggregateAttribute(
                "validFrom", AccountContactFinder.validDateFrom().max());
            aggregateList.addGroupBy("accountId", AccountContactFinder.accountId());
            for (AggregateData row : aggregateList)
            {
                Long accountId = row.getAttributeAsLong("accountId");
                Timestamp validFrom = row.getAttributeAsTimestamp("validFrom");
              
                
                Operation selectionOperation = AccountContactFinder.validDate().eq(validFrom);
                selectionOperation = selectionOperation.and(AccountContactFinder.account(accountId));
                AccountContact accountContact = Finder.findOne(selectionOperation);
                listOfAccountContacts.add(accountContact);
            }

Json type Postgres

If i want to add support for json type postgresql. Where do i need to add this type of support.
It will be represented as string. But when i do an insert in postgres we need to convert string to json. One way is using stringtype=unspecified. But i was wondering if there is a way of intercepting and figuring out the type of the field before preparing the statement.
I was looking at PostgresDatabaseType but i am not sure.

Thanks

Doesn't build with OpenJDK 8

On Debian Linux;

/usr/lib/jvm/java-1.8.0-openjdk-amd64//lib/rt.jar:build/lib/*:/usr/lib/jvm/java-1.8.0-openjdk-amd64//lib/tools.jar
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
Unrecognized VM option 'UseSpinning'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

I think it is a bit much to require JDK 1.6 for builds in this day and age...

Make Reladomo build work with JDK 1.7+

Mac OS High Sierra cannot install JDK 1.6 any more and there is no way to build Reladomo in the OS unfortunately.

Is there any plans to make Reladomo build work with JDK 1.7+? If I can help in any ways I'm happy to contribute.

Mapping SqlServer nvarchar(..) fields to H2 test database

Hello
I work with SqlServer and I use nvarchar type for strings. When I try to load my test data to MithraTestResource I have the problem with maxLength constraint - nvarchar is mapped to varchar in H2 test database, but length constraint stays the same. So, having some field declared as nvarchar(100), in my test data file I can have value for that field with length, for example, 90. But when MithraTestResource tries to load that value to H2 database, it throws org.h2.jdbc.JdbcBatchUpdateException because values is too long for varchar(100) data type. And it is right - you need varchar(200) in H2 db to store nvarchar(100) values.

Is there any workaround for this?

Reladomo Object XML Generator / Postgresql UUID Type

Hi,
I have a postgresql schema with a table defined as :

CREATE TABLE public.sampler_color ( id uuid NOT NULL, version integer NOT NULL,

The attribute id has a type 'uuid'

The Mithra XML Generator generates for this postgresql schema the following definition :

<Attribute name="id" javaType="uuid" primaryKey="true" columnName="id" />

which is not valid, as "uuid" is not a type.

EclipseLink uses for example "java.util.UUID" for the postgresl uuid type.

I tried to add

sqlToJavaTypes.put("uuid", "java.util.UUID");
to PostgresDatabaseType.java but then the Type has to be know also by MithraObjectTypeWrapper.java

private static Set<String> primitiveTypes = new HashSet<String>(Arrays.asList("boolean", "int", "long", "float", "double", "short", "byte", "char")); private static Set<String> javaTypes = new HashSet<String>(Arrays.asList("String", "Timestamp", "Date", "byte[]", "BigDecimal", "Time"));

.. not sure what the impact will be, how the mapping sql/java is done, etc.

As a workaround the postgresql uuid can be intepreted evtl. as Java String ?

Best Regard,
jj

MultiUpdateOperation.combineMultiUpdate incorrectly combines increment on double

When MultiUpdateOperation tries to combine with another MultiUpdateOperation, the combineOnSameAttribute call incorrectly merges increment on double operations across objects with different primary keys. The setup for this is as follows:

Assume a primary key of Account + Product and a Quantity balance. If you have 6 increment operations as follows:

update1. Account 1, Product 1, increment 100
update2. Account 1, Product 2, increment 100
update3. Account 2, Product 3, increment 100
update4. Account 2, Product 4, increment 100
update5. Account 1, Product 5, increment 100
update6. Account 1, Product 6, increment 100

update1 & 2 will be combined into a MultiUpdateOperation A of:
update Account 1 set quantity = quantity + 100 where product in (1, 2)

update3 & 4 will be combined into a MultiUpdateOperation B of:
update Account 2 set quantity = quantity + 100 where product in (3, 4)

update5 & 6 will be combined into a MultiUpdateOperation C of:
update Account 1 set quantity = quantity + 100 where product in (5, 6)

Next, MultiUpdateOperation A and MultiUpdateOperation C will be combined incorrectly into:
update Account 1 set quantity = quantity + 200 where product in (1, 2, 5, 6)

I believe the combineForSameAttribute funciton in DoubleIncrementUpdateWrapper was only intended to combine increments for objects of the same primary key. But because its combining across different keys, its creating unexpected results.

Building reladomo on Linux / JDK 8. Issues with -XX:+UseSpinning jvm param

Hi,

Environment : Ubuntu 16.04

Linux dvlp1 4.4.0-83-generic #106-Ubuntu SMP Mon Jun 26 17:54:43 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
--
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

Step:
$ git clone ...
$ cd reladomo
$ build/build.sh compile-reladomo

Issue:
Unrecognized VM option 'UseSpinning'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

Comments:
$ grep -r "UseSpinning"

build/antbuild.sh:JVM_ARGS="-ms16m -mx2000m -server -XX:MaxPermSize=128m -XX:+UseParallelGC -XX:MaxHeapFreeRatio=20 -XX:MinHeapFreeRatio=10 -XX:CompileThreshold=100 -XX:+UseSpinning"

Best Regards,
jj

Documentation for Source Connection Manager?

Hi,

I was looking at the SourceAttribute to see how to make use of multiple databases.

The documentation has this regarding the Source Connection Manager but I can'f find where the documentation is that details how to setup a Connection Manager class for multiple sources and sharding. Can you point me in the right direction?

3.1.2. Source Connection Manager
In some cases, Reladomo objects come from multiple source databases. One common case where this can happen is if the database is sharded. In this case, the connection manager's job is to return a shard-specific database connection.

Sharding is discussed in more detail in other Reladomo documentation.

MithraGeneratorException with MithraEnumeration element

Hi.

I've got error MithraGeneratorException: unable to load template com.gs.fw.common.mithra.templates.enumeration.Main_jsp, make sure you have compiled the templates.

reladomo version 16.5.1.

TestEnum.xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<MithraEnumeration
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:noNamespaceSchemaLocation="reladomoobject.xsd">
    <PackageName>sample.domain</PackageName>
    <ClassName>TestEnum</ClassName>
    <Member name="MEMBER1"/>
</MithraEnumeration>

ReladomoClassList.xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Mithra xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="reladomoobject.xsd"
        enableOffHeap="false">
    <MithraEnumerationResource name="TestEnum"/>
</Mithra>

Compile

$ mvn compile
.... snip ....
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.3:run (generateMithra) on project reladomo-sample-simple: An Ant BuildException has occured: com.gs.fw.common.mithra.generator.MithraGeneratorException: Failed to generate classes for TestEnum with nested exception com.gs.fw.common.mithra.generator.MithraGeneratorException: unable to load template com.gs.fw.common.mithra.templates.enumeration.Main_jsp, make sure you have compiled the templates -> [Help 1]

Better error message when parsing invalid relationships.

What I did

I implemented a meta-model in Reladomo and tried to create a relationship from an instance to its type.

<MithraObject objectType="transactional">
    <ClassName>Example</ClassName>
    ...

    <Relationship name="type" relatedObject="Class" cardinality="many-to-one">
        Class.name = "Example"
    </Relationship>

</MithraObject>

What I was expecting

  1. Ideally, I was hoping this would just work.
  2. If that's not possible, I was expecting a helpful error message like "Error while processing relationship Example.type 'Class.name = "Example"'. Expected at least one clause referencing an attribute on Example.
  3. If not a specific error message, I would expect a message like Error while parsing 'Class.name = "Example"'

What actually happened

A NullPointerException that makes it hard to tell which relationship is invalid.

Caused by: java.lang.NullPointerException
    at com.gs.fw.common.mithra.generator.MithraObjectTypeWrapper.hasRelatedObjectInPredicate (MithraObjectTypeWrapper.java:2055)
    at com.gs.fw.common.mithra.generator.MithraObjectTypeWrapper.checkRelationships (MithraObjectTypeWrapper.java:1961)
    at com.gs.fw.common.mithra.generator.BaseMithraGenerator.checkRelationships (BaseMithraGenerator.java:520)
    at com.gs.fw.common.mithra.generator.BaseMithraGenerator.validateMithraObjectXml (BaseMithraGenerator.java:368)
    at com.gs.fw.common.mithra.generator.BaseMithraGenerator.validateMithraObjectTypes (BaseMithraGenerator.java:349)
    at com.gs.fw.common.mithra.generator.BaseMithraGenerator.parseAndValidate (BaseMithraGenerator.java:304)
    at com.gs.fw.common.mithra.generator.CoreMithraGenerator.execute (CoreMithraGenerator.java:541)
    at com.gs.fw.common.mithra.generator.MithraGenerator.execute (MithraGenerator.java:83)

Code generation ignores implemented interfaces when using superClassType="table-per-subclass"

I've defined an abstract class that also implements an interface. When I use superClassType="table-per-subclass", the generated code is missing the implements clause. When I use superClassType="table-per-class", I'm not seeing this problem.

I've put together a small repro.

<?xml version="1.0" encoding="UTF-8" ?>
<!--MyInterface.xml-->
<MithraInterface
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/goldmansachs/reladomo/master/reladomogen/src/main/xsd/mithraobject.xsd">
    <PackageName>com.repro.reladomo.abstractimplementsinterface</PackageName>
    <ClassName>MyInterface</ClassName>
    <Attribute
            name="stringAttribute"
            javaType="String" />
</MithraInterface>
<?xml version="1.0" encoding="UTF-8" ?>
<!--MyAbstractClass.xml-->
<MithraObject
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/goldmansachs/reladomo/master/reladomogen/src/main/xsd/mithraobject.xsd"
        initializePrimitivesToNull="true"
        objectType="transactional"
        superClassType="table-per-subclass">
    <PackageName>com.repro.reladomo.abstractimplementsinterface</PackageName>
    <ClassName>MyAbstractClass</ClassName>
    <MithraInterface>MyInterface</MithraInterface>
    <Attribute
            name="id"
            javaType="long"
            primaryKey="true"
            primaryKeyGeneratorStrategy="SimulatedSequence"
            nullable="false"
            columnName="id">
        <SimulatedSequence
            sequenceName="MyAbstractClass"
            sequenceObjectFactoryName="com.klass.reladomo.simseq.ObjectSequenceObjectFactory"
            hasSourceAttribute="false"
            batchSize="10"
            initialValue="1"
            incrementSize="1" />
    </Attribute>
    <Attribute
            name="stringAttribute"
            javaType="String"
            primaryKey="false"
            nullable="false"
            columnName="string_attribute"
            trim="false" />
</MithraObject>

The generated class MyAbstractClassAbstract is missing implements MyInterface.

/**
* This file was automatically generated using Mithra 17.0.2. Please do not modify it.
* Add custom logic to its subclass instead.
*/
// Generated from templates/transactional/superclass/Abstract.jsp
public abstract class MyAbstractClassAbstract extends com.gs.fw.common.mithra.superclassimpl.MithraTransactionalObjectImpl
{
    // ...
}

Relationships should honor lessThan and greaterThan between attributes

A relationship like this should work:

<Relationship name='pets' relatedObject='Pet' cardinality='one-to-many'>
<![CDATA[this.personId = Pet.personId and
this.age > Pet.age]]>
</Relationship>

If it is invalid then there should be build time exception. Instead, currently the build succeeds and the query generated is Person.personId = Pet.personId which is incorrect.
Please correct me if I am doing something wrong.

Using reladomo to connect to Oracle database

Trying to create connection to an Oracle d/b using reladomo 17.1.0. Below is the snippet for OracleConnectionManager.java
XAConnectionManager xaConnectionManager = new XAConnectionManager();
xaConnectionManager.setDriverClassName("oracle.jdbc.driver.OracleDriver");
xaConnectionManager.setHostName(host);
xaConnectionManager.setPort(port);
xaConnectionManager.setJdbcUser(username);
xaConnectionManager.setJdbcPassword(password);
xaConnectionManager.setMaxWait(500);
xaConnectionManager.setPoolSize(10);
xaConnectionManager.setInitialSize(1);
xaConnectionManager.initialisePool();

While trying to create the connection, following error is thrown
java.lang.ClassNotFoundException: com.gs.fw.common.mithra.connectionmanager.JndiJdbcLdapDataSourceProvider

JndiJdbcLdapDataSourceProvider was not part of reladomo:17.1.0 jar downloaded.
Looked through the source and noticed reference to com.gs.fw.aig.jdbc.JdbcInitialDirContext; which was also not part of the jar. https://github.com/goldmansachs/reladomo/blob/17.1.0/reladomogs/src/main/java/com/gs/fw/common/mithra/connectionmanager/JndiJdbcLdapDataSourceProvider.java

Please let us know if there is an alternate way we we can take to connect to Oracle.

Using Reladomo with a Java 11 JRE

Is anyone running Reladomo with Java 11? Are there any known issues/gotchas?

(My app compiles, passes integration tests and seems to be running just fine with Java 11 JDK and Runtime)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.