Issue 1:
Barry Kaplan opened SPR-1149 and commented

FactoryBean's are excluded from implementing a whole host of post processor interfaces (due to the fact that getBeansOfType et all exclude FactoryBeans from their results). When building a set of spring beans for an existing product/library the use of FactoryBean is often required. Also it is often required to perform post processing for these library beans.

A concrete example is drools-spring. The class WorkingMemoryFactoryBean constructs a drools WorkingMemory instance. This /must/ be done via FactoryBean due to restrictions on the drools api. Drools defines an interface WorkingMemoryListener. I would like for WorkingMemoryFactoryBean to declare a property 'autoAddListeners' which will scan the BeanFactory for instances of WorkingMemoryListener and add it the WorkingMemory created by the FactoryBean.

The above is not possible with 1.2.2 or 1.2.3-dev, because WorkingMemoryFactoryBean cannot implement any post processor interfaces (not BeanPostProcessor, BeanFactoryPostProcessor, nor ApplicationListener). This requires a seperate bean to be defined in the context just to search for WorkingMemory beans. This is noise. The cleanest and most encapsulated place for this behavior is in the WorkingMemoryFactoryBean.

There are lots of other examples. I having a similar troubles with my spring integration for the quickfixj project.

I can't see any technical reason why FactoryBean's need to be excluded in this way. Maybe it was because at some in the past creating the FactoryBean instance always trigger the call of getObject. But this does not seem to be the case anywmore. Is there some reason I am not aware of?

Affects: 1.2.2

Issue Links:

#5847 Allow for getBeanNameOfType to return FacotryBeans ("is duplicated by")

Issue 2:
Jon Brisbin opened SPR-2835 and commented

Whenever I use the Spring classes for JDBC access to an AS400 stored procedure, the call to getString() generates a "Function sequence error".

I have a CallableStatementCreator that does a prepareCall() and sets the parameters, including an output parameter. I also have a CallableStatementCallback that handles getting the value of the output parameter, but no matter what I've tried, I keep getting a "Function sequence error" when I do a getString() on the callable statement, after the execute.

This problem does not exist when called through normal JDBC, only when using Spring callbacks and JdbcTemplate to call the output parameters from an AS400 stored procedure call.

Java test class to duplicate the problem:

import java.io.PrintWriter;

import java.sql.CallableStatement;

import java.sql.Connection;

import java.sql.DriverManager;

import java.sql.ParameterMetaData;

import java.sql.ResultSet;

import java.sql.SQLException;

import java.sql.Types;

import javax.sql.DataSource;

import org.dom4j.Document;

import org.dom4j.DocumentFactory;

import org.dom4j.Element;

import org.springframework.dao.DataAccessException;

import org.springframework.jdbc.core.CallableStatementCal lback;

import org.springframework.jdbc.core.CallableStatementCre ator;

import org.springframework.jdbc.core.JdbcTemplate;

public class Main

{

/**

@param args

*/

public static void main( String[] arg )

{

try {

Class.forName( "com.ibm.as400.access.AS400JDBCDriver" );

final Connection conn = DriverManager.getConnection( "jdbc:as400://HOSTNAME", "USER", "PASSWORD" );

JdbcTemplate jdbcTmpl = new JdbcTemplate( new DataSource()

{

public Connection getConnection() throws SQLException

{

return conn;

}

public Connection getConnection( String username, String password ) throws SQLException

{

return conn;

}

public int getLoginTimeout() throws SQLException

{

return 0;

}

public PrintWriter getLogWriter() throws SQLException

{

return new PrintWriter( System.out );

}

public void setLoginTimeout( int seconds ) throws SQLException

{}

public void setLogWriter( PrintWriter out ) throws SQLException

{}

} );

CallableStatementCreator csc = new CallableStatementCreator()

{

public CallableStatement createCallableStatement( Connection conn ) throws SQLException

{

CallableStatement cs = conn.prepareCall( "call weblib.sptest(?,?)",

ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY );

cs.setString( 1, "TEST" );

cs.registerOutParameter( 2, Types.VARCHAR );

return cs;

}

};

CallableStatementCallback csCallback = new CallableStatementCallback()

{

public Object doInCallableStatement( CallableStatement cs ) throws SQLException, DataAccessException

{

Document d = DocumentFactory.getInstance().createDocument();

Element root = d.addElement( "root" );

ParameterMetaData pm = cs.getParameterMetaData();

for ( int j = 1; j <= pm.getParameterCount(); j++ ) {

System.out.println( "Parameter #" + String.valueOf( j ) );

System.out.println( "Type: " + pm.getParameterTypeName( j ) );

if ( ( pm.getParameterMode( j ) == ParameterMetaData.parameterModeOut )

|| ( pm.getParameterMode( j ) == ParameterMetaData.parameterModeInOut ) ) {

System.out.println( "Value=" + cs.getString( j ) );

}

}

return root;

}

};

jdbcTmpl.execute( csc, csCallback );

try {

conn.close();

} catch ( Throwable t ) {}

} catch ( Throwable t ) {

t.printStackTrace();

}

}

static void p( String msg )

{

System.out.println( msg );

}

}

SQL definition on the 400:

DROP PROCEDURE weblib/sptest;

CREATE PROCEDURE weblib/sptest

(IN input char(10),

OUT output CHAR(10))

LANGUAGE RPGLE

EXTERNAL NAME WEBLIB/WB0011

PARAMETER STYLE GENERAL;

RPG code:

C *ENTRY PLIST

C PARM IN 10

C PARM RTN 10

C*

C EVAL RTN = 'TEST'

C*

C* END OF PROGRAM

C SETON LR

C RETURN

Affects: 2.0 final