[mybatis-spring] working towards the RC1

classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

[mybatis-spring] working towards the RC1

Simone Tripodi
Hi all guys,
for what I can see, we miss 2 important steps for the RC1:
 * documentation: we need to write the user manual, I'll start ASAP
taking inspiration from Giovanni Cuccu's blog post[1];
 * the SqlSessionManager is not supported yet at all... any volunteer?
Hunter/Eduardo? :)
Have a nice day,
Simo

[1] http://www.jpadbf.org/2010/09/mybatis3-spring3-integration-a-first-look/

http://people.apache.org/~simonetripodi/
http://www.99soft.org/
Reply | Threaded
Open this post in threaded view
|

Re: [mybatis-spring] working towards the RC1

Giovanni Cuccu
Ciao Simone,
    the company that hired me as a consultant is squeezing me like a
lemon. I hope to contribute with another post and the writing of some
parts of the docbook document.
Can you wait until the next monday? I hope to write something in the
next few days.
Giovanni

--------------------------------------------------------------------
"You don't know the power of dark side" - Darth Vader



On Thu, Sep 16, 2010 at 12:59 PM, Simone Tripodi
<[hidden email]> wrote:

> Hi all guys,
> for what I can see, we miss 2 important steps for the RC1:
>  * documentation: we need to write the user manual, I'll start ASAP
> taking inspiration from Giovanni Cuccu's blog post[1];
>  * the SqlSessionManager is not supported yet at all... any volunteer?
> Hunter/Eduardo? :)
> Have a nice day,
> Simo
>
> [1] http://www.jpadbf.org/2010/09/mybatis3-spring3-integration-a-first-look/
>
> http://people.apache.org/~simonetripodi/
> http://www.99soft.org/
>
Reply | Threaded
Open this post in threaded view
|

Re: [mybatis-spring] working towards the RC1

Simone Tripodi
Hi Giovanni,
don't worry, I perfectly understand your feeling, I work exactly at
the same condition. We've to admit that unfortunately IT market in
Italy really sucks.
There's no rush, take your time and thanks in advance :)
Have a nice day,
Simo

PS where are you located? I'm in Rome

http://people.apache.org/~simonetripodi/
http://www.99soft.org/



On Thu, Sep 16, 2010 at 2:42 PM, Giovanni Cuccu
<[hidden email]> wrote:

> Ciao Simone,
>    the company that hired me as a consultant is squeezing me like a
> lemon. I hope to contribute with another post and the writing of some
> parts of the docbook document.
> Can you wait until the next monday? I hope to write something in the
> next few days.
> Giovanni
>
> --------------------------------------------------------------------
> "You don't know the power of dark side" - Darth Vader
>
>
>
> On Thu, Sep 16, 2010 at 12:59 PM, Simone Tripodi
> <[hidden email]> wrote:
>> Hi all guys,
>> for what I can see, we miss 2 important steps for the RC1:
>>  * documentation: we need to write the user manual, I'll start ASAP
>> taking inspiration from Giovanni Cuccu's blog post[1];
>>  * the SqlSessionManager is not supported yet at all... any volunteer?
>> Hunter/Eduardo? :)
>> Have a nice day,
>> Simo
>>
>> [1] http://www.jpadbf.org/2010/09/mybatis3-spring3-integration-a-first-look/
>>
>> http://people.apache.org/~simonetripodi/
>> http://www.99soft.org/
>>
>
Reply | Threaded
Open this post in threaded view
|

Re: working towards the RC1

Eduardo Macarron
In reply to this post by Simone Tripodi

I must confess that I did not know anything about that
SqlSessionManager, I suppose this is because we had working versions
before this class was created.

I have seen that this class holds sqlsessions on threadlocal. It seems
to me like a IB2 SqlMapClient :)

I would dare to say that there is no need for using it because actual
implementation already keeps SqlSessions tied to threads using the
Spring transaction manager.


On 16 sep, 12:59, Simone Tripodi <[hidden email]> wrote:

> Hi all guys,
> for what I can see, we miss 2 important steps for the RC1:
>  * documentation: we need to write the user manual, I'll start ASAP
> taking inspiration from Giovanni Cuccu's blog post[1];
>  * the SqlSessionManager is not supported yet at all... any volunteer?
> Hunter/Eduardo? :)
> Have a nice day,
> Simo
>
> [1]http://www.jpadbf.org/2010/09/mybatis3-spring3-integration-a-first-look/
>
> http://people.apache.org/~simonetripodi/http://www.99soft.org/
Reply | Threaded
Open this post in threaded view
|

Re: working towards the RC1

Clinton Begin
Administrator
Not sure if this is relevant to the conversation... but a couple of things:

* SqlSessionManager is indeed like SqlMapClient from IB2
* It was added after the original release, as people missed SqlMapClient (awww.... :-)
* It is totally counter to Dependency Injection and thus should probably not be used in conjunction with or by DI  frameworks like Spring or Guice, as it tends to take control of transactions and sessions and uses ThreadLocals etc,.

Clinton

On Thu, Sep 16, 2010 at 7:40 AM, Eduardo <[hidden email]> wrote:

I must confess that I did not know anything about that
SqlSessionManager, I suppose this is because we had working versions
before this class was created.

I have seen that this class holds sqlsessions on threadlocal. It seems
to me like a IB2 SqlMapClient :)

I would dare to say that there is no need for using it because actual
implementation already keeps SqlSessions tied to threads using the
Spring transaction manager.


On 16 sep, 12:59, Simone Tripodi <[hidden email]> wrote:
> Hi all guys,
> for what I can see, we miss 2 important steps for the RC1:
>  * documentation: we need to write the user manual, I'll start ASAP
> taking inspiration from Giovanni Cuccu's blog post[1];
>  * the SqlSessionManager is not supported yet at all... any volunteer?
> Hunter/Eduardo? :)
> Have a nice day,
> Simo
>
> [1]http://www.jpadbf.org/2010/09/mybatis3-spring3-integration-a-first-look/
>
> http://people.apache.org/~simonetripodi/http://www.99soft.org/

Reply | Threaded
Open this post in threaded view
|

Re: working towards the RC1

Eduardo Macarron
Seinzing the opportunity you are on this post Clinton let me revive a
conversation we have some time ago.

SqlSession.getMapper() does not fit well with IoC containers, I may
say that we need another API for this.

The main problem is that Mappers are created and injected during
application startup but at this time there are no SqlSessions.
Besides, mappers hold a reference to the session that created them so
they wont survive the SqlSession they were built from.

So for injecting a mapper we must create a proxy during startup and
inject it. On each call to this proxy we get the current SqlSession,
call getMapper and invoke the same method on this mapper.

That means that on each call to an injected mapper method a new
MyBatis mapper is created (with some introspection) and discarded.

Its not a very big problem. We already talk about it and indeed it may
have low impact on performance. But the point is that this seems to be
able to be improved with small changes.

I may say that a Dao or a Mapper is.. "structural" while sessions are
"behavioural". I mean a transaction/session is built when it is needed
but a Mapper is just there as any other bean.

During startup mapper methods could be created and stored inside
configuration. Then MyBatis getMapper() will just build a proxy that
holds a SqlSession it was created from, and the list of mapper
methods. Spring (an maybe Guice) proxy will be built on startup (as it
is now) and it will just get the current transaction SqlSession and
call a MapperMethod (or a new API method) passing the SqlSession as a
parameter. Something like this:
configuration.getMapperMethod(sqlSession).invoke().

On 16 sep, 19:51, Clinton Begin <[hidden email]> wrote:

> Not sure if this is relevant to the conversation... but a couple of things:
>
> * SqlSessionManager is indeed like SqlMapClient from IB2
> * It was added after the original release, as people missed SqlMapClient
> (awww.... :-)
> * It is totally counter to Dependency Injection and thus should probably not
> be used in conjunction with or by DI  frameworks like Spring or Guice, as it
> tends to take control of transactions and sessions and uses ThreadLocals
> etc,.
>
> Clinton
>
>
>
> On Thu, Sep 16, 2010 at 7:40 AM, Eduardo <[hidden email]> wrote:
>
> > I must confess that I did not know anything about that
> > SqlSessionManager, I suppose this is because we had working versions
> > before this class was created.
>
> > I have seen that this class holds sqlsessions on threadlocal. It seems
> > to me like a IB2 SqlMapClient :)
>
> > I would dare to say that there is no need for using it because actual
> > implementation already keeps SqlSessions tied to threads using the
> > Spring transaction manager.
>
> > On 16 sep, 12:59, Simone Tripodi <[hidden email]> wrote:
> > > Hi all guys,
> > > for what I can see, we miss 2 important steps for the RC1:
> > >  * documentation: we need to write the user manual, I'll start ASAP
> > > taking inspiration from Giovanni Cuccu's blog post[1];
> > >  * the SqlSessionManager is not supported yet at all... any volunteer?
> > > Hunter/Eduardo? :)
> > > Have a nice day,
> > > Simo
>
> > > [1]
> >http://www.jpadbf.org/2010/09/mybatis3-spring3-integration-a-first-look/
>
> > >http://people.apache.org/~simonetripodi/http://www.99soft.org/
Reply | Threaded
Open this post in threaded view
|

Re: [mybatis-spring] working towards the RC1

Clinton Begin
Administrator
Mappers need not be created at startup.

They're interfaces, thus easily proxyable.


Clinton

On 2010-09-16, Eduardo <[hidden email]> wrote:

> Seinzing the opportunity you are on this post Clinton let me revive a
> conversation we have some time ago.
>
> SqlSession.getMapper() does not fit well with IoC containers, I may
> say that we need another API for this.
>
> The main problem is that Mappers are created and injected during
> application startup but at this time there are no SqlSessions.
> Besides, mappers hold a reference to the session that created them so
> they wont survive the SqlSession they were built from.
>
> So for injecting a mapper we must create a proxy during startup and
> inject it. On each call to this proxy we get the current SqlSession,
> call getMapper and invoke the same method on this mapper.
>
> That means that on each call to an injected mapper method a new
> MyBatis mapper is created (with some introspection) and discarded.
>
> Its not a very big problem. We already talk about it and indeed it may
> have low impact on performance. But the point is that this seems to be
> able to be improved with small changes.
>
> I may say that a Dao or a Mapper is.. "structural" while sessions are
> "behavioural". I mean a transaction/session is built when it is needed
> but a Mapper is just there as any other bean.
>
> During startup mapper methods could be created and stored inside
> configuration. Then MyBatis getMapper() will just build a proxy that
> holds a SqlSession it was created from, and the list of mapper
> methods. Spring (an maybe Guice) proxy will be built on startup (as it
> is now) and it will just get the current transaction SqlSession and
> call a MapperMethod (or a new API method) passing the SqlSession as a
> parameter. Something like this:
> configuration.getMapperMethod(sqlSession).invoke().
>
> On 16 sep, 19:51, Clinton Begin <[hidden email]> wrote:
>> Not sure if this is relevant to the conversation... but a couple of
>> things:
>>
>> * SqlSessionManager is indeed like SqlMapClient from IB2
>> * It was added after the original release, as people missed SqlMapClient
>> (awww.... :-)
>> * It is totally counter to Dependency Injection and thus should probably
>> not
>> be used in conjunction with or by DI  frameworks like Spring or Guice, as
>> it
>> tends to take control of transactions and sessions and uses ThreadLocals
>> etc,.
>>
>> Clinton
>>
>>
>>
>> On Thu, Sep 16, 2010 at 7:40 AM, Eduardo <[hidden email]>
>> wrote:
>>
>> > I must confess that I did not know anything about that
>> > SqlSessionManager, I suppose this is because we had working versions
>> > before this class was created.
>>
>> > I have seen that this class holds sqlsessions on threadlocal. It seems
>> > to me like a IB2 SqlMapClient :)
>>
>> > I would dare to say that there is no need for using it because actual
>> > implementation already keeps SqlSessions tied to threads using the
>> > Spring transaction manager.
>>
>> > On 16 sep, 12:59, Simone Tripodi <[hidden email]> wrote:
>> > > Hi all guys,
>> > > for what I can see, we miss 2 important steps for the RC1:
>> > >  * documentation: we need to write the user manual, I'll start ASAP
>> > > taking inspiration from Giovanni Cuccu's blog post[1];
>> > >  * the SqlSessionManager is not supported yet at all... any volunteer?
>> > > Hunter/Eduardo? :)
>> > > Have a nice day,
>> > > Simo
>>
>> > > [1]
>> >http://www.jpadbf.org/2010/09/mybatis3-spring3-integration-a-first-look/
>>
>> > >http://people.apache.org/~simonetripodi/http://www.99soft.org/

--
Sent from my mobile device
Reply | Threaded
Open this post in threaded view
|

Re: working towards the RC1

Eduardo Macarron
Back to topic. I have written a really small guide base on the sample
thats in svn. I will be just two or three pages. As I don´t know how
to upload this without creating a issue I have directly mailed it to
Simo.

It just needs to be converted to docbkx and its ready for revision and
completion on this forum.

Giovanii If you want I cant send it also to you as you have
demonstrated you are good guide writer. Feel free to change whatever
you want, its a draft.
Reply | Threaded
Open this post in threaded view
|

Re: working towards the RC1

Simone Tripodi
In reply to this post by Clinton Begin
OFF TOPIC:

Clinton,
honestly we found the SqlSessionManager more than useful and helped us
a *lot* managing stuff in the guice subproject, the @Transactional
interceptor relies on it and users are now completely free from
extending dao/templates. Moreover, with our module clients can
optionally require the direct Mapper instance injection; with this
method, applications don't even seem rely on MyBatis :P An important
note is that users are not forced to use our approach, they are free
to require the injection of Mappers, SqlSessionManager or
SqlSessionFactory.
BTW mine is just a different point of view, you can see its use in the
testcases and better explained in the user guide.

IN TOPIC
Thanks a lot Edu for the email, I'll start porting it to dockbook
during the weekend. Of course Giovanni's help will be more than needed
and appreciated.

Good night guys, now off to bed that I'm too tired :)
Yours,
Simo

http://people.apache.org/~simonetripodi/
http://www.99soft.org/



On Thu, Sep 16, 2010 at 7:51 PM, Clinton Begin <[hidden email]> wrote:

> Not sure if this is relevant to the conversation... but a couple of things:
> * SqlSessionManager is indeed like SqlMapClient from IB2
> * It was added after the original release, as people missed SqlMapClient
> (awww.... :-)
> * It is totally counter to Dependency Injection and thus should probably not
> be used in conjunction with or by DI  frameworks like Spring or Guice, as it
> tends to take control of transactions and sessions and uses ThreadLocals
> etc,.
>
> Clinton
> On Thu, Sep 16, 2010 at 7:40 AM, Eduardo <[hidden email]> wrote:
>>
>> I must confess that I did not know anything about that
>> SqlSessionManager, I suppose this is because we had working versions
>> before this class was created.
>>
>> I have seen that this class holds sqlsessions on threadlocal. It seems
>> to me like a IB2 SqlMapClient :)
>>
>> I would dare to say that there is no need for using it because actual
>> implementation already keeps SqlSessions tied to threads using the
>> Spring transaction manager.
>>
>>
>> On 16 sep, 12:59, Simone Tripodi <[hidden email]> wrote:
>> > Hi all guys,
>> > for what I can see, we miss 2 important steps for the RC1:
>> >  * documentation: we need to write the user manual, I'll start ASAP
>> > taking inspiration from Giovanni Cuccu's blog post[1];
>> >  * the SqlSessionManager is not supported yet at all... any volunteer?
>> > Hunter/Eduardo? :)
>> > Have a nice day,
>> > Simo
>> >
>> >
>> > [1]http://www.jpadbf.org/2010/09/mybatis3-spring3-integration-a-first-look/
>> >
>> > http://people.apache.org/~simonetripodi/http://www.99soft.org/
>
Reply | Threaded
Open this post in threaded view
|

Re: [mybatis-spring] working towards the RC1

Clinton Begin
Administrator
For guice I can see that, because it doesn't have its own transaction
and data access modules.  Spring on the other hand has advanced
transaction services, datasource implementations and excellent
exception wrappers.  For spring those should be preferred to
SqlSessionManager's behaviour.

Clinton

On 2010-09-16, Simone Tripodi <[hidden email]> wrote:

> OFF TOPIC:
>
> Clinton,
> honestly we found the SqlSessionManager more than useful and helped us
> a *lot* managing stuff in the guice subproject, the @Transactional
> interceptor relies on it and users are now completely free from
> extending dao/templates. Moreover, with our module clients can
> optionally require the direct Mapper instance injection; with this
> method, applications don't even seem rely on MyBatis :P An important
> note is that users are not forced to use our approach, they are free
> to require the injection of Mappers, SqlSessionManager or
> SqlSessionFactory.
> BTW mine is just a different point of view, you can see its use in the
> testcases and better explained in the user guide.
>
> IN TOPIC
> Thanks a lot Edu for the email, I'll start porting it to dockbook
> during the weekend. Of course Giovanni's help will be more than needed
> and appreciated.
>
> Good night guys, now off to bed that I'm too tired :)
> Yours,
> Simo
>
> http://people.apache.org/~simonetripodi/
> http://www.99soft.org/
>
>
>
> On Thu, Sep 16, 2010 at 7:51 PM, Clinton Begin <[hidden email]>
> wrote:
>> Not sure if this is relevant to the conversation... but a couple of
>> things:
>> * SqlSessionManager is indeed like SqlMapClient from IB2
>> * It was added after the original release, as people missed SqlMapClient
>> (awww.... :-)
>> * It is totally counter to Dependency Injection and thus should probably
>> not
>> be used in conjunction with or by DI  frameworks like Spring or Guice, as
>> it
>> tends to take control of transactions and sessions and uses ThreadLocals
>> etc,.
>>
>> Clinton
>> On Thu, Sep 16, 2010 at 7:40 AM, Eduardo <[hidden email]>
>> wrote:
>>>
>>> I must confess that I did not know anything about that
>>> SqlSessionManager, I suppose this is because we had working versions
>>> before this class was created.
>>>
>>> I have seen that this class holds sqlsessions on threadlocal. It seems
>>> to me like a IB2 SqlMapClient :)
>>>
>>> I would dare to say that there is no need for using it because actual
>>> implementation already keeps SqlSessions tied to threads using the
>>> Spring transaction manager.
>>>
>>>
>>> On 16 sep, 12:59, Simone Tripodi <[hidden email]> wrote:
>>> > Hi all guys,
>>> > for what I can see, we miss 2 important steps for the RC1:
>>> >  * documentation: we need to write the user manual, I'll start ASAP
>>> > taking inspiration from Giovanni Cuccu's blog post[1];
>>> >  * the SqlSessionManager is not supported yet at all... any volunteer?
>>> > Hunter/Eduardo? :)
>>> > Have a nice day,
>>> > Simo
>>> >
>>> >
>>> > [1]http://www.jpadbf.org/2010/09/mybatis3-spring3-integration-a-first-look/
>>> >
>>> > http://people.apache.org/~simonetripodi/http://www.99soft.org/
>>
>

--
Sent from my mobile device
Reply | Threaded
Open this post in threaded view
|

Re: working towards the RC1

Hunter
I agree. If anything we should document that SqlSessionManager should
_not_ be used with Spring transactions.

Users _could_, if they just want to use Spring for dependency
injection, do the following:
<bean id="sqlSessionFactory"
class="org.mybatis.spring.SqlSessionFactoryBean">
  <property name="dataSource" ref="dataSource" />
  <property name="configLocation" value="classpath:sample/mybatis-
config.xml" />
</bean>
<bean id="sqlSessionManager"
class="org.apache.ibatis.session.SqlSessionManager" factory-
method="newInstance">
  <constructor-arg ref="sqlSessionFactory" />
</bean>

I am not sure why you would use Spring for DI and not transactions,
but you can do it. You just have to make sure _not_ to use this
SqlSessionManager to create a template / mapper like:
<bean id="sqlSessionTemplate"
class="org.mybatis.spring.SqlSessionTemplate">
  <constructor-arg ref="sqlSessionManager" />
</bean>

This will cause problems. At the very least it's going through another
Proxy. But the potential is there to get in a weird state with the
manager having one ThreadLocal sqlSession and Spring (via
SqlSessionUtils) having another ThreadLocal SqlSession.

On Sep 16, 6:31 pm, Clinton Begin <[hidden email]> wrote:

> For guice I can see that, because it doesn't have its own transaction
> and data access modules.  Spring on the other hand has advanced
> transaction services, datasource implementations and excellent
> exception wrappers.  For spring those should be preferred to
> SqlSessionManager's behaviour.
>
> Clinton
>
> On 2010-09-16, Simone Tripodi <[hidden email]> wrote:
>
>
>
>
>
> > OFF TOPIC:
>
> > Clinton,
> > honestly we found the SqlSessionManager more than useful and helped us
> > a *lot* managing stuff in the guice subproject, the @Transactional
> > interceptor relies on it and users are now completely free from
> > extending dao/templates. Moreover, with our module clients can
> > optionally require the direct Mapper instance injection; with this
> > method, applications don't even seem rely on MyBatis :P An important
> > note is that users are not forced to use our approach, they are free
> > to require the injection of Mappers, SqlSessionManager or
> > SqlSessionFactory.
> > BTW mine is just a different point of view, you can see its use in the
> > testcases and better explained in the user guide.
>
> > IN TOPIC
> > Thanks a lot Edu for the email, I'll start porting it to dockbook
> > during the weekend. Of course Giovanni's help will be more than needed
> > and appreciated.
>
> > Good night guys, now off to bed that I'm too tired :)
> > Yours,
> > Simo
>
> >http://people.apache.org/~simonetripodi/
> >http://www.99soft.org/
>
> > On Thu, Sep 16, 2010 at 7:51 PM, Clinton Begin <[hidden email]>
> > wrote:
> >> Not sure if this is relevant to the conversation... but a couple of
> >> things:
> >> * SqlSessionManager is indeed like SqlMapClient from IB2
> >> * It was added after the original release, as people missed SqlMapClient
> >> (awww.... :-)
> >> * It is totally counter to Dependency Injection and thus should probably
> >> not
> >> be used in conjunction with or by DI  frameworks like Spring or Guice, as
> >> it
> >> tends to take control of transactions and sessions and uses ThreadLocals
> >> etc,.
>
> >> Clinton
> >> On Thu, Sep 16, 2010 at 7:40 AM, Eduardo <[hidden email]>
> >> wrote:
>
> >>> I must confess that I did not know anything about that
> >>> SqlSessionManager, I suppose this is because we had working versions
> >>> before this class was created.
>
> >>> I have seen that this class holds sqlsessions on threadlocal. It seems
> >>> to me like a IB2 SqlMapClient :)
>
> >>> I would dare to say that there is no need for using it because actual
> >>> implementation already keeps SqlSessions tied to threads using the
> >>> Spring transaction manager.
>
> >>> On 16 sep, 12:59, Simone Tripodi <[hidden email]> wrote:
> >>> > Hi all guys,
> >>> > for what I can see, we miss 2 important steps for the RC1:
> >>> >  * documentation: we need to write the user manual, I'll start ASAP
> >>> > taking inspiration from Giovanni Cuccu's blog post[1];
> >>> >  * the SqlSessionManager is not supported yet at all... any volunteer?
> >>> > Hunter/Eduardo? :)
> >>> > Have a nice day,
> >>> > Simo
>
> >>> > [1]http://www.jpadbf.org/2010/09/mybatis3-spring3-integration-a-first-look/
>
> >>> >http://people.apache.org/~simonetripodi/http://www.99soft.org/
>
> --
> Sent from my mobile device
Reply | Threaded
Open this post in threaded view
|

Re: [mybatis-spring] working towards the RC1

Giovanni Cuccu
In reply to this post by Simone Tripodi
Hi all,
   I just written a new post on the blog for people interested start
using mybatis3 and spring3 with no mybatis2 experience.
you can read it at
http://www.jpadbf.org/2010/09/mybatis3-spring3-integration-using-mybatis3-new-features/
comments and feedback are welcome.
I'm not sure after reading the last comments on this thread if my
solution is using the correct beans. I'll try to read the last emails
with more attention and eventually I'll update the post (or start
another one)
Thanks,
   Giovanni

P.S. Simone I'm from Imola, but actually I work in Bologna
--------------------------------------------------------------------
"You don't know the power of dark side" - Darth Vader



On Thu, Sep 16, 2010 at 2:45 PM, Simone Tripodi
<[hidden email]> wrote:

> Hi Giovanni,
> don't worry, I perfectly understand your feeling, I work exactly at
> the same condition. We've to admit that unfortunately IT market in
> Italy really sucks.
> There's no rush, take your time and thanks in advance :)
> Have a nice day,
> Simo
>
> PS where are you located? I'm in Rome
>
> http://people.apache.org/~simonetripodi/
> http://www.99soft.org/
>
>
>
> On Thu, Sep 16, 2010 at 2:42 PM, Giovanni Cuccu
> <[hidden email]> wrote:
>> Ciao Simone,
>>    the company that hired me as a consultant is squeezing me like a
>> lemon. I hope to contribute with another post and the writing of some
>> parts of the docbook document.
>> Can you wait until the next monday? I hope to write something in the
>> next few days.
>> Giovanni
>>
>> --------------------------------------------------------------------
>> "You don't know the power of dark side" - Darth Vader
>>
>>
>>
>> On Thu, Sep 16, 2010 at 12:59 PM, Simone Tripodi
>> <[hidden email]> wrote:
>>> Hi all guys,
>>> for what I can see, we miss 2 important steps for the RC1:
>>>  * documentation: we need to write the user manual, I'll start ASAP
>>> taking inspiration from Giovanni Cuccu's blog post[1];
>>>  * the SqlSessionManager is not supported yet at all... any volunteer?
>>> Hunter/Eduardo? :)
>>> Have a nice day,
>>> Simo
>>>
>>> [1] http://www.jpadbf.org/2010/09/mybatis3-spring3-integration-a-first-look/
>>>
>>> http://people.apache.org/~simonetripodi/
>>> http://www.99soft.org/
>>>
>>
>
Reply | Threaded
Open this post in threaded view
|

Re: working towards the RC1

Eduardo Macarron
Hi again Giovanni,

Yep, you are using the right beans. Really good guide. Just a note:
there is no need to list mappers on mybatis config file. I mean that
you can remove this lines

<mappers>
        <mapper resource="maps/UserDaoV3.xml" />
</mappers>

in mybatisV3-config.xml and it should work fine.

ciao!


Reply | Threaded
Open this post in threaded view
|

Re: [mybatis-spring] working towards the RC1

Simone Tripodi
In reply to this post by Giovanni Cuccu
Guys,
in attachment the first version of the user manual, kindly provided by
Eduardo and re-packaged in docbook format.
Even if more than clear - at least for me - it is just the starting
point and we need to provide more detailed explanation, please provide
patches :)
To test your patches before submitting them, run

svn co https://mybatis.googlecode.com/svn/sub-projects/mybatis-spring/trunk
mybatis-spring && cd mybatis-spring && mvn package

the manual will be produced under

mybatis-spring/target/docbkx/pdf/mybatis-spring-1.0.0-SNAPSHOT-reference.pdf

Enjoy and many thanks in advance for your help!!!
Simo

http://people.apache.org/~simonetripodi/
http://www.99soft.org/



On Fri, Sep 17, 2010 at 8:47 AM, Giovanni Cuccu
<[hidden email]> wrote:

> Hi all,
>   I just written a new post on the blog for people interested start
> using mybatis3 and spring3 with no mybatis2 experience.
> you can read it at
> http://www.jpadbf.org/2010/09/mybatis3-spring3-integration-using-mybatis3-new-features/
> comments and feedback are welcome.
> I'm not sure after reading the last comments on this thread if my
> solution is using the correct beans. I'll try to read the last emails
> with more attention and eventually I'll update the post (or start
> another one)
> Thanks,
>   Giovanni
>
> P.S. Simone I'm from Imola, but actually I work in Bologna
> --------------------------------------------------------------------
> "You don't know the power of dark side" - Darth Vader
>
>
>
> On Thu, Sep 16, 2010 at 2:45 PM, Simone Tripodi
> <[hidden email]> wrote:
>> Hi Giovanni,
>> don't worry, I perfectly understand your feeling, I work exactly at
>> the same condition. We've to admit that unfortunately IT market in
>> Italy really sucks.
>> There's no rush, take your time and thanks in advance :)
>> Have a nice day,
>> Simo
>>
>> PS where are you located? I'm in Rome
>>
>> http://people.apache.org/~simonetripodi/
>> http://www.99soft.org/
>>
>>
>>
>> On Thu, Sep 16, 2010 at 2:42 PM, Giovanni Cuccu
>> <[hidden email]> wrote:
>>> Ciao Simone,
>>>    the company that hired me as a consultant is squeezing me like a
>>> lemon. I hope to contribute with another post and the writing of some
>>> parts of the docbook document.
>>> Can you wait until the next monday? I hope to write something in the
>>> next few days.
>>> Giovanni
>>>
>>> --------------------------------------------------------------------
>>> "You don't know the power of dark side" - Darth Vader
>>>
>>>
>>>
>>> On Thu, Sep 16, 2010 at 12:59 PM, Simone Tripodi
>>> <[hidden email]> wrote:
>>>> Hi all guys,
>>>> for what I can see, we miss 2 important steps for the RC1:
>>>>  * documentation: we need to write the user manual, I'll start ASAP
>>>> taking inspiration from Giovanni Cuccu's blog post[1];
>>>>  * the SqlSessionManager is not supported yet at all... any volunteer?
>>>> Hunter/Eduardo? :)
>>>> Have a nice day,
>>>> Simo
>>>>
>>>> [1] http://www.jpadbf.org/2010/09/mybatis3-spring3-integration-a-first-look/
>>>>
>>>> http://people.apache.org/~simonetripodi/
>>>> http://www.99soft.org/
>>>>
>>>
>>
>

mybatis-spring-1.0.0-SNAPSHOT-reference.pdf (26K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: working towards the RC1

Eduardo Macarron
Once again, great work Simo. I feel that RC1 is close ;)

Just fixed two small typos.
http://code.google.com/p/mybatis/issues/detail?id=106

Its late here, tomorrow will read it more carefully and will
contribute (if needed)
Reply | Threaded
Open this post in threaded view
|

Re: working towards the RC1

Raj Nagappan
Hi Giovanni, my comments relate mainly to your tutorial, though I
support the same things would apply to the PDF doco too. Overall I
think it's very good. Here are some minor suggestions for improvement:

1. It would be helpful to have a very simple UML diagram at the top
with some comments indicating where different classes logically
belong. I say this because there are lots of moving parts, so a
diagram that shows that the data source is part of your normal Spring
config and that the Mapper XML file is part of your normal Mybatis
config would be good for relating all the parts to each other.

2. There's lots of terminology floating around like Mapper, DAO,
Manager etc. and it gets a bit confusing at times. Like, what's this
class supposed to do, is it a Mapper or something else? Do I have just
one of these or one for every Mapper? So I would suggest standardizing
the terms with the same terms used in the main Mybatis manual. So I
think UserDAO should be UserMapper. SimpleManager is probably more
like UserDAO (or UserRepository if you use DDD naming conventions), in
any case the "Simple" prefix implies that it's a single manager class,
when it probably is actually tied to the User class so its name should
reflect that.

3. A small example of client code showing how to call and use the
beans, surround session with try/finally, TX management if required
etc would be greatly helpful in tying all the bits together.

4. Don't know if it's necessary but a small discussion on the
MapperFactoryBean and the fact that it's a factory bean might be
useful too. Especially for anyone using Spring java based config
because that doesn't have built-in factory bean lifecycle support yet
so a bit of work is required to get mapper beans that way. An
alternative Spring Java based config class would be great for people
using that method of config - I say that because it's a bit more like
the new Java based mapper interfaces for Mybatis so it preserves the
new Mybatis idea of typesafe mapper loading (no need to cast) which I
think is important. (I submitted one of these with my junit tests to
the integration project but I'm not sure where it finally ended up.)

Hope these help,
Raj.

On Sep 18, 7:32 am, Eduardo <[hidden email]> wrote:
> Once again, great work Simo. I feel that RC1 is close ;)
>
> Just fixed two small typos.http://code.google.com/p/mybatis/issues/detail?id=106
>
> Its late here, tomorrow will read it more carefully and will
> contribute (if needed)
Reply | Threaded
Open this post in threaded view
|

Re: working towards the RC1

Eduardo Macarron
In reply to this post by Simone Tripodi

Ciao Simo,

I uploaded some changes to manual patch is on issue 119.

- Added an installation section
- Changed chapter order to priorize injection over coding
- Paragraph reorder in SqlSessionTemplate chapter
- Grammatical corrections
- Included Puttibong issue 113 but I am not sure that that language-
>lang is right because it renders to black&white... please Simo have a
look at it.

thanks in advance!