From: <one...@us...> - 2002-12-15 10:46:43
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate In directory sc8-pr-cvs1:/tmp/cvs-serv30186/hibernate Modified Files: Session.java Transaction.java Log Message: added FlushMode API Index: Session.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/Session.java,v retrieving revision 1.79 retrieving revision 1.80 diff -C2 -d -r1.79 -r1.80 *** Session.java 14 Nov 2002 11:28:54 -0000 1.79 --- Session.java 15 Dec 2002 10:46:39 -0000 1.80 *************** *** 83,90 **** /** * Force the <tt>Session</tt> to flush. Must be called at the end of a ! * unit of work, before commiting the connection and closing the ! * session. <i>Flushing</i> is the process of synchronising the ! * underlying persistent store with persistable state held in ! * memory. * * @throws SQLException --- 83,90 ---- /** * Force the <tt>Session</tt> to flush. Must be called at the end of a ! * unit of work, before commiting the transaction and closing the ! * session (<tt>Transaction.commit()</tt> calls this method). <i>Flushing</i> ! * is the process of synchronising the underlying persistent store with ! * persistable state held in memory. * * @throws SQLException *************** *** 94,97 **** --- 94,113 ---- /** + * Set the flush mode. The flush mode determines at which points + * Hibernate automatically flushes the session. For a readonly + * session, it is reasonable to set the flush mode to + * <tt>FlushMode.NEVER</tt> at the start of the session (in + * order to achieve some extra performance). + * + * @see FlushMode + */ + public void setFlushMode(FlushMode flushMode); + + /** + * Get the current flush mode. + */ + public FlushMode getFlushMode(); + + /** * Get the JDBC connection. Applications are responsible for * calling commit/rollback upon the connection before closing *************** *** 402,407 **** /** ! * Apply a filter to a persistent collection, binding the given parameters to "?" placeholders. A filter ! * is a Hibernate query that may refer to <tt>this</tt>, the collection element. * * @param collection a persistent collection to filter --- 418,423 ---- /** ! * Apply a filter to a persistent collection, binding the given parameters to "?" placeholders. ! * A filter is a Hibernate query that may refer to <tt>this</tt>, the collection element. * * @param collection a persistent collection to filter *************** *** 480,500 **** /** - * Postpone execution of all SQL inserts, deletes and updates until <tt>flush()</tt> - * is explicitly called by the application. The default behaviour is to flush before - * execution of a query whose results may be affected by persistent state changes - * cached by the <tt>Session</tt>. After this method is called, query results may not - * be consistent with state held in memory. - * @see Session#resumeFlushes() - */ - public void suspendFlushes(); - - /** - * Resume the default behaviour, which is to flush SQL statements before execution of - * a query whose results may be affected by persistent state changes cached in memory. - * @see Session#suspendFlushes() - */ - public void resumeFlushes(); - - /** * Create a new instance of <tt>Query</tt> for the given query string. * --- 496,499 ---- *************** *** 527,530 **** --- 526,550 ---- //DEPRECATED: + /** + * Postpone execution of all SQL inserts, deletes and updates until <tt>flush()</tt> + * is explicitly called by the application. The default behaviour is to flush before + * execution of a query whose results may be affected by persistent state changes + * cached by the <tt>Session</tt>. After this method is called, query results may not + * be consistent with state held in memory. + * + * @deprecated use <tt>setFlushMode(FlushMode.COMMIT)</tt> + * @see Session#resumeFlushes() + */ + public void suspendFlushes(); + + /** + * Resume the default behaviour, which is to flush SQL statements before execution of + * a query whose results may be affected by persistent state changes cached in memory. + * + * @deprecated use <tt>setFlushMode(FlushMode.AUTO)</tt> + * @see Session#suspendFlushes() + */ + public void resumeFlushes(); + /** * Execute a query, returning only the identifiers. Index: Transaction.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/Transaction.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Transaction.java 10 Jun 2002 09:42:27 -0000 1.5 --- Transaction.java 15 Dec 2002 10:46:39 -0000 1.6 *************** *** 11,18 **** * A transaction is associated with a <tt>Session</tt> and is * usually instantiated by a call to <tt>Session.beginTransaction()</tt>. ! * However, a single session might span multiple transactions since * the notion of a session (a conversation between the application * and the datastore) is of coarser granularity than the notion of ! * a transaction.<br> * <br> * Implementors are not intended to be threadsafe. --- 11,20 ---- * A transaction is associated with a <tt>Session</tt> and is * usually instantiated by a call to <tt>Session.beginTransaction()</tt>. ! * A single session might span multiple transactions since * the notion of a session (a conversation between the application * and the datastore) is of coarser granularity than the notion of ! * a transaction. However, it is intended that there be at most one ! * uncommitted <tt>Transaction</tt> associated with a particular ! * <tt>Session</tt> at any time.<br> * <br> * Implementors are not intended to be threadsafe. |