Database Table partitions?
what happens if the database connection is lost temporarily while you’re iterating over a result set ? How do you design system to mitigate risk in such a scenario?
- Use Cached Rowset.
A CachedRowSet object is a disconnected row-set, which means that it makes use of a connection to its data source only briefly.
- It connects to its data source while it is reading data to populate itself with rows and again while it is propagating changes back to its underlying data source. The rest of the time, a CachedRowSet object is disconnected, including while its data is being modified.
- Being disconnected makes a RowSet object much leaner and therefore much easier to pass to another component.
- For example, a disconnected RowSet object can be serialized and passed over the wire to a thin client such as a personal digital assistant (PDA).2) We can set the prefetch size and that much rows will be cached in memory.
- Only from 26th row, it again attempt to go through the bridge to the database to fetch the next 25 rows.
What is database/table hash partitioning?
Hash partitioning is a partitioning technique where a hash key is used to distribute rows evenly across the different partitions (sub-tables). This is typically used where ranges aren’t appropriate, i.e. employee number, productID, etc.
create table emp2 ( empno number(4), ename varchar2(30), sal number ) partition by hash(empno) ( partition e1 tablespace emp1, partition e2 tablespace emp2, partition e3 tablespace emp3, partition e4 tablespace emp4 );