EJB 3.0 – Nested Transaction != Requires New?

RequiresNew does not create a nested transaction because the first transaction is suspended while the second transaction is running. A nested transaction looks like this: Nested transaction example > method1 – begin tran1 > method2 – begin tran2 workA < method2 – commit tran2 < method1 – rollback tran1 (tran2 also rolled back because it’s … Read more

How to include values from .properties file into web.xml?

You can add this class, that add all properties from your file to JVM. And add this class like context-listener to web.xml public class InitVariables implements ServletContextListener { @Override public void contextDestroyed(final ServletContextEvent event) { } @Override public void contextInitialized(final ServletContextEvent event) { final String props = “/file.properties”; final Properties propsFromFile = new Properties(); try … Read more

What is a host only cookie?

First of all, it is not possible for foo.com to set a cookie that can be read by bar.com. Host-only only protects example.com cookies from being read by bar.example.com. From RFC 6265 regarding setting a cookie and its Domain attribute: If the domain-attribute is non-empty: If the canonicalized request-host does not domain-match the domain-attribute: Ignore … Read more

What is Java EE? [duplicate]

Java EE is a collection of specifications for developing and deploying enterprise applications. In general, enterprise applications refer to software hosted on servers that provide the applications that support the enterprise. The specifications (defined by Sun) describe services, application programming interfaces (APIs), and protocols. The 13 core technologies that make up Java EE are: JDBC … Read more

Notify only specific user(s) through WebSockets, when something is modified in the database

Session? Since it is available when the first handshake request is made, any attribute set to that session afterwards will not be available in the server endpoint i.e. in other words, any session attribute set after a handshake is established will not be available It seems that you got bitten by the ambiguity of the … Read more

Where to use EJB 3.1 and CDI?

Yes, you can freely mix both CDI and EJB and achieve some great results. It sounds like you are using @WebService and @Schedule, which are good reasons for adding EJB to the mix. There’s a lot of confusion out there, so here is some general information on EJB and CDI as they relate to each … Read more