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

Attempted to write multiple times to …, please check your configuration #2347

Closed
pascal-hofmann opened this issue Jul 30, 2018 · 5 comments
Labels

Comments

@pascal-hofmann
Copy link

With version 4.2.1 I get the error

throw new IllegalStateException("Attempted to write multiple times to " +

while using querydsl-maven-plugin together with jdbcDriver com.mysql.cj.jdbc.Driver (mysql-connector-java 8.0.11). This happens because the user I use to connect to MySQL has access to multiple databases. As a workaround I had to add nullCatalogMeansCurrent=true to jdbcUrl.

@Shredder121
Copy link
Member

Do you configure separate packages for the multiple schemas?
Or do you filter the schemas with a pattern?
Can you paint the picture a bit more, since it's intended to fail when the maven plugin detects the class was already generated.

@pascal-hofmann
Copy link
Author

pascal-hofmann commented Jul 30, 2018

I filter the tables via tableNamePattern, and tried to filter via schemaPattern, but this has no effect. (schema is always null, catalog is different depending on database name).

Edit1: db looks like this:

db1:
db1.Users
db2:
db2.Orders

ResultSet tables = md.getTables(null, schemaPattern, tablePattern, types);

returns two items who look like this in MetaDataExporter::handleTable (pseudo json):

{catalog: db1, schema: null, tableName: Users}
{catalog: db2, schema: null, tableName: Users}

Edit2: I only use the schema db1. db2 is not used at all by my application, but the user happens to have access to it.

@starsoheil2007
Copy link

I have same issue !

@sashuprosperoware
Copy link

Workaround : Create a new user in database which has access to only the given database for which you want to create Q files for. Done.

@stale
Copy link

stale bot commented Jun 3, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jun 3, 2021
@stale stale bot closed this as completed Jun 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants