ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Warner Onstine" <warn...@gmail.com>
Subject trying to bypass xml config/mapping
Date Mon, 19 Nov 2007 19:47:12 GMT
Ok, so admittedly I'm pushing things a bit here, but I'm hoping
someone can help me see what I'm doing wrong (or point me in the right
direction. I am attempting to write a small groovy framework that gets
rid of the xml config and mapping files.

Where I'm running into trouble right now is in running my test. I have
a basic config setup and one MappedStatement. I know that my statement
is setup as when I query the delegate it comes back with my current
statement. But when I run the test it just "hangs" in some kind of
infinite loop.

I've tracked this down to this piece of code, but can't figure out why
it's dying:

  public void startTransaction(SessionScope session) throws SQLException {
    try {
    } catch (TransactionException e) {
      throw new NestedSQLException("Could not start transaction.
Cause: " + e, e);

I'm sure it's because I missed some configuration property when I was
setting up the delegate but I'm not sure what it might be. Here's my
groovy version of setting up the delegate:

	def public SqlMapClient buildSqlMapClient(DBConfiguration config) {
        def connection = config.getTestConnection()
	    def delegate = new SqlMapExecutorDelegate()
        def client = new SqlMapClientImpl(delegate)
        def dsConfig = ["JDBC.Driver": connection.driver,
                        "JDBC.ConnectionURL": connection.url +
                        "JDBC.Username": connection.username,
                        "JDBC.Password": connection.password,
                        "JDBC.DefaultAutoCommit": "false"]
        def ds = new SimpleDataSource(dsConfig)
        def txMgrConfig = new JdbcTransactionConfig()
        def txManager = new TransactionManager(txMgrConfig)
        return client

Thanks in advance for all the help!


Warner Onstine - Programmer/Author
New book on Tapestry 4!
Tapestry 101 available at

View raw message