Re: MySQL and MSSQL in same java application

"Joachim Durchholz [email protected] [SimpleORM]" <[email protected]> Fri, 07 Nov 2014 10:23:33 +0100
Newsgroups gmane.comp.java.orm.simpleorm
Message-ID <[email protected]>
Am 07.11.2014 um 04:15 schrieb anthony berglas [email protected] 
[SimpleORM]:
> Ha!  There lies the rub.  It is a Hibernate world, in all its glory.  And
> about 5% of it is actually useful.

If you have limited amounts of data and stick to short transactions 
(which is a good idea anyway), Hibernate actually works quite well.

The real problem with Hibernate is its promise of "map records to POJOs 
and work with POJOs normal", on which it does not deliver. (No ORM can 
deliver on such a promise, no normal POJO may go "out of sync" due to 
concurrent updates.)

> If you find something let me know.  All I have seen is rubbish.  Lots of
> mapping to objects using reflection, nothing useful.  What is wanted is
> something simple.

Jooq seems interesting. Instead of hiding SQL, it offers a (largely) 
typesafe SQL construction and result extraction API.
I have not used it myself, and it's started to go into feature bloat 
mode, so there may be caveats, but at least it's a fresh and useful(!) 
approach.

> A project that I am working on now has some very simple code (not written
> by me) that just wraps SQL, sample below.  You could knock something up
> yourself like that pretty quick.  If you make it into a clean module please
> post it to this list.  But that still leaves many issues.

First thing I'd do is change the interface to not use checked 
exceptions. Checked exceptions are on of these things that sound nice in 
theory but turn into pure evil in practice.

Use unchecked exceptions.
If you find your applications need to do something specific with 
specific JDBC failure modes, extend the API to allow for that.

Oh, and if you want to do something really useful, structure the API 
around some kind of repeatable ApplicationTransaction or whatever you 
name it.
The issue is that at least Oracle has several failure modes where you 
can simply retry the transaction from scratch and everything will be 
fine. The issue here isn't so much technical but that you'll have to 
explain to the user user that needs to re-enter his exactly same inputs 
"and now it works". Oh, and if a nightly batch run fails due to a 
transient error and your code does not retry, that's going to make 
everybody unhappy who wants current-day data, and your boss, too.


------------------------------------
Posted by: Joachim Durchholz <[email protected]>
------------------------------------


------------------------------------

Yahoo Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/SimpleORM/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/SimpleORM/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo Groups is subject to:
    https://info.yahoo.com/legal/us/yahoo/utos/terms/