Ibatis Migrator using a JNDI based connection

View: New views
3 Messages — Rating Filter:   Alert me  

Ibatis Migrator using a JNDI based connection

by Leandro Sales-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

Re: Ibatis Migrator using a JNDI based connection

by Clinton Begin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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 <leandro.shp@...> 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


Parameters mapping to same Property (.Net)

by James Armstead :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

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?