-
Notifications
You must be signed in to change notification settings - Fork 162
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
Conversation
import javax.inject.Inject; | ||
|
||
public class TomEEContainer extends JavaEEDefaultContainer { | ||
private static final String DEFAULT_DATASOURCE_NAME = "Default JDBC Database"; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 ...)
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Add TomEE as JPAContainer
basic JPA Container for TomEE mainly to fix the default database type and jndi name