Announcement Announcement Module
Collapse

Spring Modules forum decommissioned in favor of Spring Extensions

As the Spring Modules project has been replaced by the Spring Extensions (http://www.springsource.org/extensions) project, this forum has been decommissioned in favour of Spring Extensions one at:
http://forum.springsource.org/forumdisplay.php?f=44

Please see the Spring Extensions home page for a complete list of current projects in Java, .NET and ActionScript. You can also propose one if you want.

Cheers,
Costin Leau
SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
http://twitter.com/costinl
See more
See less
DataSourceUtils.isConnectionTransactional always returns false Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • DataSourceUtils.isConnectionTransactional always returns false

    I have created a transactional datasource using the jtdsDataSource for Sybase. I actually get a pooled connection from a XAConnection as follows;

    HTML Code:
    private void initDNADataSource(){
    		ApplicationContext ac = new ClassPathXmlApplicationContext(
    		"mail-service.xml");
    		JtdsDataSource ds=(JtdsDataSource)ac.getBean("datasource2");
    		assertTrue(ds!=null);
    		try {
    			assertTrue(ds.getXAConnection().getConnection()!=null);
    			System.out.println("Supports Transactions is "+ds.getXAConnection().getConnection().getMetaData().supportsTransactions());
    			boolean b=DataSourceUtils.isConnectionTransactional(ds.getXAConnection().getConnection(), ds);
    			System.out.println("DataSource is transactional is "+b);
    			//System.exit(4);
    		} catch (SQLException e) {
    			// TODO Auto-generated catch block
    			e.printStackTrace();
    		}
    		
    	}
    However, the isConnectionTransactional always returns false even though I am clearly obtaining a transactional connection. Does anyone know why this so? I am using the jtds sybase driver.
Working...
X