ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Javier Leyba" <xle...@gmail.com>
Subject How commit works
Date Tue, 05 Sep 2006 13:44:52 GMT
Hi

I've defined my sqlmaps with

<transactionManager type="JDBC">
                <dataSource type="JNDI">
                        <property name="context.java.naming.factory.initial"

value="org.jnp.interfaces.NamingContextFactory" />
                        <property name="context.java.naming.provider.url"
                                value="jnp://localhost:2199" />
                        <property name="context.java.naming.factory.url.pkgs"
                                value="org.jboss.naming:org.jnp.interfaces" />
                        <property name="DataSource"
                                value="java:comp/env/jdbc/MySQLDB" />
                        <property name="JDBC.DefaultAutoCommit" value="false" />
                </dataSource>
        </transactionManager>

and in my program I did:

try {
			sqlMap = NotificationsSqlConfig.getSqlMapInstance();
			sqlMap.startTransaction();
			gr = (GenericResult) sqlMap.queryForObject("insertSourceType", sourceTypeId);
			sqlMap.commitTransaction();
		} catch (Exception e) {
			logger.error("insertSourceType(String)", e); //$NON-NLS-1$
			throw new RemoteException(e.getMessage(),e);
		} finally {
			try {
				sqlMap.endTransaction();
			} catch (Exception e) {
				throw new RemoteException(e.getMessage(),e);
			}
		}


to call a storedProcedure.

The stored procedure return me 1 row affected but data is never inserted in DB.

But, if I call stored procedure from a sql console it work well.

Is there something I forget in my config ?

Thanks in advance



J

Mime
View raw message