You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ibatis.apache.org by Leandro Sales <le...@gmail.com> on 2009/09/14 15:23:52 UTC

Ibatis Migrator using a JNDI based connection

Hi,
I was wondering if wasn't possible to get the connection used by Ibatis
Migrator from a JNDI resource.

I'm using migrator not as command line but inside a web application. Every
time I redeploy my application, a servlet is started up and tries to "up"
the version of the database (using the UpCommand Class). The problem is that
now I need to repeat the database config inside the migrator property file.
If I could just set a jndi resource like "comp/env/jdbc/myapp" would be very
nice.

I don't know if you were thinking about this kind of usage for Ibatis
Migrator, but it seems to be a good idea.


Leandro

Parameters mapping to same Property (.Net)

Posted by James Armstead <ja...@A-t-g.com>.
Why is iBatis built to only allow you to map a single column to a single
property?

 

Say you have:

 

<parameter column="EnteredDt" property="EnteredDt">

<parameter column="OriginalEnteredDt" property="EnteredDt">

 

The EnteredDt get set right before Save because of a custom hook that
has been added in to set the Database time into the EnteredDt before
saving, so we want to use the EnteredDt property. Why would iBatis be
built to build 2 arrays with the property as the key? Making it
impossible to have a 2 columns mapped to the same property because the
keys conflict thus the the column array is larger than the property
array throwing a ArgumentOutOfRange Exception? 

 

Is there a way around this other than checking to see if
OriginalEnteredDt is empty and if it is then return EnteredDt?

 


Re: Ibatis Migrator using a JNDI based connection

Posted by Clinton Begin <cl...@gmail.com>.
Nope, hadn't thought of that. Can you create a JIRA Feature Request so that
we don't forget about it?
Cheers,
Clinton

On Mon, Sep 14, 2009 at 7:23 AM, Leandro Sales <le...@gmail.com>wrote:

> Hi,
> I was wondering if wasn't possible to get the connection used by Ibatis
> Migrator from a JNDI resource.
>
> I'm using migrator not as command line but inside a web application. Every
> time I redeploy my application, a servlet is started up and tries to "up"
> the version of the database (using the UpCommand Class). The problem is that
> now I need to repeat the database config inside the migrator property file.
> If I could just set a jndi resource like "comp/env/jdbc/myapp" would be very
> nice.
>
> I don't know if you were thinking about this kind of usage for Ibatis
> Migrator, but it seems to be a good idea.
>
>
> Leandro
>