Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BeanIO 2.1.0.M2 incompatible with spring batch 2.2.5.RELEASE #106

Open
GoogleCodeExporter opened this issue Jul 16, 2015 · 1 comment
Open

Comments

@GoogleCodeExporter
Copy link

Hi,

First, thanx for your framework, it's helping a lot :)

I saw that your integration with spring batch is not working anymore.

In BeanIOFlatFileItemWriter, you get a new instance of 
TransactionAwareBufferedWriter. The constructor has changed for 
TransactionAwareBufferedWriter(FileChannel, Runnable for callback) since Nov 
13, 2012.

I change for my code the method like that : 

/**
* Creates a buffered writer opened to the beginning of the file
* for the given file channel.
*/
private Writer createBufferedWriter(FileChannel fileChannel, String encoding) {
    try {
        Writer writer = Channels.newWriter(fileChannel, encoding);

        if (transactional) {
            writer = new TransactionAwareBufferedWriter(fileChannel, new Runnable() { 
                @Override
                public void run() { 
                    Stream.this.destroy();
                }
            });
                        ((TransactionAwareBufferedWriter) writer).setEncoding(encoding);
        }
        else {
            writer = new BufferedWriter(writer);
        }
            return writer;
        }
    catch (UnsupportedCharsetException ex) {
        throw new ItemStreamException("Bad encoding configuration for output file " + fileChannel, ex);
    }
}

Do you think there is some inconsistency now? I don't but ... :)

Regards,

Phil

Original issue reported on code.google.com by rolez.ph...@gmail.com on 8 Apr 2014 at 8:17

@GoogleCodeExporter
Copy link
Author

I find this : https://groups.google.com/forum/#!topic/beanio/N-FRNHIZcCc

sry,

i won't downgrade my spring-batch version ^^ I'll continue with my patch

Thx

Original comment by rolez.ph...@gmail.com on 8 Apr 2014 at 9:00

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant