Hi All,
I am planning to integrate cloverETL into my spring app. Conceptually I imagine this to work this way(see below) but I wonder if someone did it before and can give me few valuable advices or point to some documentation/articles/blogposts about it.
So the way I think it may work is like this:
- Spring will create all DBConnection beans that will get injected into the read/write wrappers that use them to load/sava data.(though I am currently mostly puzzled by how to pass JDBC connections managed by Spring to the graph that I read from XML file, for instance)
- Those object will get injected into TransformationGraph object as a part of the graph
-TransformationGraph will get injected into the actuall spring bean that starts it.
I am a still very uncertain about CloverETL capabilities , so I would appreciate any help or links to documentation.
Hello,
I wouldn’t use Clover with Spring in the way you described. It’s not good idea to mix instances of GraphElement managed by Spring and instances managed by Clover in the same graph.
TransformationGraph makes compact unit with its elements.
Basically your problem is to use DB connection, which is not specified in graph XML, but in Spring configuration.
I would solve it like this:
At the moment of initialization or just before execution of graph:
- Create instance of DBConnection with parameters (url, user, pass, etc.) taken from your Spring configuration. Use ID, which is used in graph XML as reference to the DB connection.
- Create instance of graph from XML
- Inject instance of DBconnection into graph instance: transformationGraph.addConnection(IConnection connection) This has to be done before graph init.
- init graph
- now you have instance of transformation graph, which may be used by Spring bean
Regards,
Martin Varecha