| java.lang.Object simpleorm.properties.SPropertyMap simpleorm.core.SConnection EJB.SConnectionEJB
SConnectionEJB | public class SConnectionEJB extends SConnection (Code) | | Specializes SConnection for use with JTA Transaction management.
(We do not want references to J2EE classes to appear directly in SimpleORM,
which should be kept...Simple.)
(There is absolutely no need to use JTA and aberglas recommends against JTA.)
The main problems is that EJBs do not guarantee that the same thread will be used
accross EJB calls. SimpleORM normally associates connections with threads.
The basic idea is to associate connections with the JTA transaction object
intead of the current thread.
DatabaseORM then implements a Synchronization object that tracks JTA commits and rollbacks.
This work is not part of the core SimpleORM package and is provided very much "as is".
However, the hooks it uses into SimpleORM are fully supported, and it provides
a pretty straightforward outline as to how to integrate SimpleORM with EJBs.
author: Dan Hristodorescu |
Constructor Summary | |
protected | SConnectionEJB() No direct creation of Connections. |
SConnectionEJB | protected SConnectionEJB()(Code) | | No direct creation of Connections.
|
attach | public static void attach(SConfiguration conf, String connectionName)(Code) | | overrides SConnection ot create an SConnectionEJB instead.
|
getTransaction | public static Transaction getTransaction()(Code) | | |
mustCommitBeforeDetaching | public boolean mustCommitBeforeDetaching()(Code) | | The JTA manager will do the commit.
|
rawAttach | protected void rawAttach()(Code) | | |
rawDetach | protected void rawDetach()(Code) | | |
Fields inherited from simpleorm.core.SConnection | protected static ConnectionGetter connectionGetter(Code)(Java Doc)
|
Methods inherited from simpleorm.core.SConnection | public static void attach(SDataSource source, String connectionName)(Code)(Java Doc) public static void attach(Connection con, String connectionName, SDriver driver)(Code)(Java Doc) public static void attach(Connection con, String connectionName)(Code)(Java Doc) public static void begin()(Code)(Java Doc) public static void commit()(Code)(Java Doc) public static void detachAndClose()(Code)(Java Doc) public static void detachWithoutClosing()(Code)(Java Doc) public static void dropTableNoError(String table)(Code)(Java Doc) public static void dumpCache()(Code)(Java Doc) public static void flush()(Code)(Java Doc) public static void flushAndPurge()(Code)(Java Doc) public static Connection getBegunDBConnection()(Code)(Java Doc) public static Connection getBegunJDBCConnection()(Code)(Java Doc) public static SConnection getConnection()(Code)(Java Doc) public SDataSource getDataSource()(Code)(Java Doc) public static SDriver getDriver()(Code)(Java Doc) public boolean hasBegun()(Code)(Java Doc) protected void innerAttach(SDataSource source, String connectionName, Connection rawConnection, SDriver driver)(Code)(Java Doc) public boolean isOpened()(Code)(Java Doc) public boolean mustCommitBeforeDetaching()(Code)(Java Doc) protected void rawAttach()(Code)(Java Doc) protected void rawDetach()(Code)(Java Doc) public static Object rawQueryDB(String sql, String[] params, int nrColumns)(Code)(Java Doc) public static Object rawQueryDB(String sql, String[] params)(Code)(Java Doc) public static Object rawQueryDB(String sql, String param)(Code)(Java Doc) public static Object rawQueryDB(String sql)(Code)(Java Doc) public static Object rawQueryJDBC(String sql, String[] params, int nrColumns)(Code)(Java Doc) public static Object rawQueryJDBC(String sql, String[] params)(Code)(Java Doc) public static Object rawQueryJDBC(String sql, String param)(Code)(Java Doc) public static Object rawQueryJDBC(String sql)(Code)(Java Doc) public static int rawUpdateDB(String sql, Object[] params)(Code)(Java Doc) public static int rawUpdateDB(String sql, Object param)(Code)(Java Doc) public static int rawUpdateDB(String sql)(Code)(Java Doc) public static int rawUpdateJDBC(String sql, Object[] params)(Code)(Java Doc) public static int rawUpdateJDBC(String sql, Object param)(Code)(Java Doc) public static int rawUpdateJDBC(String sql)(Code)(Java Doc) public static void rollback()(Code)(Java Doc) public String toString()(Code)(Java Doc) public void unsafeAttachToThread()(Code)(Java Doc) public static SConnection unsafeDetachFromThread()(Code)(Java Doc)
|
|
|