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

Add TomEE as JPAContainer #277

Merged
merged 1 commit into from
Jan 22, 2013
Merged

Add TomEE as JPAContainer #277

merged 1 commit into from
Jan 22, 2013

Conversation

rmannibucau
Copy link
Member

basic JPA Container for TomEE mainly to fix the default database type and jndi name

import javax.inject.Inject;

public class TomEEContainer extends JavaEEDefaultContainer {
private static final String DEFAULT_DATASOURCE_NAME = "Default JDBC Database";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wondering, is this really the JNDI data-source name for the example data-source?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No but i guess (well a bit more actually ;) you use it to set it on the persistence unit so with this value TomEE will be able to resolve it correctly (openejb:Resource/Default ...)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason I am asking is because this is the value that actually goes into the persistence.xml file under

    <jta-data-source>java:/DefaultDS</jta-data-source>

So in this case it would be:

    <jta-data-source>Default JDBC Database</jta-data-source>

Is that correct?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, that's even worse, if no datasource are defined you can put foo and it will work too

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean "worse?" Just trying to make sure I understand the situation :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well in fact default datasource can be the name you want. This one is just the real default one but if you want to put lincolnthree you can too ;). TomEE will automatically match the closer datasource and create one if noone are found.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds like the most sensible default datasource behavior i've ever heard.

lincolnthree added a commit that referenced this pull request Jan 22, 2013
@lincolnthree lincolnthree merged commit cc2a4b7 into forge:master Jan 22, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants