Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 75304 Details for
Bug 198779
Java HotSpot Error in libjava.so Java_java_lang_Class_forName0
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
The java file
NoLockFund.java (text/x-java), 8.26 KB, created by
Tilmann Zaeschke
on 2007-08-03 04:42:46 EDT
(
hide
)
Description:
The java file
Filename:
MIME Type:
Creator:
Tilmann Zaeschke
Created:
2007-08-03 04:42:46 EDT
Size:
8.26 KB
patch
obsolete
>package vql7; > >import herschel.ccm.api.param.ParameterSet; >import herschel.ccm.api.phs.ObservationConstraint; >import herschel.store.util.DBUtil; >import herschel.versant.ccm.IdRegistry; >import herschel.versant.ccm.ObservingModeImpl; >//import herschel.versant.ccm.phs.AbstractTarget; >import herschel.versant.ccm.phs.EstimatesImpl; >import herschel.versant.ccm.phs.FixedTimeConstraintImpl; >import herschel.versant.ccm.phs.ObservationRequestImpl; >import herschel.versant.ccm.phs.ProposalImpl; >import herschel.versant.ccm.phs.VersionableObservationRequest; >import herschel.versant.ccm.util.DBPersistentCapable; >import herschel.versant.ccm.util.DBVector; > >import java.lang.reflect.Constructor; >import java.lang.reflect.InvocationTargetException; >import java.util.LinkedList; >import java.util.List; >import java.util.Properties; >import java.util.Vector; >import java.util.logging.Logger; > >import com.versant.fund.Constants; >import com.versant.fund.FundQuery; >import com.versant.fund.FundQueryResult; >import com.versant.fund.Handle; >import com.versant.fund.HandleVector; >import com.versant.fund.QueryExecutionOptions; >import com.versant.fund.VException; >import com.versant.trans.Query; >import com.versant.trans.QueryResult; >import com.versant.trans.TransSession; > >/** > * Reproduces that the query keeps an IRLOCK on the class object. > * > * @author Tilmann Zaeschke > * > */ >public class NoLockFund implements DBPersistentCapable { > > private final static Logger _LOGGER = > Logger.getLogger(ObservationRequestImpl.class.getName()); > private int o_ts_timestamp = 0; //required for optimistic locking > //now transient rather than static for consistency with the other IdRegistries > private final transient IdRegistry _registry = new IdRegistry( > "ObservationRequest"); > private static final long UNDEFINED_DURATION = -1; > /** > * @associates Observation > * @link aggregation > * @supplierCardinality 0..* > */ >// private Vector _observations = new Vector(); // Associated Observation instances > private ObservingModeImpl _mode; // Associated ObservingMode > private List _observations = new Vector(); // Associated Observation instances > private ParameterSet _pset; // Parameters of this request > private ProposalImpl _proposal; // Associated Proposal > private boolean _schedulable; // True if available for scheduling > private long _id; // Unique ID of this request > //private float _hotacRating; // The HOTAC rating - only associated with proposal - not OR > private int _status; // The status > private String _title; // The Title > private String _observerComment; // The observer's comment >// private AbstractTarget _target; // Associated Target > private boolean _hscBlocked; // True if it is blocked by the hsc > private boolean _userBlocked; // True if it is blocked by the user > private long _duration = UNDEFINED_DURATION;//cached duration - requested by jb 06/09/04 > private FixedTimeConstraintImpl _fixedTimeConstraint; // a fixed time constraint > private EstimatesImpl _estimates = null; // the estimates > private int _instrument = 0; // the instrument > private int _subInstrument = 0; // the subinstrument > // new attribute - default to a new Vector as part of schema evolution > private DBVector<ObservationConstraint> _constraints = > new DBVector<ObservationConstraint>(this); > > // new attribute - default to an empty array as part of schema evolution > private double[] _chopperAvoidanceAngle = new double[0]; // pairs of chopper angles to avoid > > //versioning attributes > private VersionableObservationRequest _proxy; // Proxy for this version. > private int _versionNumber; > private transient boolean _mutable; > > private NoLockFund() { > _observations.add(new DBVector(this)); > _proxy = new VersionableObservationRequest(); > _observations.add(new String("212")); > } > > > > > > > > > private static String _database; >// private static Class _class = NoLockFund.class; > private static Class _class = ObservationRequestImpl.class; >// private final List<Handle[]> _batches = new LinkedList<Handle[]>(); > > /** > * @param args > * @throws InterruptedException > */ > public static void main(String[] args) throws InterruptedException { > _database = args[0]; > >// System.out.print("Populating... "); >// populate(); > System.out.println(" Done."); > run(); > } > > private static void populate() { > try { > DBUtil.dropClassSchema(_database, _class); > } catch (VException e) { > System.out.println("ERROR: " + e.getMessage()); > //ignore > } > DBUtil.defineClassSchema(_database, _class); > > TransSession tx = null; > try { > tx = new TransSession(_database); > Constructor c = _class.getDeclaredConstructor(); > c.setAccessible(true); > for (int i = 0; i < 20000; i ++) { > Object o = c.newInstance(); > tx.makePersistent(o); > } > tx.commit(); > } catch (SecurityException e) { > // TODO Auto-generated catch block > e.printStackTrace(); > } catch (NoSuchMethodException e) { > // TODO Auto-generated catch block > e.printStackTrace(); > } catch (IllegalArgumentException e) { > // TODO Auto-generated catch block > e.printStackTrace(); > } catch (InstantiationException e) { > // TODO Auto-generated catch block > e.printStackTrace(); > } catch (IllegalAccessException e) { > // TODO Auto-generated catch block > e.printStackTrace(); > } catch (InvocationTargetException e) { > // TODO Auto-generated catch block > e.printStackTrace(); > } finally { > if (tx != null) { > tx.endSession(); > } > } > } > > private static void run() throws InterruptedException { > TransSession tx = null; > try { > Properties dbProp = new Properties(); > dbProp.put("database", _database); > dbProp.put("options", Constants.OPT_LK + ""); > dbProp.put("lockmode", Constants.NOLOCK + ""); > tx = new TransSession(dbProp); > QueryExecutionOptions opts = new QueryExecutionOptions(); > opts.setFetchObjects(false); > opts.setFlushAll(false); > opts.setFlushNone(true); > opts.setPinObjects(false); > > //FundQuery query = new FundQuery(tx, "select selfoid from " + NoLockFund.class.getName()); > FundQuery query = new FundQuery(tx, "select selfoid from " + _class.getName()); > query.setClassLockMode(Constants.NOLOCK); > query.setInstanceLockMode(Constants.NOLOCK); > query.setFetchSize(1000); > tx.setThreadOptions(Constants.DROP_RLOCK); > FundQueryResult r = query.execute(opts); > Handle[] ha = null; > Object[] batch = null; > int n = 0; > while ((ha = r.next(1000)) != null && ha.length > 0) { > batch = loadHA(ha, tx); > for (Object o: batch) { > o.hashCode(); > n++; > } > System.out.print('.'); > if (n >= 30000) { > return; > } > } >// Object o = null; >// while ((o = r.next()) != null) { >// o.hashCode(); >// n++; >// if (n % 1000 == 0) System.out.print('.'); >// } >//TODO r.close(); > query.close(); > System.out.println("FOUND: " + n); >// System.out.println("Waiting:"); >// Thread.sleep(10000); > } finally { > if (tx != null) { > tx.endSession(); > } > } > } > > private static Object[] loadHA(Handle[] ha, TransSession tx) { > HandleVector hv = tx.newHandleVector(ha); > hv.groupReadObjects(tx.database(), 0, Constants.NOLOCK); > Object[] b = new Object[hv.size()]; > for (int i = 0; i < b.length; i++) { > b[i] = hv.handleAt(i).handleToObject(); >// b[i] = tx.handleToObject(hv.handleAt(i)); > } > return b; > } > >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 198779
:
75302
|
75303
|
75304
|
75305
|
75308
|
75309
|
75310
|
75311
|
94526