by Rob 21 Oct 12:45
Features for next version... declarative transactions/Spring transaction integration

- Declarative Transactions
.. using annotations... requires Enhancement

- Spring Transaction Integration

- (maybe) mapping Unique/Foreign Constraint violations
.. with a specific exception(s) that extends PersistenceException

So we are now very close to what I'd say is v1.0 API. I'm getting a version of the source code into subversion.

As a side note, I also have a plan to develop a DAO framework that maybe interesting for some...

03 Nov 11:09
by Rob

By Declarative Transactions... I mean you will be able to mark methods with a @Transactional annotation

@Transactional
public void runInTrans() {		
  User u1 = Ebean.find(User.class, 1);
  u1.setName("another name");
  Ebean.save(u1);
...
}

You will also be able to use a inner class form (using a TxRunnable or a TxCallable):

Ebean.execute(new TxRunnable() {
  public void run() {
    User u1 = Ebean.find(User.class, 1);
    u1.setName("another name");
    Ebean.save(u1);
    ...			
  }
});

This is working pretty well. I like it :)

05 Nov 08:47
by Rob

Ebean.currentTransaction()
---------------------------
Also adding Ebean.currentTransaction() ... to return the current transaction (or null if there is not one). You can use this inside a @Transactional method or inside a TxRunnable etc to get the current transaction.

You may want to do this to control cascading, batch side, get access to java.sql.Connection, savepoints etc.


ebean.properties (renamed from avaje.properties)
-----------------------------------------------
Also renaming avaje.properties to ebean.properties. Note that avaje.properties will still work but Ebean will search first for ebean.properties.

At this stage this next version will go out this month as version 1.0.0, and I'll put the Spring Transaction support into a following release.

24 Nov 08:29
by Rob

Release Notes for 1.0.0

- Add Declarative Transactions
- Add TxRunnable/TxCallable
- Add Ebean.currentTransaction()
- renamed from avaje.properties to ebean.properties
- Added Ebean.find() ... synonym for Ebean.createQuery()
- Added @Where annotation for @OneToMany properties
- Removed @LazyFetch annotation
- Fixed Bug 48

27 Nov 02:26
by florin

Would the interest in spring integration force users to use spring?

I feel like pulling my hair. I cannot get away from maven and spring. Pretty much everything is dirtied by these tools. I came to learn Ebean and try use it my next project. Why do all java projects need to bloat and save the world!?

I hope strongly that I am wrong.

Good luck with a great tool.

27 Nov 08:07
by Rob

>> Would the interest in spring integration force users to use spring?
No.

The "spring integration" that I am thinking about for Ebean, is where someone is using Spring to manage their transactions, and they want to use Ebean within a Spring transaction.

Another way of looking at it is that Ebean should play nicely with external (non-Ebean) transaction managers, and the first external transaction manager to do so would be Spring.

>> I feel like pulling my hair. I cannot get away from maven and spring. ...
Hmmm, yes the point I'm hearing from that is that often "less is more". If Ebean tries to do everything and ends up being too complex then it loses its original raison d?????tre.

The way I see it is that the features I'd like to add (on my wishlist) are mostly integration points (external transaction manager, external cache manager etc) and are not going to change the internals much at all.

... but yes, if Ebean starts to bloat then that would not be so good. Something to keep in mind and be reminded of periodically :)

Thanks, Rob.

27 Nov 08:08
by Rob

.... loses its original raison d'etre - "reason for being".

27 Nov 19:09
by florin

O, good. I came back to check on your answer. I'm better now.

Need of transactions are not debatable. But Spring? I develop small enough projects where spring is not 'light'.

It's validation that I see as a good plug-able module.

I've read the docs. It looks great. Keep it up.

Create a New Topic

Title:
Body:
 
Introduction User Guide (pdf) Install/Configure Public JavaDoc Whitepapers
General Database Specific Byte Code Deployment Annotations Features
Top Bugs Top Enhancements
woResponse